Skip to main content
Docs

CommerceCheckoutResource

The CommerceCheckoutResource type represents information about a checkout session.

Properties

  • Name
    id
    Type
    string
    Description

    The unique identifier for the checkout session.

  • 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
    paymentSource
    Type
    CommercePaymentSourceResource | undefined
    Description

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

  • Name
    plan
    Type
    CommercePlanResource
    Description

    The subscription plan details for the checkout.

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

    The billing period for the plan.

  • Name
    planPeriodStart
    Type
    number | undefined
    Description

    The start date of the plan period, represented as a Unix timestamp.

  • Name
    status
    Type
    'needs_initialization' | 'needs_confirmation' | 'completed'
    Description

    The current status of the checkout session.

  • Name
    totals
    Type
    Description

    The total costs, taxes, and other pricing details.

  • Name
    isImmediatePlanChange
    Type
    boolean
    Description

    A boolean that indicates if the plan change will take effect immediately after checkout.

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

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

confirm()

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

Parameters

Only one of paymentSourceId, paymentToken, or useTestCard should be provided.

  • Name
    orgId?
    Type
    string | undefined
    Description

    The organization ID to perform the checkout for.

  • Name
    paymentSourceId?
    Type
    string | undefined
    Description

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

  • Name
    paymentToken?
    Type
    string | undefined
    Description

    A token representing payment details, usually from a payment form.

    Requires gateway to be provided.

  • Name
    useTestCard?
    Type
    boolean | undefined
    Description

    If true, uses a test card for the checkout.

    Requires gateway to be provided.

  • Name
    gateway?
    Type
    PaymentGateway | undefined
    Description

    The payment gateway to use. For example, 'stripe' or 'paypal'.

    Required if paymentToken or useTestCard is provided.

Feedback

What did you think of this content?

Last updated on