status before changing an order in your system.
Statuses
PENDING, REQUIRES_ACTION, and PROCESSING are non-terminal. SUCCEEDED,
FAILED, and EXPIRED are terminal for that Payment.
Track the authoritative result
Subscribe to Webhooks for lifecycle notifications. Each event carries the snapshot at the time of the event; retrieve the Payment whenever you need its latest state. CallGET /v1/payments/{id} until the Payment reaches a terminal status:
Request-Id. A local timeout does not authorize a duplicate charge.
Handle required actions
When the status isREQUIRES_ACTION:
- Read both
next_action.reasonandnext_action.redirect_url. - Treat the URL as opaque and send the customer’s browser to it.
- Retrieve the Payment again after the browser returns.
- If the Payment still requires action and the URL changed, send the browser to the new URL. Do not loop back to an unchanged URL in the same session.
Retry a request or create a new attempt
These are different actions:- If the create request timed out or returned a retryable HTTP error, retry the
same
Idempotency-Keywith an equivalent effective request identity. This retrieves or replays the result of the same Payment creation operation. - If a Payment is terminal with
FAILEDorEXPIREDand the customer wants to try again, create a new Payment with a newIdempotency-Key.
merchant_reference to associate several legitimate
attempts with one order. It labels attempts but does not deduplicate them.
Status history and refunds
status_transitions contains the known lifecycle timestamps as Unix seconds.
After SUCCEEDED, use amount_refundable to decide whether a
full or partial Refund can be created.