Stop duplicate orders
externalOrderId prevents two couriers for one delivery.
Send externalOrderId on every create request. It is your own order id, and it is unique in
your organization.
{ "externalOrderId": "PO-88213", "branch": "noerrebro" }A repeated value gives 409
duplicate_external_order_id.
Why it is important
A timeout tells you nothing. The order can exist.
| Second attempt | |
|---|---|
Without externalOrderId | Makes a second order. Two couriers collect one delivery. |
With externalOrderId | Makes the order one time, or tells you it exists. Both are safe. |
Use this field as if it is necessary, although the API accepts a request without it.
After a timeout
Read the order. Do not send the request again. GET /v1/orders/{reference} accepts your
externalOrderId:
curl https://api.univooz.com/v1/orders/PO-88213 \
-H "Authorization: Bearer uv_live_YOUR_KEY"If the first response never arrived, this id is the only identifier you have.
Both modes use the same ids
One id belongs to one order, in test and live. To use live ids in test mode, add a
prefix: test-PO-88213.
Univooz does not repeat the first response
A duplicate gives 409 and does not return the first order. Read it yourself.
Why. A repeated response would hide the fact that your second attempt occurred.
Select good ids
- Use the id your system has, such as an order number.
- Make it unique in your organization, not only in one branch.
- Do not use an id again. The uniqueness has no time limit.
- You cannot change it later. See
field_not_amendable.