Payment Intents
Payment intents represent a request to collect payment from a customer.
Overview
A payment intent is created when you want to process a payment.
Creating a Payment Intent
Request
POST /payment-intents
Content-Type: application/json
{
"amount": 1000,
"currency": "usd",
"description": "Payment for order #123"
}
Response
{
"id": "pi_1234567890",
"amount": 1000,
"currency": "usd",
"status": "requires_payment_method",
"created": 1234567890
}
Payment Intent Statuses
Payment intents progress through several statuses:
requires_payment_method- Payment method needs to be attachedrequires_confirmation- Payment method attached, awaiting confirmationrequires_action- Additional action required (e.g., 3D Secure)processing- Payment is being processedsucceeded- Payment completed successfullycanceled- Payment was canceledrequires_capture- Payment authorized, awaiting capture
Retrieving a Payment Intent
GET /payment-intents/{id}
Updating a Payment Intent
POST /payment-intents/{id}
Content-Type: application/json
{
"amount": 1500
}
Canceling a Payment Intent
POST /payment-intents/{id}/cancel
Webhooks
Payment intent events are sent via webhooks:
payment_intent.createdpayment_intent.succeededpayment_intent.failedpayment_intent.canceled