PayFanout API reference
    Preparing search index...

    Interface CreateSubscriptionInput

    interface CreateSubscriptionInput {
        billingDetails?: {
            address?: {
                city?: string;
                country?: string;
                line1?: string;
                postalCode?: string;
            };
            email?: string;
            name?: string;
        };
        id?: string;
        idempotencyKey: string;
        metadata?: Record<string, string>;
        plan: SubscriptionPlan;
        pspCustomerId: string;
        pspName: string;
        savedPaymentMethodToken: string;
        startAt?: string | Date;
    }
    Index
    billingDetails?: {
        address?: {
            city?: string;
            country?: string;
            line1?: string;
            postalCode?: string;
        };
        email?: string;
        name?: string;
    }

    AVS data carried on the record and forwarded on EVERY charge (first and renewals) — some PSPs (Paysafe) demand a zip on stored-token charges of browser-tokenized cards.

    id?: string

    Host-app id; defaults to a generated UUID.

    idempotencyKey: string

    Idempotency for the FIRST charge (renewals derive their own keys).

    metadata?: Record<string, string>
    pspCustomerId: string
    pspName: string
    savedPaymentMethodToken: string

    SavedPaymentMethod.token / PaymentInfo.savedPaymentMethodToken.

    startAt?: string | Date

    Future instant = trial / delayed start: nothing is charged now, the first charge happens when chargeDueSubscriptions crosses it. Omitted = charge the first period immediately (customer-present "initial" charge).