Skip to content

Stripe: Create a charge

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

← Charges operations · Get started

Operation stripe.postcharges

Provider route: POST /v1/charges. 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"]["postCharges"]>[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.postCharges(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(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.amountintegerOptionalAmount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
body.application_feeintegerOptional
body.application_fee_amountintegerOptionalA fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://docs.stripe.com/connect/direct-charges#collect-fees).
body.capturebooleanOptionalWhether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://docs.stripe.com/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://docs.stripe.com/charges/placing-a-hold) documentation.
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.currencystringOptionalThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Format: currency
body.customerstringOptionalThe ID of an existing customer that will be charged in this request.
Maximum length: 500
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.destinationJSONOptional
body.destination (anyOf 1)objectAlternative
body.destination (anyOf 1).accountstringRequired within parentMaximum length: 5000
body.destination (anyOf 1).amountintegerOptional
body.destination (anyOf 2)stringAlternative
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.on_behalf_ofstringOptionalThe Stripe account ID for which these funds are intended. You can specify the business of record as the connected account using the `on_behalf_of` attribute on the charge. For details, see [Creating Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers#settlement-merchant).
Maximum length: 5000
body.radar_optionsobjectOptionalOptions to configure Radar. See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information.
body.radar_options.sessionstringOptionalMaximum length: 5000
body.receipt_emailstringOptionalThe email address to which this charge’s [receipt](https://docs.stripe.com/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://docs.stripe.com/api/customers/object), the email address specified here will override the customer’s email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
body.shippingModelOptionalExpand Create a charge — request body — body shipping
body.sourcestringOptionalA payment source to be charged. This can be the ID of a [card](https://docs.stripe.com/api#cards) (i.e., credit or debit card), a [bank account](https://docs.stripe.com/api#bank_accounts), a [source](https://docs.stripe.com/api#sources), a [token](https://docs.stripe.com/api#tokens), or a [connected account](https://docs.stripe.com/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://docs.stripe.com/api#cards), [bank accounts](https://docs.stripe.com/api#bank_accounts), and attached [sources](https://docs.stripe.com/api#sources)---you must also pass the ID of the associated customer.
Maximum length: 5000
body.statement_descriptorstringOptionalFor a non-card charge, text that appears on the customer’s statement as the statement descriptor. This value overrides the account’s default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).

For a card charge, this value is ignored unless you don’t specify a `statement_descriptor_suffix`, in which case this value is used as the suffix.
Maximum length: 22
body.statement_descriptor_suffixstringOptionalProvides information about a card charge. Concatenated to the account’s [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer’s statement. If the account has no prefix value, the suffix is concatenated to the account’s statement descriptor.
Maximum length: 22
body.transfer_dataobjectOptionalAn optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details.
body.transfer_data.amountintegerOptional
body.transfer_data.descriptionstringOptionalMaximum length: 5000
body.transfer_data.destinationstringRequired within parentMaximum length: 5000
body.transfer_groupstringOptionalA string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://docs.stripe.com/connect/separate-charges-and-transfers#transfer-options).

Referenced models: Create a charge — request body — body / card / object: card, 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

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

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 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
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
Post Application Fees Id Refund — response body
FieldTypePresenceDescription and constraints
$objectRoot
accountJSONRequired within parentID of the Stripe account this fee was taken from.
account (anyOf 1)stringAlternativeMaximum length: 5000
account (anyOf 2)ModelAlternativeExpand Create an account — response body
amountJSONRequired within parent
amount (anyOf 1)integerAlternativeAmount earned, in cents (or local equivalent).
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
amount_refundedJSONRequired within parent
amount_refunded (anyOf 1)integerAlternativeAmount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued)
amount_refunded (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
applicationJSONRequired within parentID of the Connect application that earned the fee.
application (anyOf 1)stringAlternativeMaximum length: 5000
application (anyOf 2)ModelAlternativeExpand PostApplicationFeesIdRefund — response body — application / object: application
balance_transactionJSONOptional
balance_transaction (anyOf 1)JSONAlternativeBalance transaction that describes the impact of this collected application fee on your account balance (not including refunds).
balance_transaction (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
balance_transaction (anyOf 1) (anyOf 2)ModelAlternativeExpand Retrieve a balance transaction — balance get Balance History Id — response body
balance_transaction (anyOf 2)nullAlternative
chargeJSONRequired within parentID of the charge that the application fee was taken from.
charge (anyOf 1)stringAlternativeMaximum length: 5000
charge (anyOf 2)ModelAlternativeExpand Create a charge — response body
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Format: currency
fee_sourceJSONOptional
fee_source (anyOf 1)JSONAlternativePolymorphic source of the application fee. Includes the ID of the object the application fee was created from.
fee_source (anyOf 1) (anyOf 1)ModelAlternativeExpand PostApplicationFeesIdRefund — response body — fee_source / value / type: charge, payout
fee_source (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
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: application_fee
originating_transactionJSONOptional
originating_transaction (anyOf 1)JSONAlternativeID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter.
originating_transaction (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
originating_transaction (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a charge — response body
originating_transaction (anyOf 2)nullAlternative
refundedbooleanRequired within parentWhether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.
refundsobjectRequired within parentA list of refunds that have been applied to the fee.
refunds.dataarrayRequired within parentDetails about each object.
refunds.data[]ModelEach itemExpand Create an application fee refund — response body
refunds.has_morebooleanRequired within parentTrue if this list has another page of items after this one that can be fetched.
refunds.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
refunds.urlstringRequired within parentThe URL where this list can be accessed.
Maximum length: 5000

Referenced models: Create an account — response body, PostApplicationFeesIdRefund — response body — application / object: application, Retrieve a balance transaction — balance get Balance History Id — response body, Create a charge — response body, Create an application fee refund — response body, PostApplicationFeesIdRefund — response body — fee_source / value / type: charge, payout

Create a charge — response body — fraud details Information on fraud assessments for the charge stripe report, user report
FieldTypePresenceDescription and constraints
$objectRoot
stripe_reportstringOptionalAssessments from Stripe. If set, the value is `fraudulent`.
Maximum length: 5000
user_reportstringOptionalAssessments reported by you. If set, possible values of are `safe` and `fraudulent`.
Maximum length: 5000
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
Create a Payment Method — response body — zip
FieldTypePresenceDescription and constraints
$objectRoot

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