Skip to content

Stripe: Update a charge

Stripe charges.postChargesCharge: arguments, response, policy and SDK examples.

← Charges operations · Get started

Operation stripe.postchargescharge

Provider route: POST /v1/charges/{charge}. 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["charges"]["postChargesCharge"]>[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.charges.postChargesCharge(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.charges.post_charges_charge(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.chargestringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.customerstringOptionalThe ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge.
Maximum length: 5000
body.descriptionstringOptionalAn arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing.
Maximum length: 40000
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.fraud_detailsobjectOptionalA set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms.
body.fraud_details.user_reportstringRequired within parentOne of: , fraudulent, safe
Maximum 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.receipt_emailstringOptionalThis is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address.
Maximum length: 5000
body.shippingModelOptionalExpand Create a charge — request body — body shipping
body.transfer_groupstringOptionalA string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://docs.stripe.com/connect/separate-charges-and-transfers#transfer-options) for details.

Referenced models: Create a charge — request body — body shipping

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

Referenced models: Create a charge — response body

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

Create a charge — request body — body shipping
FieldTypePresenceDescription and constraints
$objectRootShipping information for the charge. Helps prevent fraud on charges for physical goods.
addressobjectRequired within parent
address.citystringOptionalMaximum length: 5000
address.countrystringOptionalMaximum length: 5000
address.line1stringOptionalMaximum length: 5000
address.line2stringOptionalMaximum length: 5000
address.postal_codestringOptionalMaximum length: 5000
address.statestringOptionalMaximum length: 5000
carrierstringOptionalMaximum length: 5000
namestringRequired within parentMaximum length: 5000
phonestringOptionalMaximum length: 5000
tracking_numberstringOptionalMaximum length: 5000
Create an account — response body
FieldTypePresenceDescription and constraints
$objectRootFor new integrations, we recommend using the [Accounts v2 API](/api/v2/core/accounts), in place of /v1/accounts and /v1/customers to represent a user.

This is an object representing a Stripe account. You can retrieve it to see
properties on the account like its current requirements or if the account is
enabled to make live charges or receive payouts.

For accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection)
is `application`, which includes Custom accounts, the properties below are always
returned.

For accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection)
is `stripe`, which includes Standard and Express accounts, some properties are only returned
until you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions)
to start Connect Onboarding. Learn about the [differences between accounts](/connect/accounts).
business_profileJSONOptional
business_profile (anyOf 1)JSONAlternativeBusiness information about the account.
business_profile (anyOf 1) (anyOf 1)ModelAlternativeExpand Create an account — response body — business profile Business information about the account annual revenue, estimated worker count, mcc, minority owned business designation, monthly estimated revenue, name, product description, specified commercial transactions act url, support address, support email, support phone, support url, url
business_profile (anyOf 2)nullAlternative
business_typeJSONOptional
business_type (anyOf 1)stringAlternativeThe business type.
Known values: company, government_entity, individual, non_profit
business_type (anyOf 2)nullAlternative
capabilitiesModelOptionalExpand Create an account — response body — capabilities
charges_enabledbooleanOptionalWhether the account can process charges.
companyModelOptionalExpand Create an account — response body — company
controllerModelOptionalExpand Create an account — response body — controller
countrystringOptionalThe account's country.
Maximum length: 5000
createdJSONOptional
created (anyOf 1)integerAlternativeTime at which the account was connected. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
default_currencystringOptionalThree-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).
Maximum length: 5000
details_submittedbooleanOptionalWhether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](/connect/onboarding) to finish submitting account details.
emailJSONOptional
email (anyOf 1)stringAlternativeAn email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform.
Maximum length: 5000
email (anyOf 2)nullAlternative
external_accountsobjectOptionalExternal accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true.
external_accounts.dataarrayRequired within parentThe list contains all external accounts that have been attached to the Stripe account. These may be bank accounts or cards.
external_accounts.data[]JSONEach item
external_accounts.data[] (anyOf 1)ModelAlternativeExpand Retrieve a bank account — response body
external_accounts.data[] (anyOf 2)ModelAlternativeExpand Retrieve a card — customers get Customers Customer Cards Id — response body
external_accounts.has_morebooleanRequired within parentTrue if this list has another page of items after this one that can be fetched.
external_accounts.objectstringRequired within parentString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
Known values: list
external_accounts.urlstringRequired within parentThe URL where this list can be accessed.
Maximum length: 5000
future_requirementsModelOptionalExpand Create an account — response body — future requirements
groupsJSONOptional
groups (anyOf 1)JSONAlternativeThe groups associated with the account.
groups (anyOf 1) (anyOf 1)ModelAlternativeExpand Create an account — response body — groups The groups associated with the account payments pricing
groups (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
individualModelOptionalExpand Create a person — accounts post Accounts Account People — response body
metadataobjectOptionalSet 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.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: account
payouts_enabledbooleanOptionalWhether the funds in this account can be paid out.
requirementsModelOptionalExpand Create an account — response body — requirements
settingsJSONOptional
settings (anyOf 1)JSONAlternativeOptions for customizing how the account functions within Stripe.
settings (anyOf 1) (anyOf 1)ModelAlternativeExpand Create an account — response body — settings value bacs debit payments, branding, card issuing, card payments, dashboard, invoices, payments, payouts, paypay payments, sepa debit payments, treasury
settings (anyOf 2)nullAlternative
tos_acceptanceModelOptionalExpand Create an account — response body — tos acceptance
typestringOptionalThe Stripe account type. Can be `standard`, `express`, `custom`, or `none`.
Known values: custom, express, none, standard

Referenced models: Create an account — response body — business profile Business information about the account annual revenue, estimated worker count, mcc, minority owned business designation, monthly estimated revenue, name, product description, specified commercial transactions act url, support address, support email, support phone, support url, url, Create an account — response body — capabilities, Create an account — response body — future requirements, Create an account — response body — groups The groups associated with the account payments pricing, Create an account — response body — requirements, Create an account — response body — settings value bacs debit payments, branding, card issuing, card payments, dashboard, invoices, payments, payouts, paypay payments, sepa debit payments, treasury, Create an account — response body — tos acceptance, Create an account — response body — controller, Retrieve a bank account — response body, Retrieve a card — customers get Customers Customer Cards Id — response body, Create an account — response body — company, Create a person — accounts post Accounts Account People — response body

PostApplicationFeesIdRefund — response body — application / object: application
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the application.
Maximum length: 5000
name (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: application

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