Void Shipment
Voids a shipment on an order. If the shipment has a shipping label, the label is cancelled with the carrier first.
HTTP Request
- URL:
/orders/shipments/void - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_ORDER
Request Body
The request body is a JSON object that identifies the order and the shipment.
| Field | Type | Required | Description |
|---|---|---|---|
orderId | String | Yes | ID of the order. |
id | String | Yes | ID of the shipment (the _id of an entry in fulfilledItems). |
labelId | String | No | Label to cancel. Defaults to the shipment's label. |
trackingNumber | String | No | Tracking number. Defaults to the shipment's tracking number. |
carrierCode | String | No | Carrier code. Defaults to the shipment's carrier. |
reason | String | No | Reason for voiding. Default is Voided by store. |
cURL Example
curl --location '<BASE_URL>/orders/shipments/void' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"orderId": "664f2310d5775459152d6dd8",
"id": "665a1b2cd5775459152d7001",
"reason": "Package re-routed"
}'
Response
- 200 OK: The shipment was voided.
- 400 Bad Request: The access token is missing or invalid, a required field is missing, the shipment has no label or tracking number, or the carrier could not void the label.
- 404 Not Found: The order or the shipment was not found.
Sample JSON Response
{
"success": true,
"message": "Shipment label voided successfully",
"data": {
"_id": "664f2310d5775459152d6dd8",
"entityId": "ORD-1042",
"orderStatus": "cancelled",
"lineItems": [
{
"_id": "664f2310d5775459152d6ddb",
"sku": "SFTY-4006",
"quantity": 12,
"fulfilledQuantity": 0
}
],
"fulfilledItems": [
{
"_id": "665a1b2cd5775459152d7001",
"carrier": "ups",
"trackingNumber": "1Z999AA10123456784",
"labelId": "se-140286551",
"voided": true
}
],
"payments": []
},
"voidResult": {
"success": true,
"voided": true,
"refunded": false,
"message": "Label voided"
}
}
Response Details
Void Data
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the shipment was voided. |
message | String | Result message. |
data | Object | The updated order. See Get Order. |
voidResult | Object | Result from the carrier. See Void Result Object. |
Void Result Object
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the void succeeded. |
voided | Boolean | Whether the carrier confirmed the label is cancelled. |
refunded | Boolean | Whether the carrier refunded the postage. |
message | String | Message from the carrier. |
raw | Object | Full response from the carrier. |
Notes
- The voided shipment stays in
fulfilledItemswithvoidedset totrue. - The shipped quantities of the shipment's lines are reduced.
- When every shipment on the order is voided, the order status becomes
cancelled. - A shipment without a label (only a tracking number) is voided in the store without contacting a carrier. In that case
voidResultonly containssuccess.