Capture a PaymentIntent
POST / v1 / payment_intents /:id / capture
Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
Learn more about separate authorization and capture.
Parameters
- amount _ to _ capture integer The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Defaults to the full
amount_capturableif it’s not provided. - metadata map Set of key-value pairs 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.
More parameters
- amount _ details object
- application _ fee _ amount integer Connect only
- final _ capture boolean
- hooks object
- payment _ details object
- statement _ descriptor string
- statement _ descriptor _ suffix string
- transfer _ data object Connect only
Returns
Returns a PaymentIntent object with status="succeeded" if the PaymentIntent is capturable. Returns an error if the PaymentIntent isn’t capturable or if an invalid amount to capture is provided.
Response
{ "id": "pi_3MrPBM2eZvKYlo2C1TEMacFD", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, "amount_details": { "tip": {} }, "amount_received": 1000, "application": null, "application_fee_amount": null, "automatic_payment_methods": null, "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", "client_secret": "pi_3MrPBM2eZvKYlo2C1TEMacFD_secret_9J35eTzWlxVmfbbQhmkNbewuL", "confirmation_method": "automatic", "created": 1524505326, "currency": "usd", "customer": null, "description": "One blue fish", "last_payment_error": null, "latest_charge": "ch_1EXUPv2eZvKYlo2CStIqOmbY", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, "payment_method": "pm_1EXUPv2eZvKYlo2CUkqZASBe", "payment_method_options": {}, "payment_method_types": [ "card" ], "processing": null, "receipt_email": null, "redaction": null, "review": null, "setup_future_usage": null, "shipping": null, "statement_descriptor": null, "statement_descriptor_suffix": null, "status": "succeeded", "transfer_data": null, "transfer_group": null}
Confirm a PaymentIntent
POST / v1 / payment_intents /:id / confirm
Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment.
If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual).
If the confirmation_method is automatic, payment may be attempted using our client SDKs and the PaymentIntent’s client_secret. After next_action s are handled by the client, no additional confirmation is required to complete the payment.
If the confirmation_method is manual, all payment attempts must be initiated using a secret key.
If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt.
There is a variable upper limit on how many times a PaymentIntent can be confirmed. After this limit is reached, any further calls to this endpoint will transition the PaymentIntent to the canceled state.
Parameters
- payment _ method string ID of the payment method (a PaymentMethod, Card, or compatible Source object) to attach to this PaymentIntent. If the payment method is attached to a Customer, it must match the customer that is set on this PaymentIntent.
- receipt _ email string Email address that the receipt for the resulting payment will be sent to. If
receipt_emailis specified for a payment in live mode, a receipt will be sent regardless of your email settings. - setup _ future _ usage enum Indicates that you intend to make future payments with this PaymentIntent’s payment method. If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don’t provide a Customer, you can still attach the payment method to a Customer after the transaction completes. If the payment method is
card_presentand isn’t a digital wallet, Stripe creates and attaches a generated_card payment method representing the card to the Customer instead. When processing card payments, Stripe usessetup_future_usageto help you comply with regional legislation and network rules, such as SCA. If you’ve already setsetup_future_usageand you’re performing a request using a publishable key, you can only update the value fromon_sessiontooff_session. Possible enum valuesoff_sessionUseoff_sessionif your customer may or may not be present in your checkout flow.on_sessionUseon_sessionif you intend to only reuse the payment method when your customer is present in your checkout flow. - shipping object Shipping information for this PaymentIntent.
More parameters
- allowed _ payment _ method _ types array of enums
- amount _ details object
- amount _ to _ confirm integer secret key only
- capture _ method enum secret key only
- confirmation _ token string
- error _ on _ requires _ action boolean
- excluded _ payment _ method _ types array of enums
- hooks object
- mandate string secret key only
- mandate _ data object
- off _ session boolean | string secret key only
- payment _ details object
- payment _ method _ data object
- payment _ method _ options object secret key only
- radar _ options object secret key only
- return _ url string
- use _ stripe _ sdk boolean
Returns
Returns the resulting PaymentIntent after all possible transitions are applied.
Response
{ "id": "pi_3MtweELkdIwHu7ix0Dt0gF2H", "object": "payment_intent", "amount": 2000, "amount_capturable": 0, "amount_details": { "tip": {} }, "amount_received": 2000, "application": null, "application_fee_amount": null, "automatic_payment_methods": { "enabled": true }, "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", "client_secret": "pi_3MtweELkdIwHu7ix0Dt0gF2H_secret_ALlpPMIZse0ac8YzPxkMkFgGC", "confirmation_method": "automatic", "created": 1680802258, "currency": "usd", "customer": null, "description": null, "last_payment_error": null, "latest_charge": "ch_3MtweELkdIwHu7ix05lnLAFd", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, "payment_method": "pm_1MtweELkdIwHu7ixxrsejPtG", "payment_method_options": { "card": { "installments": null, "mandate_options": null, "network": null, "request_three_d_secure": "automatic" }, "link": { "persistent_token": null } }, "payment_method_types": [ "card", "link" ], "processing": null, "receipt_email": null, "review": null, "setup_future_usage": null, "shipping": null, "source": null, "statement_descriptor": null, "statement_descriptor_suffix": null, "status": "succeeded", "transfer_data": null, "transfer_group": null}
Increment an authorization
POST / v1 / payment_intents /:id / increment_authorization
Perform an incremental authorization on an eligible PaymentIntent. To be eligible, the PaymentIntent’s status must be requires_capture and incremental_authorization_supported must be true.
Incremental authorizations attempt to increase the authorized amount on your customer’s card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount.
If the incremental authorization succeeds, the PaymentIntent object returns with the updated amount. If the incremental authorization fails, a card_declined error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount.
Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it’s captured, a PaymentIntent can no longer be incremented.
Learn more about incremental authorizations with in-person payments and online payments.
Parameters
- amount integer Required The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount.
- description string An arbitrary string attached to the object. Often useful for displaying to users.
- metadata map Set of key-value pairs 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. - statement _ descriptor string Text that appears on the customer’s statement as the statement descriptor for a non-card or 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.
More parameters
- amount _ details object
- application _ fee _ amount integer Connect only
- hooks object
- payment _ details object
- transfer _ data object Connect only
Returns
Returns a PaymentIntent object with the updated amount if the incremental authorization succeeds. Returns an error if the incremental authorization failed or the PaymentIntent isn’t eligible for incremental authorizations.
Response
{ "id": "pi_1DtBRR2eZvKYlo2CmCVxxvd7", "object": "payment_intent", "amount": 2099, "amount_capturable": 2099, "amount_details": { "tip": {} }, "amount_received": 0, "application": null, "application_fee_amount": null, "automatic_payment_methods": null, "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", "client_secret": "pi_1DtBRR2eZvKYlo2CmCVxxvd7_secret_cWsUkvyTOjhLKh5Wxu61nYc0i", "confirmation_method": "automatic", "created": 1680196960, "currency": "usd", "customer": null, "description": null, "last_payment_error": null, "latest_charge": "ch_3MrPBM2eZvKYlo2C1CEBUD4A", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, "payment_method": "pm_1MrPBL2eZvKYlo2CaNa8L11Z", "payment_method_options": { "card": { "installments": null, "mandate_options": null, "network": null, "request_three_d_secure": "automatic" } }, "payment_method_types": [ "card" ], "processing": null, "receipt_email": null, "redaction": null, "review": null, "setup_future_usage": null, "shipping": null, "statement_descriptor": null, "statement_descriptor_suffix": null, "status": "requires_capture", "transfer_data": null, "transfer_group": null}
