Hand an order to a carrier or to a driver
kind: "carrier" hands the order to a delivery company (needs delivery:dispatch); kind: "driver" gives it to the store's driver (needs orders:assign).
Carrier. Only a ready order with no shipment can be handed off. The shipment is reserved before the carrier is called, so a second dispatch of the same order is refused (409 ORDER_HAS_SHIPMENT) and never reaches the carrier.
What the carrier's answer proves decides the outcome:
- accepted — the carrier created the parcel. When the company auto-validates and the carrier needs a separate validation, it is validated too; a refused validation is reported in
validationErrorand kept in the shipment's history. - refused — the carrier refused it, the credentials failed, it was throttled, or it could not be reached: nothing was created and the order is ready again.
- unknown — the carrier may have created it (a timeout, a server error). It is never sent again automatically: resolve it with
POST /shipments/{id}/resolve.
Driver. The store's own driver has no carrier to call: the shipment is accepted at once, and the driver's fee for the order's wilaya (0 where none is set) is frozen on it. The driver is not a carrier and has no stop desks: the shipment is always home delivery to the order's street address — an order whose customer chose a stop desk keeps that choice and its price, and the driver brings it to the door (deliveryType: "stop_desk" is refused). Only a ready order with no shipment and a street address (400 MISSING_ADDRESS), and a driver who is not inactive. The driver's progress is then reported with POST /shipments/{id}/events.
path Parameters
idResource ID
Resource ID
Hand an order to a carrier or to a driver › Request Body
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: kind, companyId | |
| type = object · requires: kind, driverId |
kindcompanyIdThe delivery company to hand the order to
deliveryTypeShip as home or stop-desk delivery instead of what the customer asked for — for a carrier with no desk in the wilaya, or the reverse. The cash to collect does not change.
stationCodeThe stop desk, when shipping to one
weightParcel weight in kg; otherwise the sum of its variants' weights
fragileremarksFor the courier; otherwise the order's notes
Hand an order to a carrier or to a driver › Responses
The carrier has the parcel, or the driver has the order
successHand many orders to a carrier
The same handoff as POST /orders/{id}/shipment, for up to 100 orders and one company, with one result per order. The carrier's bulk creation is used when it has one.
Only a ready order with no shipment can be handed off. The shipment is reserved before the carrier is called, so a second dispatch of the same order is refused (409 ORDER_HAS_SHIPMENT) and never reaches the carrier.
What the carrier's answer proves decides the outcome:
- accepted — the carrier created the parcel. When the company auto-validates and the carrier needs a separate validation, it is validated too; a refused validation is reported in
validationErrorand kept in the shipment's history. - refused — the carrier refused it, the credentials failed, it was throttled, or it could not be reached: nothing was created and the order is ready again.
- unknown — the carrier may have created it (a timeout, a server error). It is never sent again automatically: resolve it with
POST /shipments/{id}/resolve.
Hand many orders to a carrier › Request Body
companyIdorderIdsdeliveryTypeShip as home or stop-desk delivery instead of what the customer asked for — for a carrier with no desk in the wilaya, or the reverse. The cash to collect does not change.
Hand many orders to a carrier › Responses
One result per order
successGive many orders to a driver
The same handoff as POST /orders/{id}/shipment with kind: "driver", for up to 100 orders and one driver, with one result per order: accepted or refused (never unknown).
The store's own driver has no carrier to call: the shipment is accepted at once, and the driver's fee for the order's wilaya (0 where none is set) is frozen on it. The driver is not a carrier and has no stop desks: the shipment is always home delivery to the order's street address — an order whose customer chose a stop desk keeps that choice and its price, and the driver brings it to the door (deliveryType: "stop_desk" is refused). Only a ready order with no shipment and a street address (400 MISSING_ADDRESS), and a driver who is not inactive. The driver's progress is then reported with POST /shipments/{id}/events.
Give many orders to a driver › Request Body
driverIdorderIdsdeliveryTypeAlways home: the store's own driver brings the parcel to the customer's street address, even when the customer chose a stop desk (the order keeps that choice and its price). A stop desk is refused.
Give many orders to a driver › Responses
One result per order
successGet a shipment
The shipment with its full history (carrier statuses as reported, and what Wocart concluded from them) and the actions available now.
path Parameters
idResource ID
Resource ID
Get a shipment › Responses
The shipment
successEdit a parcel at the carrier
Changes the customer's details, the destination, the cash to collect, the weight or fragility — at the carrier first, then in Wocart: the order's contact and destination (with its customer, like an order edit) and the shipment's cash, weight and fragility. Only before the parcel leaves (and, at a carrier that validates separately, before validation). A new destination needs both wilayaId and communeId.
path Parameters
idResource ID
Resource ID
Edit a parcel at the carrier › Request Body
customerNamephoneaddresswilayaIdcommuneIdamountThe cash to collect
weightfragileremarksEdit a parcel at the carrier › Responses
The shipment after the operation
successResolve a handoff whose outcome is unknown
lookup— ask the carrier for a parcel with this order's number (carriers that support it).not_foundleaves the shipment unresolved.attach— the parcel was found at the carrier: record its tracking number.release— the carrier has no parcel: the shipment is removed and the order is ready to hand off again.
path Parameters
idResource ID
Resource ID
Resolve a handoff whose outcome is unknown › Request Body
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: action | |
| type = object · requires: action, trackingNumber | |
| type = object · requires: action |
actionResolve a handoff whose outcome is unknown › Responses
How it was resolved
successValidate a parcel at the carrier
For carriers that hold a created parcel until it is validated (EcoTrack, NOEST). After validation it can no longer be edited or cancelled.
path Parameters
idResource ID
Resource ID
Validate a parcel at the carrier › Request Body
requestPickupAsk the carrier to collect the parcel (EcoTrack)
Validate a parcel at the carrier › Responses
The shipment after the operation
successVoid a shipment
Undo a shipment that never reached the customer, so the order can be handed off again: a carrier parcel is cancelled at the carrier first (unless the carrier already cancelled it); a driver's order is taken back from the driver. Refused once it is out for delivery. A carrier shipment needs delivery:dispatch, a driver's orders:assign.
path Parameters
idResource ID
Resource ID
Void a shipment › Responses
Voided; the order is ready to hand off again
successRead the parcel's remarks at the carrier
path Parameters
idResource ID
Resource ID
Read the parcel's remarks at the carrier › Responses
Remarks from the merchant and the courier
successAdd a remark for the courier
path Parameters
idResource ID
Resource ID
Add a remark for the courier › Request Body
contentAdd a remark for the courier › Responses
The shipment after the operation
successAsk the carrier to return the parcel
A request the courier may decline; it is noted in the history and changes nothing until the carrier reports the return.
path Parameters
idResource ID
Resource ID
Ask the carrier to return the parcel › Responses
The shipment after the operation
successAsk the carrier to try delivering again
After a failed attempt (NOEST). Noted in the history.
path Parameters
idResource ID
Resource ID
Ask the carrier to try delivering again › Responses
The shipment after the operation
successConfirm at the carrier that the return reached you
EcoTrack's return confirmation, then the return is recorded: the goods go back in stock and the customer's spend is rolled back.
path Parameters
idResource ID
Resource ID
Confirm at the carrier that the return reached you › Responses
The shipment after the operation
successRead the carrier's history now
Records every status the carrier reports that the shipment does not have yet; a status already recorded (by webhook or an earlier sync) is not recorded twice.
path Parameters
idResource ID
Resource ID
Read the carrier's history now › Responses
The shipment after the operation
successReport what happened
What the merchant saw. On a driver's shipment: the driver's progress (out_for_delivery, failed_attempt, delivered, returned) — needs orders:assign. On a carrier shipment only returned: the goods are back with the merchant (the carrier alone can say a parcel was delivered) — needs delivery:dispatch.
path Parameters
idResource ID
Resource ID
Report what happened › Request Body
statusA driver's progress; on a carrier shipment only returned (the goods are back with the merchant)
reasonWhy — a refusal, no answer…
occurredAtWhen it happened, if not now
Report what happened › Responses
The shipment after the operation
success