Skip to main content
Docs

BillingCheckoutResource

Warning

Billing is currently in Beta and its APIs are experimental and may undergo breaking changes. To mitigate potential disruptions, we recommend pinning your SDK and clerk-js package versions.

The BillingCheckoutResource type represents information about a checkout session.

Properties

  • Name
    confirm
    Type
    (params: ConfirmCheckoutParams) => Promise<BillingCheckoutResource>
    Description

    A function to confirm and finalize the checkout process, usually after payment information has been provided and validated. Learn more.

  • Name
    externalClientSecret
    Type
    string
    Description

    A client secret from an external payment provider (such as Stripe) used to complete the payment on the client-side.

  • Name
    externalGatewayId
    Type
    string
    Description

    The identifier for the external payment gateway used for this checkout session.

  • Name
    freeTrialEndsAt
    Type
    null | Date
    Description

    Unix timestamp (milliseconds) of when the free trial ends.

  • Name
    id
    Type
    string
    Description

    The unique identifier for the checkout session.

  • Name
    isImmediatePlanChange
    Type
    boolean
    Description

    Whether the plan change will take effect immediately after checkout.

  • Name
    pathRoot
    Type
    string
    Description

    The root path of the resource.

  • Name
    payer
    Type
    BillingPayerResource
    Description

    The payer associated with the checkout.

  • Name
    paymentSource?
    Type
    BillingPaymentSourceResource
    Description

    The payment source being used for the checkout, such as a credit card or bank account.

  • Name
    plan
    Type
    BillingPlanResource
    Description

    The subscription plan details for the checkout.

  • Name
    planPeriod
    Type
    "month" | "annual"
    Description

    The billing period for the plan.

  • Name
    planPeriodStart?
    Type
    number
    Description

    Unix timestamp (milliseconds) of when the current period starts.

  • Name
    status
    Type
    "completed" | "needs_confirmation"
    Description

    The current status of the checkout session.

  • Name
    totals
    Type
    BillingCheckoutTotals
    Description

    The total costs, taxes, and other pricing details for the checkout.

confirm()

The confirm() function is used to confirm and finalize the checkout process, usually after payment information has been provided and validated.

Parameters

The confirm() method accepts the following parameters. Only one of paymentSourceId, paymentToken, or useTestCard should be provided.

There are multiple variants of this type available which you can select by clicking on one of the tabs.

  • Name
    paymentSourceId?
    Type
    string
    Description

    The ID of a saved payment source to use for this checkout.

  • Name
    gateway?
    Type
    "stripe" | "paypal"
    Description

    The payment gateway to use. Required if paymentToken or useTestCard is provided.

  • Name
    paymentToken?
    Type
    string
    Description

    A token representing payment details, usually from a payment form. Requires gateway to be provided.

  • Name
    gateway?
    Type
    "stripe" | "paypal"
    Description

    The payment gateway to use. Required if paymentToken or useTestCard is provided.

  • Name
    useTestCard?
    Type
    boolean
    Description

    If true, uses a test card for the checkout. Requires gateway to be provided.

Feedback

What did you think of this content?

Last updated on