Skip to main content
The Fintoc API supports idempotent requests. You can retry an idempotent request without performing the same operation twice. Use idempotency for resource creation requests that you might retry after a network error. Examples include charges, payment intents, and transfers. If a connection error occurs after you submit an idempotent request, you can retry the request without creating a second object. To make an idempotent request, include the Idempotency-Key: <idempotency-key-value> header. An idempotency key is a unique value that your client generates. Fintoc uses this key to recognize retries of the same request. Use UUID version 4 values or random strings with enough entropy to avoid collisions. Idempotency keys can contain up to 255 characters. Fintoc saves the status code and response body from the first request for each idempotency key, whether the request succeeds or fails. Subsequent requests with the same key return the saved result, including 4xx and 5xx errors.
Authentication neededFintoc does not save an idempotent result when authentication fails because the request does not reach the API endpoint.
For each retry, the idempotency layer compares the request parameters with the original request parameters. Fintoc returns an error if the parameters differ. Fintoc can remove idempotency keys automatically once they are at least 24 hours old. If you reuse a key after Fintoc removes the original result, the API processes the request as new. All POST requests accept idempotency keys. Sending idempotency keys in GET and DELETE requests has no effect because GET and DELETE requests are idempotent by definition. The following examples create a charge with an idempotency key. You can retry the request without creating a duplicate charge.