Idempotent requests

With idempotency, you can safely retry requests without accidentally performing the same action twice, e.g. when placing an order.

The API supports idempotency for endpoints where idempotency is mentioned.

To perform an indempotent request, simply provide the Idempotency-Key header in your request. The key should be unique to your current request, so it's only the current operation that is affected.

We save the first request made with an idempotency key. Any retries with the same key will return the saved response, without repeating any operations. The idempotency key is saved for 24 hours in our system before resetting.

Sample idempotent request

const headers = {
  'Authorization': 'Bearer YOUR_SECRET_TOKEN',
  'Accept':'application/json',
  'Idempotency-Key': 'NBaiQcXoRftmm'
};

fetch('https://api.bazoom.com/client-api/v1/orders',
{
  method: 'POST',
  headers: headers,
  body: JSON.stringify({
   //...
  })
});