PostCustomersCustomerSubscriptionsSubscriptionExposedId
<p>Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the <a href="#upcoming_invoice">upcoming invoice</a> endpoint.</p>
/v1/customers/{customer}/subscriptions/{subscription_exposed_id}- Source
openapi/spec3.json- Commit
d70de345383d- Active snapshot
da69df7e6e11
Request
Authorization
Read-onlyCredentials are never accepted or stored on this documentation page.
Send credentials in the Authorization request header using the Basic scheme.
Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>
- Request header
- Authorization
- Scheme
- basic
Send the token in the Authorization request header using the Bearer scheme.
Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>
- Request header
- Authorization
- Scheme
- bearer
- Bearer format
- auth-scheme
Path Parameters
- customer stringrequired
- subscription_exposed_id stringrequired
Body Params
optional add_invoice_items array[add_invoice_item_entry object]optionalA list of prices and quantities that will generate invoice items appended to the first invoice for this subscription. You may pass up to 20 items.
A list of prices and quantities that will generate invoice items appended to the first invoice for this subscription. You may pass up to 20 items.
items add_invoice_item_entry object
price_data one_time_price_data objectoptional
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
automatic_tax automatic_tax_config objectoptionalAutomatic tax settings for this subscription.
Automatic tax settings for this subscription.
Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
Boolean indicating whether this subscription should cancel at the end of the current period.
Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to `charge_automatically`.
The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.
Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates.
Specifies which fields in the response should be expanded.
items array[subscription_item_update_params object]optionalA list of up to 20 subscription items, each with an attached price.
A list of up to 20 subscription items, each with an attached price.
items subscription_item_update_params object
price_data recurring_price_data objectoptional
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
Indicates if a customer is on or off-session while an invoice payment is attempted.
If specified, payment collection for this subscription will be paused.
Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
payment_settings payment_settings objectoptionalPayment settings to pass to invoices created by the subscription.
Payment settings to pass to invoices created by the subscription.
payment_method_options payment_method_options objectoptional
Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.
Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. Prorations can be disabled by passing `none`.
If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value.
Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
Responses
Successful response.
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.
automatic_tax SubscriptionAutomaticTax objectrequired
Whether Stripe automatically computes tax on this subscription.
Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
A date in the future at which the subscription will automatically get canceled
If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.
Time at which the object was created. Measured in seconds since the Unix epoch.
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
Start of the current period that the subscription has been invoiced for.
ID of the customer who owns the subscription.
Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
default_tax_rates array[TaxRate object]optionalnullable The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
items TaxRate objectTax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.
Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates).
Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates).
Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
Time at which the object was created. Measured in seconds since the Unix epoch.
An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
Unique identifier for the object.
This specifies if the tax rate is inclusive or exclusive.
The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
String representing the object's type. Objects of the same type share the same value.
This represents the tax rate percent out of 100.
[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
The high-level tax type, such as `vat` or `sales_tax`.
Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
If the subscription has ended, the date the subscription ended.
Unique identifier for the object.
items SubscriptionItemList objectrequiredList of subscription items, each with an attached price.
List of subscription items, each with an attached price.
data array[SubscriptionItem object]requiredDetails about each object.
Details about each object.
items SubscriptionItem objectSubscription items allow you to create customer subscriptions with more than
one plan, making it easy to represent complex billing relationships.
Subscription items allow you to create customer subscriptions with more than one plan, making it easy to represent complex billing relationships.
Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
Time at which the object was created. Measured in seconds since the Unix epoch.
Unique identifier for the object.
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
String representing the object's type. Objects of the same type share the same value.
Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/billing/prices-guide).
The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed.
The `subscription` this `subscription_item` belongs to.
The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
True if this list has another page of items after this one that can be fetched.
String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
The URL where this list can be accessed.
The most recent invoice this subscription has generated.
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
String representing the object's type. Objects of the same type share the same value.
If specified, payment collection for this subscription will be paused.
Payment settings passed on to invoices created by the subscription.
Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2).
If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
The schedule attached to the subscription
Date when the subscription was first created. The date might differ from the `created` date due to backdating.
Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. If subscription `collection_method=charge_automatically` it becomes `past_due` when payment to renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts. If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
If the subscription has a trial, the end of that trial.
If the subscription has a trial, the beginning of that trial.
Error response.
error APIErrors objectrequired
For card errors, the ID of the failed charge.
For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
payment_intent PaymentIntent objectoptionalA PaymentIntent guides you through the process of collecting a payment from your customer.
We recommend that you create exactly one PaymentIntent for each order or
customer session in your system. You can reference the PaymentIntent later to
see the history of payment attempts for a particular session.
A PaymentIntent transitions through
[multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses)
throughout its lifetime as it interfaces with Stripe.js to perform
authentication flows and ultimately creates at most one successful charge.
Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents).
A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents).
Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
Amount that can be captured from this PaymentIntent.
Amount that was collected by this PaymentIntent.
ID of the Connect application that created the PaymentIntent.
The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods)
Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).
Controls when the funds will be captured from the customer's account.
charges PaymentFlowsPaymentIntentResourceChargeList objectoptionalCharges that were created by this PaymentIntent, if any.
Charges that were created by this PaymentIntent, if any.
This list only contains the latest charge, even if there were previously multiple unsuccessful charges. To view all previous charges for a PaymentIntent, you can filter the charges list using the `payment_intent` [parameter](https://stripe.com/docs/api/charges/list#list_charges-payment_intent).
True if this list has another page of items after this one that can be fetched.
String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
The URL where this list can be accessed.
The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?integration=elements) and learn about how `client_secret` should be handled.
Time at which the object was created. Measured in seconds since the Unix epoch.
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent. If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
An arbitrary string attached to the object. Often useful for displaying to users.
Unique identifier for the object.
ID of the invoice that created this PaymentIntent, if it exists.
The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the [documentation](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata).
If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
String representing the object's type. Objects of the same type share the same value.
The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
ID of the payment method used in this PaymentIntent.
Payment-method-specific configuration for this PaymentIntent.
The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
If present, this property tells you about the processing state of the payment.
Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
ID of the review associated with this PaymentIntent, if any.
Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
Shipping information for this PaymentIntent.
For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses).
The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
payment_method PaymentMethod objectoptionalPaymentMethod objects represent your customer's payment instruments.
They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved to
Customer objects to store instrument details for future payments.
Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
PaymentMethod objects represent your customer's payment instruments. They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
acss_debit payment_method_acss_debit objectoptional
Name of the bank associated with the bank account.
Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
Institution number of the bank account.
Last four digits of the bank account number.
Transit number of the bank account.
au_becs_debit payment_method_au_becs_debit objectoptional
Six-digit number identifying bank and branch associated with this bank account.
Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
Last four digits of the bank account number.
bacs_debit payment_method_bacs_debit objectoptional
Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
Last four digits of the bank account number.
Sort code of the bank account. (e.g., `10-20-30`)
billing_details billing_details objectrequired
Billing address.
Email address.
Full name.
Billing phone number (including extension).
boleto payment_method_boleto objectoptional
Uniquely identifies the customer tax id (CNPJ or CPF)
card payment_method_card objectoptional
Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
Checks on Card address and CVC if provided.
Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
Two-digit number representing the card's expiration month.
Four-digit number representing the card's expiration year.
Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*
Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
Details of the original PaymentMethod that created this object.
The last four digits of the card.
Contains information about card networks that can be used to process the payment.
Contains details on how this Card maybe be used for 3D Secure authentication.
If this Card is part of a card wallet, this contains the details of the card wallet.
Time at which the object was created. Measured in seconds since the Unix epoch.
The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
eps payment_method_eps objectoptional
The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
fpx payment_method_fpx objectoptional
The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, or `pb_enterprise`.
Unique identifier for the object.
ideal payment_method_ideal objectoptional
The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.
The Bank Identifier Code of the customer's bank, if the bank was provided.
klarna payment_method_klarna objectoptional
The customer's date of birth, if provided.
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
String representing the object's type. Objects of the same type share the same value.
p24 payment_method_p24 objectoptional
The customer's bank, if provided.
sepa_debit payment_method_sepa_debit objectoptional
Bank code of bank associated with the bank account.
Branch code of bank associated with the bank account.
Two-letter ISO code representing the country the bank account is located in.
Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
Information about the object that generated this PaymentMethod.
Last four characters of the IBAN.
sofort payment_method_sofort objectoptional
Two-letter ISO code representing the country the bank account is located in.
The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
setup_intent SetupIntent objectoptionalA SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
Create a SetupIntent as soon as you're ready to collect your customer's payment credentials.
Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid.
The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-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](/guides/strong-customer-authentication) may need to be run through
[Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection
in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents).
If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success,
it will automatically attach the resulting payment method to that Customer.
We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods.
By using SetupIntents, you ensure that your customers experience the minimum set of required friction,
even as regulations change over time.
Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents).
A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-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](/guides/strong-customer-authentication) may need to be run through [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success, it will automatically attach the resulting payment method to that Customer. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you ensure that your customers experience the minimum set of required friction, even as regulations change over time. Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents).
ID of the Connect application that created the SetupIntent.
Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
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, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
Time at which the object was created. Measured in seconds since the Unix epoch.
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.
An arbitrary string attached to the object. Often useful for displaying to users.
Unique identifier for the object.
The error encountered in the previous SetupIntent confirmation.
The most recent SetupAttempt for this SetupIntent.
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
ID of the multi use Mandate generated by the SetupIntent.
Set of [key-value pairs](https://stripe.com/docs/api/metadata) 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.
String representing the object's type. Objects of the same type share the same value.
The account (if any) for which the setup is intended.
ID of the payment method used with this SetupIntent.
Payment-method-specific configuration for this SetupIntent.
The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
ID of the single_use Mandate generated by the SetupIntent.
[Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
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`.
The source object for errors returned on a request involving a source.
The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`