Aller au contenu principal

Payment Intents

A PaymentIntent represents a payment flow. It tracks the lifecycle from creation to completion.

The PaymentIntent object

{
"id": "pi_1a2b3c4d5e",
"object": "payment_intent",
"amount": 10000,
"currency": "xof",
"status": "requires_payment_method",
"payment_method_types": ["mobile_money", "card"],
"description": "Order #1234",
"metadata": {},
"created": 1708300800
}

Create a PaymentIntent

POST /v1/payment-intents
ParameterTypeRequiredDescription
amountintegerAmount in smallest currency unit
currencystringThree-letter ISO currency code
payment_method_typesstring[]Allowed payment methods
descriptionstringDescription for the payment
metadataobjectKey-value metadata
confirmbooleanConfirm immediately if true
customerstringCustomer ID
payment_methodstringPayment method ID

Retrieve a PaymentIntent

GET /v1/payment-intents/{id}

Confirm a PaymentIntent

POST /v1/payment-intents/{id}/confirm
ParameterTypeRequiredDescription
payment_methodstringPayment method ID
payment_method_dataobjectInline payment method data

Cancel a PaymentIntent

POST /v1/payment-intents/{id}/cancel

List PaymentIntents

GET /v1/payment-intents
ParameterTypeDescription
limitintegerNumber of results (1–100)
starting_afterstringPagination cursor
statusstringFilter by status
customerstringFilter by customer