Quick Summary
Add an idempotency_key to your submit request. If you retry with the same key, EasyParcel returns the original response instead of creating a second order.
We'll Cover:
Why use it?
A timeout means you stopped waiting. It does not mean the order failed. The order is usually created, and you never received the response. A retry could then create a second order.
How to use it?
{
"api": "your-api-key",
"idempotency_key": "your-unique-reference",
"bulk": [ ... ]
}When you retry, send the same key and the same body. It works on EPSubmitOrderBulk and MPSubmitOrderBulk. Payment endpoints do not need it.
Choosing a key
- One key per order attempt. Create it before the first send and store it.
- Use your own order reference or a UUID. Maximum 255 characters.
- Keys are unique within your own integration.
- Never reuse a key for a new order.
When you send the same key again?
| Situation | What you get |
| First call | Processed normally and the response is stored |
| Original succeeded | The original response, no second order |
| Original still running | error_code 10. Nothing is created. Retry later with the same key |
| Original returned an error | The key is released. Your retry is processed as new |
| Same key, different body | error_code 11. Nothing is created |
On a bulk submit with some failed parcels, the mixed result is stored. Submit the failed parcels under a new key. A key is remembered for 24 hours.
Retry tips
- On a timeout, always retry with the same key.
- Wait 30 to 60 seconds before retrying, because a large bulk submit keeps running after you disconnect.
- Send a byte-identical body. For example, 1.000 and 1.0 count as different.
- On error_code 11, send the original body or use a new key.
Still need help?
Our team is happy to help. ? Live Chat | ✉️ Contact Us