A valid request URL is required to generate request examples{
"id": "<string>",
"object": "payment_intent",
"merchant_id": "<string>",
"livemode": true,
"client_secret": "<string>",
"customer": "<string>",
"amount": 123,
"currency": "<string>",
"capture_method": "automatic",
"status": "requires_payment_method",
"payment_method": "<string>",
"latest_charge_id": "<string>",
"metadata": {},
"created_at": 123,
"updated_at": 123,
"setup_future_usage": "off_session",
"tokenization": {
"provider": "<string>",
"tokenization_key": "<string>"
},
"reference": "<string>"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "invalid currency"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}{
"error": {
"code": "PAYMENT_INTENT_NOT_FOUND",
"message": "payment intent not found"
}
}{
"error": {
"code": "INVALID_STATE",
"message": "payment intent cannot be captured in its current state"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}Cancel a payment intent
Requests cancellation for an intent that has not been captured. Most
non-terminal states become canceled immediately; a requires_capture
intent first voids its authorized charge. A processing intent can
remain processing while its in-flight outcome resolves, so poll the
intent or consume webhooks for its next state. The body is optional; an
absent body supplies no reason.
A valid request URL is required to generate request examples{
"id": "<string>",
"object": "payment_intent",
"merchant_id": "<string>",
"livemode": true,
"client_secret": "<string>",
"customer": "<string>",
"amount": 123,
"currency": "<string>",
"capture_method": "automatic",
"status": "requires_payment_method",
"payment_method": "<string>",
"latest_charge_id": "<string>",
"metadata": {},
"created_at": 123,
"updated_at": 123,
"setup_future_usage": "off_session",
"tokenization": {
"provider": "<string>",
"tokenization_key": "<string>"
},
"reference": "<string>"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "invalid currency"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}{
"error": {
"code": "PAYMENT_INTENT_NOT_FOUND",
"message": "payment intent not found"
}
}{
"error": {
"code": "INVALID_STATE",
"message": "payment intent cannot be captured in its current state"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "card_error",
"decline_code": "<string>",
"decline_type": "authorization",
"retryable": true,
"doc_url": "<string>"
}
}Authorizations
A merchant secret key (sk_…) sent as Authorization: Bearer <key>.
Headers
A unique key that makes retries safe: the same key with the same request body returns the original response instead of repeating the operation.
255Merchant ID when an authorized Platform acts for a connected Merchant. Omit when authenticating directly as that Merchant.
^mer_[0-9A-Za-z]{14}$Path Parameters
The payment intent id (pi_…).
Body
Optional cancellation reason (max 256 chars).
Response
The updated payment intent. It can remain processing while cancellation is pending; otherwise its status is canceled.
A request to collect a payment from a customer, tracking the payment through its attempts until it succeeds or is canceled.
The payment intent id (pi_…).
Always payment_intent.
payment_intent The owning merchant (mer_…).
Whether this intent was created with a live (true) or test (false) key.
Returned when the intent is created or confirmed; null on capture, cancel, and list responses.
The attached customer (cus_…). Null unless a customer was passed at creation.
The amount to collect, in minor units. Always positive.
Three-letter ISO currency code. USD, EUR, and GBP are supported.
automatic captures the charge on confirmation. manual authorizes a hold; capture it later via POST /payment_intents/{id}/capture.
automatic, manual One of requires_payment_method (collect or attach a payment method), requires_confirmation (ready to confirm), processing (payment is in progress), requires_action (the buyer must complete another step), requires_capture (authorized and awaiting manual capture), succeeded (payment completed), or canceled (payment can no longer be completed).
requires_payment_method, requires_confirmation, requires_action, requires_capture, processing, succeeded, canceled The attached payment method (pm_…). Nullable; cleared on a decline so a retry can attach a different method.
The most recent charge produced by this intent (ch_…).
A string key-value map for storing your own structured data. Up to 50 keys; each key at most 40 characters and each value at most 500 characters.
Show child attributes
Show child attributes
Unix epoch seconds.
Unix epoch seconds, bumped on every mutation.
Save the new card for future payments after collecting consent. Requires a customer.
off_session Browser-safe card-fields configuration returned with client_secret on publishable-key requests. Null when card collection is not available.
Show child attributes
Show child attributes
Your order number or other reference. Max 256 characters.

