Mayson Monorepo Documentation
    Preparing search index...

    A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use PaymentIntents to drive the payment flow.

    Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent transitions through multiple statuses as it guides you through the setup process.

    Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in certain regions might need to be run through Strong Customer Authentication during payment method collection to streamline later off-session payments. If you use the SetupIntent with a Customer, it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or setup_future_usage on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.

    By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.

    Related guide: Setup Intents API

    Index

    Properties

    id: string

    Unique identifier for the object.

    object: "setup_intent"

    String representing the object's type. Objects of the same type share the same value.

    application: string | Application

    ID of the Connect application that created the SetupIntent.

    attach_to_self?: boolean

    If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

    It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

    automatic_payment_methods: Stripe.SetupIntent.AutomaticPaymentMethods

    Settings for dynamic payment methods compatible with this Setup Intent

    Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate.

    client_secret: string

    The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

    The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

    created: number

    Time at which the object was created. Measured in seconds since the Unix epoch.

    customer: string | Stripe.Customer | DeletedCustomer

    ID of the Customer this SetupIntent belongs to, if one exists.

    If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

    customer_account?: string

    ID of the Account this SetupIntent belongs to, if one exists.

    If present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent.

    description: string

    An arbitrary string attached to the object. Often useful for displaying to users.

    excluded_payment_method_types: Stripe.SetupIntent.ExcludedPaymentMethodType[]

    Payment method types that are excluded from this SetupIntent.

    flow_directions: Stripe.SetupIntent.FlowDirection[]

    Indicates the directions of money movement for which this payment method is intended to be used.

    Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

    The error encountered in the previous SetupIntent confirmation.

    latest_attempt: string | Stripe.SetupAttempt

    The most recent SetupAttempt for this SetupIntent.

    livemode: boolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

    mandate: string | Stripe.Mandate

    ID of the multi use Mandate generated by the SetupIntent.

    metadata: Metadata

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

    If present, this property tells you what actions you need to take in order for your customer to continue payment setup.

    on_behalf_of: string | Stripe.Account

    The account (if any) for which the setup is intended.

    payment_method: string | Stripe.PaymentMethod

    ID of the payment method used with this SetupIntent. If the payment method is card_present and isn't a digital wallet, then the generated_card associated with the latest_attempt is attached to the Customer instead.

    payment_method_configuration_details: Stripe.SetupIntent.PaymentMethodConfigurationDetails

    Information about the payment method configuration used for this Setup Intent.

    payment_method_options: Stripe.SetupIntent.PaymentMethodOptions

    Payment method-specific configuration for this SetupIntent.

    payment_method_types: string[]

    The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found here.

    single_use_mandate: string | Stripe.Mandate

    ID of the single_use Mandate generated by the SetupIntent.

    Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded.

    usage: string

    Indicates how the payment method is intended to be used in the future.

    Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.