Skip to content

Stripe: Capture a Payment Intent

Stripe paymentIntents.postPaymentIntentsIntentCapture: arguments, response, policy and SDK examples.

← Payment intents operations · Get started

Operation stripe.postpaymentintentsintentcapture

Provider route: POST /v1/payment_intents/{intent}/capture. 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["paymentIntents"]["postPaymentIntentsIntentCapture"]>[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.paymentIntents.postPaymentIntentsIntentCapture(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_intents.post_payment_intents_intent_capture(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.intentstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.amount_detailsModelOptionalExpand Create a Payment Intent — request body — body amount details
body.amount_to_captureintegerOptionalThe amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Defaults to the full `amount_capturable` if it’s not provided.
body.application_fee_amountintegerOptionalThe amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.final_capturebooleanOptionalDefaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they’re captured in future requests. You can only use this setting when [multicapture](https://docs.stripe.com/payments/multicapture) is available for PaymentIntents.
body.hooksobjectOptionalAutomations to be run during the PaymentIntent lifecycle
body.hooks.inputsobjectOptional
body.hooks.inputs.taxobjectOptional
body.hooks.inputs.tax.calculationJSONRequired within parent
body.hooks.inputs.tax.calculation (anyOf 1)stringAlternativeMaximum length: 5000
body.hooks.inputs.tax.calculation (anyOf 2)stringAlternativeOne of:
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.payment_detailsJSONOptionalProvides industry-specific information about the charge.
body.payment_details (anyOf 1)objectAlternative
body.payment_details (anyOf 1).customer_referenceJSONOptional
body.payment_details (anyOf 1).customer_reference (anyOf 1)stringAlternativeMaximum length: 5000
body.payment_details (anyOf 1).customer_reference (anyOf 2)stringAlternativeOne of:
body.payment_details (anyOf 1).order_referenceJSONOptional
body.payment_details (anyOf 1).order_reference (anyOf 1)stringAlternativeMaximum length: 5000
body.payment_details (anyOf 1).order_reference (anyOf 2)stringAlternativeOne of:
body.payment_details (anyOf 2)stringAlternativeOne of:
body.statement_descriptorstringOptionalText that appears on the customer’s statement as the statement descriptor for a non-card charge. 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).

Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
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.
Maximum length: 22
body.transfer_dataobjectOptionalThe parameters that you can use to automatically create a transfer after the payment
is captured. Learn more about the [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
body.transfer_data.amountintegerOptional

Referenced models: Create a Payment Intent — request body — body amount details

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Cancel a Payment Intent — response body

Referenced models: Cancel a Payment Intent — response body

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

Create a Payment Intent — request body — body amount details
FieldTypePresenceDescription and constraints
$objectRootProvides industry-specific information about the amount.
discount_amountJSONOptional
discount_amount (anyOf 1)integerAlternative
discount_amount (anyOf 2)stringAlternativeOne of:
enforce_arithmetic_validationbooleanOptional
line_itemsJSONOptional
line_items (anyOf 1)arrayAlternative
line_items (anyOf 1)[]ModelEach itemExpand Create a Payment Intent — request body — body amount details line items array item
line_items (anyOf 2)stringAlternativeOne of:
shippingJSONOptional
shipping (anyOf 1)objectAlternative
shipping (anyOf 1).amountJSONOptional
shipping (anyOf 1).amount (anyOf 1)integerAlternative
shipping (anyOf 1).amount (anyOf 2)stringAlternativeOne of:
shipping (anyOf 1).from_postal_codeJSONOptional
shipping (anyOf 1).from_postal_code (anyOf 1)stringAlternativeMaximum length: 10
shipping (anyOf 1).from_postal_code (anyOf 2)stringAlternativeOne of:
shipping (anyOf 1).to_postal_codeJSONOptional
shipping (anyOf 1).to_postal_code (anyOf 1)stringAlternativeMaximum length: 10
shipping (anyOf 1).to_postal_code (anyOf 2)stringAlternativeOne of:
shipping (anyOf 2)stringAlternativeOne of:
taxJSONOptional
tax (anyOf 1)objectAlternative
tax (anyOf 1).total_tax_amountintegerRequired within parent
tax (anyOf 2)stringAlternativeOne of:

Referenced models: Create a Payment Intent — request body — body amount details line items array item

Cancel a SetupIntent — response body — last_setup_error / value / type: api error, card error, idempotency error, invalid request error
FieldTypePresenceDescription and constraints
$objectRoot
advice_codestringOptionalFor card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one.
Maximum length: 5000
chargestringOptionalFor card errors, the ID of the failed charge.
Maximum length: 5000
codestringOptionalFor some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.
Maximum length: 5000
decline_codestringOptionalFor card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://docs.stripe.com/declines#issuer-declines) if they provide one.
Maximum length: 5000
doc_urlstringOptionalA URL to more information about the [error code](https://docs.stripe.com/error-codes) reported.
Maximum length: 5000
messagestringOptionalA human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
Maximum length: 40000
network_advice_codestringOptionalFor card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
Maximum length: 5000
network_decline_codestringOptionalFor payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
Maximum length: 5000
paramstringOptionalIf the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
Maximum length: 5000
payment_intentModelOptionalExpand Cancel a Payment Intent — response body
payment_methodModelOptionalExpand Create a Payment Method — response body
payment_method_typestringOptionalIf the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
Maximum length: 5000
request_log_urlstringOptionalA URL to the request log entry in your dashboard.
Maximum length: 5000
setup_intentModelOptionalExpand Cancel a Setup Intent — response body
sourceJSONOptionalThe [source object](https://docs.stripe.com/api/sources/object) for errors returned on a request involving a source.
source (anyOf 1)ModelAlternativeExpand Retrieve a bank account — response body
source (anyOf 2)ModelAlternativeExpand Retrieve a card — customers get Customers Customer Cards Id — response body
source (anyOf 3)ModelAlternativeExpand Create a source — response body
typestringRequired within parentThe type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
Known values: api_error, card_error, idempotency_error, invalid_request_error

Referenced models: Retrieve a bank account — response body, Retrieve a card — customers get Customers Customer Cards Id — response body, Cancel a Payment Intent — response body, Create a Payment Method — response body, Cancel a Setup Intent — response body, Create a source — 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
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
Cancel a Payment Intent — response body — amount details tip
FieldTypePresenceDescription and constraints
$objectRoot
tipModelOptionalExpand Cancel a Payment Intent — response body — amount details tip tip

Referenced models: Cancel a Payment Intent — response body — amount details tip tip

Cancel a PaymentIntent — response body — automatic_payment_methods / value / allow_redirects: always, never
FieldTypePresenceDescription and constraints
$objectRoot
allow_redirectsstringOptionalControls whether this PaymentIntent will accept redirect-based payment methods.

Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://docs.stripe.com/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
Known values: always, never
enabledbooleanRequired within parentAutomatically calculates compatible payment methods
Cancel a Payment Intent — response body — payment details
FieldTypePresenceDescription and constraints
$objectRoot
customer_referenceJSONOptional
customer_reference (anyOf 1)stringAlternativeA unique value to identify the customer. This field is available only for card payments.

This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
Maximum length: 5000
customer_reference (anyOf 2)nullAlternative
order_referenceJSONOptional
order_reference (anyOf 1)stringAlternativeA unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
Maximum length: 5000
order_reference (anyOf 2)nullAlternative
Cancel a Payment Intent — response body — hooks
FieldTypePresenceDescription and constraints
$objectRoot
inputsModelOptionalExpand Cancel a Payment Intent — response body — hooks inputs

Referenced models: Cancel a Payment Intent — response body — hooks inputs

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