PayFanout API reference
    Preparing search index...

    Interface NativeSubscriptionRecord

    A subscription that lives at the PSP — the PSP schedules and collects each charge itself. Distinct from @payfanout/server's host-side SubscriptionManager, where the HOST bills on vault tokens: these records are read from / written to the provider's own billing product, the primitive under migrating merchants off PSP-native billing (list at the PSP, re-create in the host engine, cancel at the PSP).

    interface NativeSubscriptionRecord {
        amount: number;
        currency: string;
        currentPeriodEnd?: string;
        currentPeriodStart?: string;
        customer?: {
            email?: string;
            firstName?: string;
            lastName?: string;
            locale?: string;
            phone?: string;
        };
        id: string;
        interval?: "day"
        | "week"
        | "month"
        | "year";
        intervalCount?: number;
        merchantRefNum?: string;
        planId?: string;
        pspCustomerId?: string;
        pspName: string;
        raw?: unknown;
        savedPaymentMethodToken?: string;
        schedule?: string;
        status:
            | "unknown"
            | "canceled"
            | "pending"
            | "trialing"
            | "active"
            | "past_due"
            | "paused"
            | "completed";
    }
    Index
    amount: number

    Amount of each installment. Integer minor units.

    currency: string

    Uppercase ISO 4217.

    currentPeriodEnd?: string

    ISO 8601 — when the next charge is due.

    currentPeriodStart?: string

    ISO 8601.

    customer?: {
        email?: string;
        firstName?: string;
        lastName?: string;
        locale?: string;
        phone?: string;
    }

    Contact facts as stored at the PSP, for host-side matching during adoption.

    id: string

    The PSP's subscription id — the handle retrieve/cancel operate on.

    interval?: "day" | "week" | "month" | "year"

    Absent when the source cadence has no faithful day/week/month/year projection.

    intervalCount?: number

    e.g. every 3 months -> interval "month", intervalCount 3.

    merchantRefNum?: string

    Merchant reference stored on the PSP subscription, where the PSP has one.

    planId?: string

    The PSP plan/price the subscription bills from, where the PSP models one.

    pspCustomerId?: string
    pspName: string
    raw?: unknown
    savedPaymentMethodToken?: string

    Vault token / mandate the PSP charges, when the PSP reports it.

    schedule?: string

    The source schedule for richer cadences (RFC 5545 RRULE), where the PSP has one.

    status:
        | "unknown"
        | "canceled"
        | "pending"
        | "trialing"
        | "active"
        | "past_due"
        | "paused"
        | "completed"