Use idempotency keys to safely retry failed requests without accidentally creating duplicate orders.
Network failures, timeouts, and unexpected errors can leave you uncertain whether a request succeeded. Without idempotency, a naive retry might create a duplicate order and charge your balance twice.
By including an X-Idempotency-Key header with a unique string (UUID v4
recommended), Giftronaut will return the original response if the same key
is seen again within the deduplication window — without re-executing the operation.
curl -X POST "https://api.giftronaut.com/api/v1/orders/branded-card" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-d '{ ... }'
| Scenario | HTTP status | Body |
|---|---|---|
| First request succeeds | 201 | New order object |
| Retry within window (same key) | 200 | Original order object |
| Duplicate detected, key reused with different body | 409 | Error: DUPLICATE_IDEMPOTENCY_KEY |
POST, PUT, PATCH)GET and DELETE requests are inherently safe to retryStart typing to search...
Select the APIs you want to integrate. A ready-to-use Markdown file with full API specs and a project context template will be generated and downloaded. Paste it into your AI assistant to get started instantly.