Skip to main content
Network errors and timeouts can leave you unsure whether an order was created. Send an Idempotency-Key header with POST /orders, and retry with the same key and body. AGS creates the order at most once.
Use a unique value for each order, such as a UUID or your own order ID, up to 255 characters. Keys are separate for each app and customer.

Responses

The body comparison ignores key order and whitespace, so a retry only needs the same values.

Rejected orders

If an order is rejected, with validation_failed or order_rejected, the key isn’t used up. Fix the request and retry with the same key. If a request fails on our side before the order is created, the key is released, so a retry with it creates the order. If our server stops mid-request, the key is released after a minute.
Without an Idempotency-Key, every request creates a new order.