Sample - Stripe API
POST/v1/sources/{source}

Update a source

Updates an existing source payment instrument without changing fields that you omit. Use the body to change source metadata, owner information, mandate details, source amount, or source-order information. Supply only the fields that you want to modify.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
sourcestringrequired
The unique identifier of the source to update, limited to 5,000 characters.

Optional source fields to update; omitted fields retain their current values.

amountintegeroptional
Amount associated with the source.
expandarray<string>optional
Specifies which fields in the response should be expanded.
mandateobjectoptional
Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/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`.
ownerobjectoptional
Information about the owner of the payment instrument that may be used or required by particular source types.
source_orderobjectoptional
Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.

2 status codes
200Returns the updated source object, including its current status, flow, payment-method details, and metadata.
ach_credit_transferobjectoptional
ach_debitobjectoptional
acss_debitobjectoptional
alipayobjectoptional
allow_redisplaystringoptional
This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
Allowed:alwayslimitedunspecified
amountintegeroptional
A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources.
au_becs_debitobjectoptional
bancontactobjectoptional
cardobjectoptional
card_presentobjectoptional
client_secretstringrequired
The client secret of the source. Used for client-side retrieval using a publishable key.
code_verificationobjectoptional
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
currencystringoptional
Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources.
customerstringoptional
The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.
epsobjectoptional
flowstringrequired
The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`.
giropayobjectoptional
idstringrequired
Unique identifier for the object.
idealobjectoptional
klarnaobjectoptional
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
multibancoobjectoptional
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:source
ownerobjectoptional
Information about the owner of the payment instrument that may be used or required by particular source types.
p24objectoptional
receiverobjectoptional
redirectobjectoptional
sepa_debitobjectoptional
sofortobjectoptional
source_orderobjectoptional
statement_descriptorstringoptional
Extra information about a source. This will appear on your customer's statement every time you charge the source.
statusstringrequired
The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge.
three_d_secureobjectoptional
typestringrequired
The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://docs.stripe.com/sources) used.
Allowed:ach_credit_transferach_debitacss_debitalipayau_becs_debitbancontactcardcard_presentepsgiropayidealklarna
usagestringoptional
Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.
wechatobjectoptional
defaultReturns an error object containing details about the failed source update request.
errorobjectrequired

Error handling

source must identify the source to update and may contain at most 5,000 characters. metadata values must be strings, mandate.interval must be one of one_time, scheduled, or variable, and owner.name may contain at most 5,000 characters. If you provide source_order.shipping, include its address.