Idempotent Requests

Tazapay API supports idempotency for safely retrying POST requests ensuring that you do not perform the same operation twice. This is useful when an API call is in transit and you do not receive a response. For example, if the request to create a transaction does not give a response, the same request can be successfully retried by using the same idempotency key in the header of the request.

Tazapay's idempotency works by storing the responses associated with successful requests, that is, requests which generate a 2xx status code. When you pass the same idempotency key in the header of the request body, the saved response is returned without performing the same operation again. If the request does not generate a successful response, passing the same idempotency key will cause it to perform the operation again.

If the API returns an error, the response is not stored and the operation is executed again.

We recommend passing idempotency keys only with POST requests. Passing idempotency keys with GET has no effect. To make idempotent requests, pass the following header with the request.

"Idempotency-Key":"afaowwWEshsfnosfnlsf"

You can pass a maximum of 255 characters in the value for the idempotency key. An idempotency key is a unique value generated by the client which the Tazapay server uses to recognise retries of the same request. You must ensure that you choose a method that generates keys with sufficient variations so that they are not same to another previous key passed.

📘

Duration for which any Idempotency-Key is valid

Any idempotency key is valid for a period of 24 hours from the time the request hits Tazapay's servers and it starts executing. If no execution happened, the key is not stored. Moreover, after 24 hours, any request with the same idempotency key is treated as a new request.