Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.payment_methodstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.allow_redisplaystringOptionalThis 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_detailsModelOptionalExpand Create a Payment Method — request body — body billing details
body.cardobjectOptionalIf this is a `card` PaymentMethod, this hash contains the user’s card details.
body.card.exp_monthintegerOptional
body.card.exp_yearintegerOptional
body.card.networksobjectOptional
body.card.networks.preferredstringOptionalOne of: , cartes_bancaires, mastercard, visa
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.metadataJSONOptionalSet 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)objectAlternativeAdditional keys: see wildcard field
body.metadata (anyOf 1).*stringAdditional keys
body.metadata (anyOf 2)stringAlternativeOne of:
body.us_bank_accountobjectOptionalIf this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
body.us_bank_account.account_holder_typestringOptionalOne of: company, individual
body.us_bank_account.account_typestringOptionalOne of: checking, savings

Referenced models: Create a Payment Method — request body — body billing details

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create a Payment Method — response body

Referenced models: Create a Payment Method — response body

698 more schemas are linked from the tables above, on the schema pages.

Create a Payment Method — request body — body billing details
FieldTypePresenceDescription and constraints
$objectRootBilling information associated with the PaymentMethod that may be used or required by particular types of payment methods.
addressJSONOptional
address (anyOf 1)objectAlternative
address (anyOf 1).citystringOptionalMaximum length: 5000
address (anyOf 1).countrystringOptionalMaximum length: 5000
address (anyOf 1).line1stringOptionalMaximum length: 5000
address (anyOf 1).line2stringOptionalMaximum length: 5000
address (anyOf 1).postal_codestringOptionalMaximum length: 5000
address (anyOf 1).statestringOptionalMaximum length: 5000
address (anyOf 2)stringAlternativeOne of:
emailJSONOptional
email (anyOf 1)stringAlternative
email (anyOf 2)stringAlternativeOne of:
nameJSONOptional
name (anyOf 1)stringAlternativeMaximum length: 5000
name (anyOf 2)stringAlternativeOne of:
phoneJSONOptional
phone (anyOf 1)stringAlternativeMaximum length: 5000
phone (anyOf 2)stringAlternativeOne of:
tax_idstringOptionalMaximum length: 5000
Create a Payment Method — response body — zip
FieldTypePresenceDescription and constraints
$objectRoot
Create a charge — response body — billing details
FieldTypePresenceDescription and constraints
$objectRoot
addressJSONOptional
address (anyOf 1)JSONAlternativeBilling address.
address (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Location — response body — address
address (anyOf 2)nullAlternative
emailJSONOptional
email (anyOf 1)stringAlternativeEmail address.
Maximum length: 5000
email (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeFull name.
Maximum length: 5000
name (anyOf 2)nullAlternative
phoneJSONOptional
phone (anyOf 1)stringAlternativeBilling phone number (including extension).
Maximum length: 5000
phone (anyOf 2)nullAlternative
tax_idJSONOptional
tax_id (anyOf 1)stringAlternativeTaxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
Maximum length: 5000
tax_id (anyOf 2)nullAlternative

Referenced models: Create a Location — response body — address

Create a Payment Method — response body — acss debit
FieldTypePresenceDescription and constraints
$objectRoot
bank_nameJSONOptional
bank_name (anyOf 1)stringAlternativeName of the bank associated with the bank account.
Maximum length: 5000
bank_name (anyOf 2)nullAlternative
fingerprintJSONOptional
fingerprint (anyOf 1)stringAlternativeUniquely 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)nullAlternative
institution_numberJSONOptional
institution_number (anyOf 1)stringAlternativeInstitution number of the bank account.
Maximum length: 5000
institution_number (anyOf 2)nullAlternative
last4JSONOptional
last4 (anyOf 1)stringAlternativeLast four digits of the bank account number.
Maximum length: 5000
last4 (anyOf 2)nullAlternative
transit_numberJSONOptional
transit_number (anyOf 1)stringAlternativeTransit number of the bank account.
Maximum length: 5000
transit_number (anyOf 2)nullAlternative
Create a Payment Method — response body — au becs debit
FieldTypePresenceDescription and constraints
$objectRoot
bsb_numberJSONOptional
bsb_number (anyOf 1)stringAlternativeSix-digit number identifying bank and branch associated with this bank account.
Maximum length: 5000
bsb_number (anyOf 2)nullAlternative
fingerprintJSONOptional
fingerprint (anyOf 1)stringAlternativeUniquely 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)nullAlternative
last4JSONOptional
last4 (anyOf 1)stringAlternativeLast four digits of the bank account number.
Maximum length: 5000
last4 (anyOf 2)nullAlternative
Create a Payment Method — response body — bacs debit
FieldTypePresenceDescription and constraints
$objectRoot
fingerprintJSONOptional
fingerprint (anyOf 1)stringAlternativeUniquely 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)nullAlternative
last4JSONOptional
last4 (anyOf 1)stringAlternativeLast four digits of the bank account number.
Maximum length: 5000
last4 (anyOf 2)nullAlternative
sort_codeJSONOptional
sort_code (anyOf 1)stringAlternativeSort code of the bank account. (e.g., `10-20-30`)
Maximum length: 5000
sort_code (anyOf 2)nullAlternative
Create a Payment Method — response body — bizum
FieldTypePresenceDescription and constraints
$objectRoot
buyer_idJSONOptional
buyer_id (anyOf 1)stringAlternativeA unique identifier for the buyer as determined by the local payment processor.
Maximum length: 5000
buyer_id (anyOf 2)nullAlternative
Create a Payment Method — response body — blik
FieldTypePresenceDescription and constraints
$objectRoot
buyer_idJSONOptional
buyer_id (anyOf 1)stringAlternativeA unique and immutable identifier assigned by BLIK to every buyer.
Maximum length: 5000
buyer_id (anyOf 2)nullAlternative
Create a Payment Method — response body — boleto
FieldTypePresenceDescription and constraints
$objectRoot
tax_idstringRequired within parentUniquely identifies the customer tax id (CNPJ or CPF)
Maximum length: 5000
Create a Payment Method — response body — cashapp
FieldTypePresenceDescription and constraints
$objectRoot
buyer_idJSONOptional
buyer_id (anyOf 1)stringAlternativeA unique and immutable identifier assigned by Cash App to every buyer.
Maximum length: 5000
buyer_id (anyOf 2)nullAlternative
cashtagJSONOptional
cashtag (anyOf 1)stringAlternativeA public identifier for buyers using Cash App.
Maximum length: 5000
cashtag (anyOf 2)nullAlternative
Create a Payment Method — response body — custom
FieldTypePresenceDescription and constraints
$objectRoot
display_nameJSONOptional
display_name (anyOf 1)stringAlternativeDisplay name of the Dashboard-only CustomPaymentMethodType.
Maximum length: 5000
display_name (anyOf 2)nullAlternative
logoJSONOptional
logo (anyOf 1)JSONAlternativeContains information about the Dashboard-only CustomPaymentMethodType logo.
logo (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Payment Method — response body — custom logo value content type, url
logo (anyOf 2)nullAlternative
typestringRequired within parentID 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
FieldTypePresenceDescription and constraints
$objectRoot
emailJSONOptional
email (anyOf 1)stringAlternativeAccount owner's email address.
Maximum length: 5000
email (anyOf 2)nullAlternative

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"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.