PayFanout API reference
    Preparing search index...

    Function paypalSubscriptionToRecord

    • Normalizes a Subscriptions v1 subscription object into the unified record. The recurring amount ladder (each rung falls through when unusable):

      1. The first REGULAR billing cycle's pricing_scheme.fixed_price — a PER-UNIT price on quantity-based plans, so it is multiplied by the subscription's quantity (integer minor units × integer count stays exact; the default single unit applies when quantity is absent, and a non-integer or unparsable quantity invalidates the rung rather than rounding an invented number). Requires the GET to have carried fields=plan.
      2. billing_info.last_payment.amount — already the collected TOTAL for the whole quantity, so it is NEVER multiplied.
      3. Amount 0 with the truth on raw — an un-projectable subscription (e.g. a tier-priced plan that never billed) must not reject a whole list page or stall an adoption walk over one record.

      Parameters

      Returns NativeSubscriptionRecord