Retry matrix
Recover after an unknown result
If a payment request times out, retrieve the resource instead of creating the payment again. Store your own order ID so you can match the API result to the original request:- Store
client_reference_idon checkout sessions. - Store
metadata.order_idor similar on checkout sessions, payment links, refunds, and customers.
Confirm payment on your server
Success redirects can be lost, forged, duplicated, or opened in another tab. Always verify server-side state before fulfillment.Reuse keys only for retries
An idempotency key should represent one business operation, not one endpoint forever. Good:What’s next
Test cards
See the card numbers and behaviors that test mode supports.
Idempotency
Retry a request without repeating its effect.
Errors
Read the error envelope and what each status code means.
Decline codes
Look up what each card decline means and whether the same card can succeed later.

