Idempotency
Every public write requires Idempotency-Key: 16–255 visible ASCII characters.
curl --request POST 'https://api.freshlycart.com/api/v1/customers' \ --header 'Authorization: Bearer fc_pat_EXAMPLE' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: customer-import-2026-0001' \ --data '{"name":"Example Customer","email":"customer@example.test"}'| Situation | Result |
|---|---|
| Same key + same semantic request | Replays the same resource and op_ operation identity; no second mutation |
| Same key + changed semantic request | 409 conflict; no work is performed |
Network timeout or ambiguous 5xx |
Retry with the same key |
Never generate a new key for the same logical operation. Keys are namespaced to the credential, merchant, and operation. The replayed representation reflects the resource’s current state, not a stored historical response body.