Close
logointerlace
Talk with us >

Idempotency

The API has support for idempotent requests. When you send a request with the idempotency key set, the server will ensure that the request will only be processed once, no matter how many times the request is sent or received. This is useful in preventing duplicate operations in the face of errors or network disruption.

The idempotency key itself may be any arbitrary string. Because the server identifies each unique request by a unique idempotency key, be sure to choose a string that will not be reused in subsequent requests. Choosing a large random string, such as a UUID, is a good idea.

To make a request idempotent, generate an idempotency key and send it in the X-Idempotency-Key header.

Example Request

$ curl --request POST \
-u https://xxx.yyy.zzz.infinant.com/oxchg-cards/v1/cards \
-H 'Authorization: Bearer $API_TOKEN' \
-H 'Content-Type: application/json' \
-H 'X-Idempotency-Key: $Idempotency_Key' \
-d '{
"cardId": "1234",
"type": "Physical",
"number": "3423324341234",
"currency": "USD",
"expiration": "0524",
"last4": "1234",
"cvv": "null",
"accountId": "accountid_abc",
"cardHolderId": "cardholderid_xyz",
"cardProductId": "cardproductid_567",
"pin": "9876",
"pinIsSet": "null",
"status": "Active",
"created": "2021-02-19T20:42:41Z"
}'
🚀 API Documentation — Previous
API Basics
Next
Pagination