Capture a PaymentIntent
POST
/v1/payment_intents/{id}/captureCapture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by default).
Request
The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full amount_capturable if not provided.
{}
Request samples
Responses
Unique identifier for the object, like 'pi_xxx'
'payment_intent'
Time at which the object was created. Measured in seconds since the Unix epoch.
Three-letter ISO currency code, in lowercase. Must be a supported currency.
ID of the Customer
Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). . The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded
An arbitrary string attached to the object. Often useful for displaying to users.
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.
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
Shipping information for this PaymentIntent.
The delivery service that shipped a physical product, such as FedEx, UPS, USPS, etc.
Recipient name.
Recipient phone (including extension).
The 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.
The order ID created in merchant's order system that corresponds to this PaymentIntent
The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.
The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
For some errors that could be handled programmatically, a short string indicating the error code reported.
A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
The PaymentMethod object for errors returned on a request involving a PaymentMethod.
The type of error returned. One of api_error, card_error, idempotency_error, or invalid_request_error.
For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one.
(未实现P7)For card errors, the ID of the failed charge.
If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
Type of the next action to perform
The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
Payment-method-specific configuration for this PaymentIntent.
ID of the payment method used in this PaymentIntent.
Email address that the receipt for the resulting payment will be sent to.
Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) .
Possible enum values:
automatic (Default)
PaymentIntent can be confirmed using a publishable key. After next_action s are handled, no additional confirmation is required to complete the payment.
manual
All payment attempts must be made using a secret key. The PaymentIntent returns to the requires_confirmation state after handling next_actions, and requires your server to initiate each payment attempt with an explicit confirmation.
The status of 3DS result
This is the Cardholder Authentication Verification Value, indicating that the transaction has been authenticated. This only exists when no challenge is required, i.e., a successful frictionless authentication.
This is the Electronic Commerce Indicator code, which gets returned by the card issuer indicating whether the cardholder was successfully authenticated. Note that in some cases the eci value includes a leading zero, e.g., 01 or 02. Visa, Amex, JCB, and Diners Club 5 – Identifies a successfully authenticated transaction. 6 – Identifies an attempted authenticated transaction. 7 – Identifies a non-authenticated transaction. Mastercard 0 – Identifies a non-authenticated transaction. 1 – Identifies an attempted authenticated transaction. 2 – Identifies a successfully authenticated transaction. This only exists when no challenge is required, i.e., a frictionless authentication.
This is the status of the Authentication request.
Possible values are:
COMPLETED – The transaction has been completed.
PENDING – The transaction has not been completed yet.
FAILED – The authentication request failed.
This indicates the outcome of the authentication. Possible values are:
Y – The cardholder successfully authenticated with their card issuer.
A – The cardholder authentication was attempted.
N – The cardholder failed to successfully authenticate with their card issuer.
U – Authentication with the card issuer was unavailable.
C – Challenge Required; additional authentication is required.
R – Rejected transaction.
This indicates whether the cardholder is enrolled in 3D Secure. Possible values are:
Y – Cardholder authentication is available
N – Cardholder is not enrolled in authentication
U – Cardholder authentication unavailable
This is the 3D secure protocol version.
This is the transaction identifier returned by the card issuer. This exists only for 3DS 1.0.2.
The 3D Secure Server transaction Id. This exists only for 3D Secure 2.
Amount that can be captured from this PaymentIntent.
The url that the cutomer will be redirected to.
The quantity of the items being purchased.
The latest charge created by this payment intent.
The user ID created in merchant's order system that corresponds to this PaymentIntent
Amount that was collected by this PaymentIntent.
Possible enum values:automatic(default),manual
ID of the invoice that created this PaymentIntent, if it exists.
Indicates that you intend to make future payments with this PaymentIntent’s payment method. Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.
{
"id": "string",
"object": "string",
"created": 0,
"currency": "string",
"customer": "string",
"amount": 0,
"status": "string",
"description": "string",
"metadata": {},
"livemode": true,
"shipping": {
"address": {
"city": "string",
"country": "string",
"line1": "string",
"line2": "string",
"postal_code": "string",
"state": "string"
},
"carrier": "string",
"name": "string",
"phone": "string",
"tracking_number": "string"
},
"merchant_order_id": "string",
"client_secret": "string",
"last_payment_error": {
"code": "string",
"message": "string",
"payment_method": {},
"type": "string",
"decline_code": "string",
"charge": "string"
},
"next_action": {
"type": "string",
"redirect_to_url": {
"return_url": "string",
"url": "string"
},
"ddc_redirect": {
"return_url": "string",
"url": "string"
},
"challenge_redirect": {
"return_url": "string",
"url": "string"
},
"alipayplus_handle_redirect": {
"return_url": "string",
"schemeUrl": "string",
"applinkUrl": "string",
"normalUrl": "string"
},
"alipay_handle_redirect": {
"native_data": "string",
"native_url": "string",
"return_url": "string",
"url": "string"
},
"wechat_pay_display_qr_code": {
"data": "string",
"data_ur": "string",
"image_url_png": "string",
"image_url_svg": "string"
},
"wechat_pay_redirect_to_android_app": {
"native_url": "string"
},
"wechat_pay_redirect_to_ios_app": {
"native_url": "string"
},
"wechat_pay_redirect_to_web": {
"url": "string"
},
"wechat_pay_official_account_params": {
"appId": "string",
"timeStamp": "string",
"nonceStr": "string",
"signType": "string",
"paySign": "string",
"package": "string"
},
"truemoney_handle_redirect": {
"url": "string"
},
"akulaku_handle_redirect": {
"url": "string"
},
"bank_transfer_id_handle_redirect": {
"url": "string"
},
"promptpay_handle_redirect": {
"url": "string"
},
"dana_handle_redirect": {
"url": "string"
},
"shopeepay_handle_redirect": {
"url": "string"
},
"gcash_handle_redirect": {
"url": "string"
},
"rabbit_line_pay_handle_redirect": {
"url": "string"
},
"alipay_hk_handle_redirect": {
"url": "string"
},
"bpi_handle_redirect": {
"url": "string"
}
},
"payment_method_types": [
"alipay"
],
"payment_method_options": {
"card": {
"request_three_d_secure": "any",
"setup_future_usage": "on_session",
"capture_method": "string",
"tax_id": "string"
},
"alipayplus": {
"terminal_type": "APP",
"os_type": "IOS"
},
"alipay_hk": {
"terminal_type": "APP",
"os_type": "IOS"
},
"alipay": {
"terminal_type": "APP",
"os_type": "IOS"
},
"wechat_pay": {
"terminal_type": "WEB",
"client_ip": "string",
"os_type": "IOS",
"openid": "string"
},
"sepa_debit": {},
"akulaku": {
"terminal_type": "WEB",
"os_type": "IOS"
},
"truemoney": {
"terminal_type": "WEB",
"os_type": "IOS"
},
"kakaopay": {
"terminal_type": "WEB",
"os_type": "IOS"
},
"shopeepay": {
"terminal_type": "string",
"os_type": "string"
},
"dana": {
"terminal_type": "string",
"os_type": "string"
},
"pix": {
"tax_id": "string"
}
},
"payment_method": "string",
"receipt_email": "string",
"canceled_at": 0,
"cancellation_reason": "string",
"confirmation_method": "string",
"3ds_status": {
"cavv": "string",
"eci": 0,
"status": "string",
"three_d_result": "string",
"three_d_enrollment": "string",
"three_d_secure_version": "string",
"xid": "string",
"three_d_secure_server_transaction_id": "string"
},
"amount_capturable": 0,
"return_url": "string",
"quantity": 0,
"latest_charge": "string",
"merchant_user_id": "string",
"amount_received": 0,
"capture_method": "string",
"invoice": "string",
"setup_future_usage": "off_session"
}