PayFanout API reference
    Preparing search index...

    Interface CreatePaymentSessionInput

    interface CreatePaymentSessionInput {
        amount: number;
        billingDetails?: {
            address?: {
                city?: string;
                country?: string;
                line1?: string;
                postalCode?: string;
            };
            email?: string;
            name?: string;
        };
        captureMethod?: "automatic"
        | "manual";
        country?: string;
        currency: string;
        customer?: string;
        customerCountry?: string;
        id?: string;
        idempotencyKey: string;
        metadata?: Record<string, string>;
        paymentMethodTypes?: (
            | "card"
            | "apple_pay"
            | "google_pay"
            | "paypal"
            | "ideal"
            | "sepa_debit"
            | "ach"
            | "bacs_debit"
            | "pad"
            | "interac_etransfer"
            | "skrill"
            | "neteller"
            | "paysafecard"
            | "paysafecash"
            | "bank_redirect_generic"
            | "voucher_generic"
            | "other"
        )[];
        receiptEmail?: string;
        returnUrl?: string;
        savePaymentMethod?: boolean;
        sca?: ScaPreference;
        shippingDetails?: ShippingDetails;
        statementDescriptor?: string;
        webhookUrl?: string;
    }
    Index
    amount: number
    billingDetails?: {
        address?: {
            city?: string;
            country?: string;
            line1?: string;
            postalCode?: string;
        };
        email?: string;
        name?: string;
    }

    For AVS / 3DS data quality — optional, never card data.

    captureMethod?: "automatic" | "manual"

    Only honored if getCapabilities().supportsManualCapture.

    country?: string

    The MERCHANT side: needed for merchant-account resolution (Paysafe). Never consulted for rail eligibility — that reads customerCountry.

    currency: string
    customer?: string

    PSP customer id (from createCustomer) this payment belongs to. Required when savePaymentMethod is true.

    customerCountry?: string

    The CUSTOMER's country (ISO 3166-1 alpha-2), when the host knows it — an explicit country selector, account data, delivery country. Screening uses it to skip a PSP whose requested rails declare countries excluding the customer (Bacs outside the UK); ABSENT means country-restricted rails are not screened at all, so omitting it never hides a PSP. Deliberately distinct from billingDetails.address.country: a billing address is not a bank-account country — a French billing address can pay a German IBAN over SEPA — so that field is never read as a screening signal.

    id?: string

    Optional host-app internal id. PayFanout does not persist it — adapters stamp it into PSP metadata (key "payfanout_id") so it round-trips via webhooks and retrievePayment. Defaults to the PSP session id when omitted.

    idempotencyKey: string
    metadata?: Record<string, string>
    paymentMethodTypes?: (
        | "card"
        | "apple_pay"
        | "google_pay"
        | "paypal"
        | "ideal"
        | "sepa_debit"
        | "ach"
        | "bacs_debit"
        | "pad"
        | "interac_etransfer"
        | "skrill"
        | "neteller"
        | "paysafecard"
        | "paysafecash"
        | "bank_redirect_generic"
        | "voucher_generic"
        | "other"
    )[]

    Restrict what the session accepts.

    receiptEmail?: string

    Receipt/notification email, where the PSP sends receipts (Stripe).

    returnUrl?: string

    Required by some 3DS / redirect completions.

    savePaymentMethod?: boolean

    Vault the instrument at the PSP during this checkout (with the customer's consent — the host renders the "save my card" checkbox). The resulting token arrives on PaymentInfo.savedPaymentMethodToken. Only honored if getCapabilities().supportsSavedPaymentMethods.

    SCA/3DS tuning — request a challenge or an exemption where supported.

    shippingDetails?: ShippingDetails

    Needed for wallets and fraud scoring. Never card data.

    statementDescriptor?: string

    What shows on the customer's bank statement. PSP rules apply (length, charset) — adapters validate what they can and surface PSP rejections.

    webhookUrl?: string

    Per-session webhook registration (Paysafe requires this at session/payment init). Adapters that register webhooks globally (Stripe) ignore it.