Visa APIv1
Idempotency
Retry a request safely without creating or changing anything twice.
Send an Idempotency-Key header (1 to 255 printable ASCII characters, for example a UUID) on POST and PATCH requests to the order endpoints, so that retrying after a timeout never acts twice. Keys are remembered for 24 hours and belong to your account.
curl -X POST "$PLUSVISA_API_URL/api/v1/orders" \
-H "X-API-Key: $PLUSVISA_API_KEY" \
-H "Idempotency-Key: 3f1c9a52-6f0e-4b8e-9d61-2a7b5c0e8d14" \
-H "Content-Type: application/json" -d @order.jsonHow a repeat is answered
| You send | You get |
|---|---|
| The same key and the same body | The original status, without doing the work again. For a success the body is the resource as it is now (an order that has moved on shows its current status), not a frozen copy. |
The same key after a client error such as invalid_answers | The same error, replayed. Use a new key for each new attempt once you have fixed the problem. |
| The same key with a different body | 409 idempotency_conflict |
| The same key while the first request is still running | 409 idempotency_in_progress: retry shortly. |
The same key after upstream_unavailable or an unexpected server error | The request is tried again: the key was not kept. |
JSON bodies are compared by content: key order and whitespace do not matter.