Stripe: Update a Payment Method
Stripe paymentMethods.postPaymentMethodsPaymentMethod: arguments, response, policy and SDK examples.
← Payment methods operations · Get started
Operation stripe.postpaymentmethodspaymentmethod
Provider route: POST /v1/payment_methods/{payment_method}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["paymentMethods"]["postPaymentMethodsPaymentMethod"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.paymentMethods.postPaymentMethodsPaymentMethod(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_stripe import StripeIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.payment_methods.post_payment_methods_payment_method(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.payment_method | string | Required within parent | Maximum length: 5000 |
headers | object | Optional | Additional keys: not allowed |
headers.Idempotency-Key | string | Optional | Minimum length: 1 Maximum length: 255 |
body | object | Optional | Additional keys: not allowed |
body.allow_redisplay | string | Optional | 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`. One of: always, limited, unspecified |
body.billing_details | Model | Optional | Expand Create a Payment Method — request body — body billing details |
body.card | object | Optional | If this is a `card` PaymentMethod, this hash contains the user’s card details. |
body.card.exp_month | integer | Optional | |
body.card.exp_year | integer | Optional | |
body.card.networks | object | Optional | |
body.card.networks.preferred | string | Optional | One of: , cartes_bancaires, mastercard, visa |
body.expand | array | Optional | Specifies which fields in the response should be expanded. |
body.expand[] | string | Each item | Maximum length: 5000 |
body.metadata | JSON | Optional | 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`. |
body.metadata (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
body.metadata (anyOf 1).* | string | Additional keys | |
body.metadata (anyOf 2) | string | Alternative | One of: |
body.us_bank_account | object | Optional | If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. |
body.us_bank_account.account_holder_type | string | Optional | One of: company, individual |
body.us_bank_account.account_type | string | Optional | One of: checking, savings |
Referenced models: Create a Payment Method — request body — body billing details
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create a Payment Method — response body |
Referenced models: Create a Payment Method — response body
Schemas
Section titled “Schemas”698 more schemas are linked from the tables above, on the schema pages.
Create a Payment Method — request body — body billing details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. |
address | JSON | Optional | |
address (anyOf 1) | object | Alternative | |
address (anyOf 1).city | string | Optional | Maximum length: 5000 |
address (anyOf 1).country | string | Optional | Maximum length: 5000 |
address (anyOf 1).line1 | string | Optional | Maximum length: 5000 |
address (anyOf 1).line2 | string | Optional | Maximum length: 5000 |
address (anyOf 1).postal_code | string | Optional | Maximum length: 5000 |
address (anyOf 1).state | string | Optional | Maximum length: 5000 |
address (anyOf 2) | string | Alternative | One of: |
email | JSON | Optional | |
email (anyOf 1) | string | Alternative | |
email (anyOf 2) | string | Alternative | One of: |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | Maximum length: 5000 |
name (anyOf 2) | string | Alternative | One of: |
phone | JSON | Optional | |
phone (anyOf 1) | string | Alternative | Maximum length: 5000 |
phone (anyOf 2) | string | Alternative | One of: |
tax_id | string | Optional | Maximum length: 5000 |
Create a Payment Method — response body — zip
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root |
Create a charge — response body — billing details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
address | JSON | Optional | |
address (anyOf 1) | JSON | Alternative | Billing address. |
address (anyOf 1) (anyOf 1) | Model | Alternative | Expand Create a Location — response body — address |
address (anyOf 2) | null | Alternative | |
email | JSON | Optional | |
email (anyOf 1) | string | Alternative | Email address. Maximum length: 5000 |
email (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | Full name. Maximum length: 5000 |
name (anyOf 2) | null | Alternative | |
phone | JSON | Optional | |
phone (anyOf 1) | string | Alternative | Billing phone number (including extension). Maximum length: 5000 |
phone (anyOf 2) | null | Alternative | |
tax_id | JSON | Optional | |
tax_id (anyOf 1) | string | Alternative | Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. Maximum length: 5000 |
tax_id (anyOf 2) | null | Alternative |
Referenced models: Create a Location — response body — address
Create a Payment Method — response body — acss debit
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
bank_name | JSON | Optional | |
bank_name (anyOf 1) | string | Alternative | Name of the bank associated with the bank account. Maximum length: 5000 |
bank_name (anyOf 2) | null | Alternative | |
fingerprint | JSON | Optional | |
fingerprint (anyOf 1) | string | Alternative | Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. Maximum length: 5000 |
fingerprint (anyOf 2) | null | Alternative | |
institution_number | JSON | Optional | |
institution_number (anyOf 1) | string | Alternative | Institution number of the bank account. Maximum length: 5000 |
institution_number (anyOf 2) | null | Alternative | |
last4 | JSON | Optional | |
last4 (anyOf 1) | string | Alternative | Last four digits of the bank account number. Maximum length: 5000 |
last4 (anyOf 2) | null | Alternative | |
transit_number | JSON | Optional | |
transit_number (anyOf 1) | string | Alternative | Transit number of the bank account. Maximum length: 5000 |
transit_number (anyOf 2) | null | Alternative |
Create a Payment Method — response body — au becs debit
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
bsb_number | JSON | Optional | |
bsb_number (anyOf 1) | string | Alternative | Six-digit number identifying bank and branch associated with this bank account. Maximum length: 5000 |
bsb_number (anyOf 2) | null | Alternative | |
fingerprint | JSON | Optional | |
fingerprint (anyOf 1) | string | Alternative | Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. Maximum length: 5000 |
fingerprint (anyOf 2) | null | Alternative | |
last4 | JSON | Optional | |
last4 (anyOf 1) | string | Alternative | Last four digits of the bank account number. Maximum length: 5000 |
last4 (anyOf 2) | null | Alternative |
Create a Payment Method — response body — bacs debit
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
fingerprint | JSON | Optional | |
fingerprint (anyOf 1) | string | Alternative | Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. Maximum length: 5000 |
fingerprint (anyOf 2) | null | Alternative | |
last4 | JSON | Optional | |
last4 (anyOf 1) | string | Alternative | Last four digits of the bank account number. Maximum length: 5000 |
last4 (anyOf 2) | null | Alternative | |
sort_code | JSON | Optional | |
sort_code (anyOf 1) | string | Alternative | Sort code of the bank account. (e.g., `10-20-30`) Maximum length: 5000 |
sort_code (anyOf 2) | null | Alternative |
Create a Payment Method — response body — bizum
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
buyer_id | JSON | Optional | |
buyer_id (anyOf 1) | string | Alternative | A unique identifier for the buyer as determined by the local payment processor. Maximum length: 5000 |
buyer_id (anyOf 2) | null | Alternative |
Create a Payment Method — response body — blik
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
buyer_id | JSON | Optional | |
buyer_id (anyOf 1) | string | Alternative | A unique and immutable identifier assigned by BLIK to every buyer. Maximum length: 5000 |
buyer_id (anyOf 2) | null | Alternative |
Create a Payment Method — response body — boleto
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
tax_id | string | Required within parent | Uniquely identifies the customer tax id (CNPJ or CPF) Maximum length: 5000 |
Create a Payment Method — response body — cashapp
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
buyer_id | JSON | Optional | |
buyer_id (anyOf 1) | string | Alternative | A unique and immutable identifier assigned by Cash App to every buyer. Maximum length: 5000 |
buyer_id (anyOf 2) | null | Alternative | |
cashtag | JSON | Optional | |
cashtag (anyOf 1) | string | Alternative | A public identifier for buyers using Cash App. Maximum length: 5000 |
cashtag (anyOf 2) | null | Alternative |
Create a Payment Method — response body — custom
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
display_name | JSON | Optional | |
display_name (anyOf 1) | string | Alternative | Display name of the Dashboard-only CustomPaymentMethodType. Maximum length: 5000 |
display_name (anyOf 2) | null | Alternative | |
logo | JSON | Optional | |
logo (anyOf 1) | JSON | Alternative | Contains information about the Dashboard-only CustomPaymentMethodType logo. |
logo (anyOf 1) (anyOf 1) | Model | Alternative | Expand Create a Payment Method — response body — custom logo value content type, url |
logo (anyOf 2) | null | Alternative | |
type | string | Required within parent | ID of the Dashboard-only CustomPaymentMethodType. Not expandable. Maximum length: 5000 |
Referenced models: Create a Payment Method — response body — custom logo value content type, url
Create a Payment Method — response body — link
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
email | JSON | Optional | |
email (anyOf 1) | string | Alternative | Account owner's email address. Maximum length: 5000 |
email (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: stripe.postpaymentmethodspaymentmethod. Catalog operation: PostPaymentMethodsPaymentMethod. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"Stripe-Version": "2026-09-30.endive"}