Skip to content

Stripe: Update a customer

Stripe customers.postCustomersCustomer: arguments, response, policy and SDK examples.

← Customers operations · Get started

Operation stripe.postcustomerscustomer

Provider route: POST /v1/customers/{customer}. 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["customers"]["postCustomersCustomer"]>[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.customers.postCustomersCustomer(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.customers.post_customers_customer(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.customerstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.addressJSONOptionalThe customer’s address. Learn about [country-specific requirements for calculating tax](https://docs.stripe.com/invoicing/taxes?dashboard-or-api=dashboard#set-up-customer).
body.address (anyOf 1)objectAlternative
body.address (anyOf 1).citystringOptionalMaximum length: 5000
body.address (anyOf 1).countrystringOptionalMaximum length: 5000
body.address (anyOf 1).line1stringOptionalMaximum length: 5000
body.address (anyOf 1).line2stringOptionalMaximum length: 5000
body.address (anyOf 1).postal_codestringOptionalMaximum length: 5000
body.address (anyOf 1).statestringOptionalMaximum length: 5000
body.address (anyOf 2)stringAlternativeOne of:
body.balanceintegerOptionalAn integer amount in cents (or local equivalent) that represents the customer’s current balance, which affect the customer’s future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
body.bank_accountJSONOptionalEither a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user’s bank account details.
body.bank_account (anyOf 1)ModelAlternativeExpand Update a customer — request body — body / bank_account / account_holder_type: company, individual, object: bank account
body.bank_account (anyOf 2)stringAlternativeMaximum length: 5000
body.business_nameJSONOptionalThe customer’s business name. This may be up to 150 characters.
body.business_name (anyOf 1)stringAlternativeMaximum length: 150
body.business_name (anyOf 2)stringAlternativeOne of:
body.cardJSONOptionalA token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).
body.card (anyOf 1)ModelAlternativeExpand Create a charge — request body — body / card / object: card
body.card (anyOf 2)stringAlternativeMaximum length: 5000
body.cash_balanceobjectOptionalBalance information and default balance settings for this customer.
body.cash_balance.settingsobjectOptional
body.cash_balance.settings.reconciliation_modestringOptionalOne of: automatic, manual, merchant_default
body.default_alipay_accountstringOptionalID of Alipay account to make the customer’s new default for invoice payments.
Maximum length: 500
body.default_bank_accountstringOptionalID of bank account to make the customer’s new default for invoice payments.
Maximum length: 500
body.default_cardstringOptionalID of card to make the customer’s new default for invoice payments.
Maximum length: 500
body.default_sourcestringOptionalIf you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter.

Provide the ID of a payment source already attached to this customer to make it this customer’s default payment source.

If you want to add a new payment source and make it the default, see the [source](https://docs.stripe.com/api/customers/update#update_customer-source) property.
Maximum length: 500
body.descriptionstringOptionalAn arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.
Maximum length: 5000
body.emailstringOptionalCustomer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to 512 characters.
Maximum length: 512
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.individual_nameJSONOptionalThe customer’s full name. This may be up to 150 characters.
body.individual_name (anyOf 1)stringAlternativeMaximum length: 150
body.individual_name (anyOf 2)stringAlternativeOne of:
body.invoice_prefixstringOptionalThe prefix for the customer used to generate unique invoice numbers. Must be 1–12 uppercase letters or numbers.
Maximum length: 5000
body.invoice_settingsModelOptionalExpand Create a customer — request body — body invoice settings
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.namestringOptionalThe customer’s full name or business name.
Maximum length: 256
body.next_invoice_sequenceintegerOptionalThe sequence to be used on the customer’s next invoice. Defaults to 1.
body.phonestringOptionalThe customer’s phone number.
Maximum length: 20
body.preferred_localesarrayOptionalCustomer’s preferred languages, ordered by preference.
body.preferred_locales[]stringEach itemMaximum length: 5000
body.shippingJSONOptionalThe customer’s shipping information. Appears on invoices emailed to this customer.
body.shipping (anyOf 1)objectAlternative
body.shipping (anyOf 1).addressobjectRequired within parent
body.shipping (anyOf 1).address.citystringOptionalMaximum length: 5000
body.shipping (anyOf 1).address.countrystringOptionalMaximum length: 5000
body.shipping (anyOf 1).address.line1stringOptionalMaximum length: 5000
body.shipping (anyOf 1).address.line2stringOptionalMaximum length: 5000
body.shipping (anyOf 1).address.postal_codestringOptionalMaximum length: 5000
body.shipping (anyOf 1).address.statestringOptionalMaximum length: 5000
body.shipping (anyOf 1).namestringRequired within parentMaximum length: 5000
body.shipping (anyOf 1).phonestringOptionalMaximum length: 5000
body.shipping (anyOf 2)stringAlternativeOne of:
body.sourcestringOptionalMaximum length: 5000
body.taxobjectOptionalTax details about the customer.
body.tax.ip_addressJSONOptional
body.tax.ip_address (anyOf 1)stringAlternative
body.tax.ip_address (anyOf 2)stringAlternativeOne of:
body.tax.validate_locationstringOptionalOne of: auto, deferred, immediately
body.tax_exemptstringOptionalThe customer’s tax exemption. One of `none`, `exempt`, or `reverse`.
One of: , exempt, none, reverse

Referenced models: Update a customer — request body — body / bank_account / account_holder_type: company, individual, object: bank account, Create a charge — request body — body / card / object: card, Create a customer — request body — body invoice settings

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 customer — response body

Referenced models: Create a customer — response body

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

Update a customer — request body — body / bank_account / account_holder_type: company, individual, object: bank account
FieldTypePresenceDescription and constraints
$objectRoot
account_holder_namestringOptionalMaximum length: 5000
account_holder_typestringOptionalOne of: company, individual
Maximum length: 5000
account_numberstringRequired within parentMaximum length: 5000
countrystringRequired within parentMaximum length: 5000
currencystringOptionalFormat: currency
objectstringOptionalOne of: bank_account
Maximum length: 5000
routing_numberstringOptionalMaximum length: 5000
Create a charge — request body — body / card / object: card
FieldTypePresenceDescription and constraints
$objectRoot
address_citystringOptionalMaximum length: 5000
address_countrystringOptionalMaximum length: 5000
address_line1stringOptionalMaximum length: 5000
address_line2stringOptionalMaximum length: 5000
address_statestringOptionalMaximum length: 5000
address_zipstringOptionalMaximum length: 5000
cvcstringOptionalMaximum length: 5000
encryptedstringOptionalMaximum length: 5000
exp_monthintegerRequired within parent
exp_yearintegerRequired within parent
metadataobjectOptionalAdditional keys: see wildcard field
metadata.*stringAdditional keys
namestringOptionalMaximum length: 5000
network_tokenobjectOptional
network_token.numberstringOptionalMaximum length: 5000
numberstringRequired within parentMaximum length: 5000
objectstringOptionalOne of: card
Maximum length: 5000
swipe_datastringOptionalMaximum length: 5000
Create a customer — request body — body invoice settings
FieldTypePresenceDescription and constraints
$objectRootDefault invoice settings for this customer.
custom_fieldsJSONOptional
custom_fields (anyOf 1)arrayAlternative
custom_fields (anyOf 1)[]objectEach item
custom_fields (anyOf 1)[].namestringRequired within parentMaximum length: 40
custom_fields (anyOf 1)[].valuestringRequired within parentMaximum length: 140
custom_fields (anyOf 2)stringAlternativeOne of:
default_payment_methodstringOptionalMaximum length: 5000
footerstringOptionalMaximum length: 5000
rendering_optionsJSONOptional
rendering_options (anyOf 1)objectAlternative
rendering_options (anyOf 1).amount_tax_displaystringOptionalOne of: , exclude_tax, include_inclusive_tax
rendering_options (anyOf 1).templatestringOptionalMaximum length: 5000
rendering_options (anyOf 2)stringAlternativeOne of:
Create a Location — response body — address
FieldTypePresenceDescription and constraints
$objectRoot
cityJSONOptional
city (anyOf 1)stringAlternativeCity, district, suburb, town, or village.
Maximum length: 5000
city (anyOf 2)nullAlternative
countryJSONOptional
country (anyOf 1)stringAlternativeTwo-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
Maximum length: 5000
country (anyOf 2)nullAlternative
line1JSONOptional
line1 (anyOf 1)stringAlternativeAddress line 1, such as the street, PO Box, or company name.
Maximum length: 5000
line1 (anyOf 2)nullAlternative
line2JSONOptional
line2 (anyOf 1)stringAlternativeAddress line 2, such as the apartment, suite, unit, or building.
Maximum length: 5000
line2 (anyOf 2)nullAlternative
postal_codeJSONOptional
postal_code (anyOf 1)stringAlternativeZIP or postal code.
Maximum length: 5000
postal_code (anyOf 2)nullAlternative
stateJSONOptional
state (anyOf 1)stringAlternativeState, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
Maximum length: 5000
state (anyOf 2)nullAlternative
Retrieve a cash balance — response body
FieldTypePresenceDescription and constraints
$objectRootA customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.
availableJSONOptional
available (anyOf 1)objectAlternativeA hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
Additional keys: see wildcard field
available (anyOf 1).*JSONAdditional keys
available (anyOf 1).* (anyOf 1)integerAlternative
available (anyOf 1).* (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
available (anyOf 2)nullAlternative
customerstringRequired within parentThe ID of the customer whose cash balance this object represents.
Maximum length: 5000
customer_accountJSONOptional
customer_account (anyOf 1)stringAlternativeThe ID of an Account representing a customer whose cash balance this object represents.
Maximum length: 5000
customer_account (anyOf 2)nullAlternative
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: cash_balance
settingsModelRequired within parentExpand Retrieve a cash balance — response body — settings

Referenced models: Retrieve a cash balance — response body — settings

Create a customer — response body — tax
FieldTypePresenceDescription and constraints
$objectRoot
automatic_taxstringRequired within parentSurfaces if automatic tax computation is possible given the current customer location information.
Known values: failed, not_collecting, supported, unrecognized_location
ip_addressJSONOptional
ip_address (anyOf 1)stringAlternativeA recent IP address of the customer used for tax reporting and tax location inference.
Maximum length: 5000
ip_address (anyOf 2)nullAlternative
locationJSONOptional
location (anyOf 1)JSONAlternativeThe identified tax location of the customer.
location (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a customer — response body — tax / location / The identified tax location of the customer / source: billing address, ip address, payment method, shipping destination
location (anyOf 2)nullAlternative
providerstringRequired within parentThe tax calculation provider used for location resolution. Defaults to `stripe` when not using a [third-party provider](/tax/third-party-apps).
Known values: anrok, avalara, sphere, stripe

Referenced models: Create a customer — response body — tax / location / The identified tax location of the customer / source: billing address, ip address, payment method, shipping destination

Create a source — response body — source order shipping
FieldTypePresenceDescription and constraints
$objectRoot
addressModelOptionalExpand Create a Location — response body — address
carrierJSONOptional
carrier (anyOf 1)stringAlternativeThe delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
Maximum length: 5000
carrier (anyOf 2)nullAlternative
namestringOptionalRecipient name.
Maximum length: 5000
phoneJSONOptional
phone (anyOf 1)stringAlternativeRecipient phone (including extension).
Maximum length: 5000
phone (anyOf 2)nullAlternative
tracking_numberJSONOptional
tracking_number (anyOf 1)stringAlternativeThe tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
Maximum length: 5000
tracking_number (anyOf 2)nullAlternative

Referenced models: Create a Location — response body — address

Delete a customer — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer

SDK function policy ID: stripe.postcustomerscustomer. Catalog operation: PostCustomersCustomer. 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.