Idempotent Requests
Idempotent requests are a crucial aspect of the Abillify API, ensuring that repeated requests do not result in duplicate transactions. This is particularly important for operations like creating orders or processing payments, where multiple submissions could lead to unintended consequences.
To perform idempotent requests, you can use the Idempotency-Key header. This header should contain a unique value for each request that you want to ensure is processed only once. If a request with the same Idempotency-Key is made again, the API will return the same response as the first request, preventing duplicate processing.
Subsequent requests with the same key will not create new resources or trigger new actions, but will return the result of the original request. This includes all errors (4xx/5xx), which will return the exact same error response as the first request.
The API consumer creates the Idempotency-Key value, which can be any unique string. It is recommended to use a UUID or a combination of a timestamp and a unique identifier to ensure uniqueness. You can use up to 255 characters for the Idempotency-Key.
The keys automatically expire after 24 hours, meaning that you can reuse the same key after this period.
The Idempotency is only applied after the input data has been validated, and internal processing has started. If the request fails before this point, it will not be idempotent, and you will need to handle retries manually.
All endpoints using the POST method support idempotency, and it is recommended to use it for any operation that could potentially be repeated unintentionally.
For GET and DELETE requests, idempotency is inherently supported by the nature of these operations, as they do not create new resources or change the state of existing ones.