pending state can be cancelled — attempting to cancel an intent that has already been processed, failed, or previously cancelled will return an error. Supply a status_reason to record why the intent was cancelled; this reason is stored on the intent and returned in subsequent reads.curl --location --request PATCH '/payment-intents/01J3KQZM0000000000000000AB' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"status": "cancelled",
"status_reason": "Customer requested cancellation before payment was processed"
}'{
"message": "Payment intent cancelled successfully",
"status": "success",
"data": {
"id": "01J3KQZM0000000000000000AB",
"account_id": "01J3KQABC0000000000000000X",
"entity_id": "01J3KQ0000000000000000ENTT",
"amount": 150000,
"currency": "NGN",
"status": "cancelled",
"status_reason": "Customer requested cancellation before payment was processed",
"client_reference": "order_ref_20250805_0042",
"description": "Payment for order #0042",
"client_meta": {
"customer_id": "cust_9x2b",
"campaign": "summer_sale"
},
"created": 1754388720000,
"updated": 1754392100000
}
}