Cancel Order
Cancel an existing order before the carrier collects it.
Endpoint
DELETE /orders/{id}
Description
Cancels the order and every shipment leg on it. A hub order's two legs are cancelled together.
An order can be cancelled while it is still in any of these statuses:
incompleteorder_receivedawaiting_additional_documentationawaiting_prepaymentawaiting_waybill_generationawaiting_schedule_pickupawaiting_pickupawaiting_swap_outpickup_missed
Once a shipment is in_transit or later, the API refuses the cancellation. Contact your account manager if a live shipment needs to be stopped.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | ID of an existing order |
Request Example
curl -X DELETE \
https://stream-orders-api-sandbox.herokuapp.com/client_api/v2/orders/123 \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"
Success Response (200 OK)
{
"success": true,
"error": "",
"errors": []
}
The order's status becomes cancelled on every leg.
Error Responses
422 Unprocessable Entity
The order has already gone live and can no longer be cancelled through the API.
{
"success": false,
"error": "Order cannot be cancelled, this shipment has already gone live",
"errors": []
}
404 Not Found
{
"success": false,
"error": "Couldn't find Order with 'id'=123",
"errors": []
}
401 Unauthorized
Access token is missing or invalid.
Important Notes
- Cancellation is final. To ship again, create a new order from a quote estimate.
- A cancelled order does not fire a
shipment.updated.statuswebhook; poll Get Orders if you need to confirm the new status. - If you cancelled because documents were missing, you can re-create the order with the files attached — see Uploading documents.