Skip to main content

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.

FieldTypeRequiredDescription
orderIdStringYesID of the order.
idStringYesID of the shipment (the _id of an entry in fulfilledItems).
labelIdStringNoLabel to cancel. Defaults to the shipment's label.
trackingNumberStringNoTracking number. Defaults to the shipment's tracking number.
carrierCodeStringNoCarrier code. Defaults to the shipment's carrier.
reasonStringNoReason 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​

FieldTypeDescription
successBooleanWhether the shipment was voided.
messageStringResult message.
dataObjectThe updated order. See Get Order.
voidResultObjectResult from the carrier. See Void Result Object.

Void Result Object​

FieldTypeDescription
successBooleanWhether the void succeeded.
voidedBooleanWhether the carrier confirmed the label is cancelled.
refundedBooleanWhether the carrier refunded the postage.
messageStringMessage from the carrier.
rawObjectFull response from the carrier.

Notes​

  • The voided shipment stays in fulfilledItems with voided set to true.
  • 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 voidResult only contains success.