Skip to main content

Ship Order

Records a shipment for some or all items of an order and updates the order status. You can send your own tracking details, or ask the store to generate a shipping label through its shipping integration.

HTTP Request​

  • URL: /orders/{id}/ship
  • Method: POST
  • Headers:
    • accessToken: Required. Your API access token.
    • Content-Type: application/json
  • Required scope: READ_WRITE_ORDER

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the order to ship.

Request Body​

The request body is a JSON object with a ShipOrder object.

FieldTypeRequiredDescription
ShipOrderObjectYesShipment details. See ShipOrder Object.
generateShipmentBooleanNotrue to generate a shipping label. Default is false. Not used when you send a tracking number or tracking URL.

ShipOrder Object​

FieldTypeRequiredDescription
itemsArrayYesItems to ship. See Item Object.
carrierStringNoCarrier code or name, for example ups. Defaults to the order's shipping method.
trackingNumberStringNoTracking number.
trackingUrlStringNoTracking page URL.
packageDetailObjectNoPackage details. See Package Detail Object.

Item Object​

FieldTypeRequiredDescription
idStringYesID of the order line item, or ID of the product.
variantIdStringNoVariant ID. Use it with a product ID when the product appears on more than one line.
quantityNumberYesQuantity to ship. Cannot be more than the quantity not yet shipped.

Package Detail Object​

FieldTypeRequiredDescription
packageCodeStringNoCarrier package code.
packageNameStringNoPackage name.
weightObjectNoPackage weight, for example { "value": 16, "unit": "ounce" }.
dimensionsObjectNoPackage size, for example { "length": 10, "width": 8, "height": 4, "unit": "inch" }.

cURL Example​

curl --location '<BASE_URL>/orders/664f2310d5775459152d6dd8/ship' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"ShipOrder": {
"items": [{ "id": "664f2310d5775459152d6ddb", "quantity": 6 }],
"carrier": "ups",
"trackingNumber": "1Z999AA10123456784",
"trackingUrl": "https://www.ups.com/track?tracknum=1Z999AA10123456784",
"packageDetail": {
"packageCode": "package",
"weight": { "value": 16, "unit": "ounce" },
"dimensions": { "length": 10, "width": 8, "height": 4, "unit": "inch" }
}
}
}'

Response​

  • 200 OK: The shipment was recorded.
  • 400 Bad Request: The access token is missing or invalid, the items are missing, a quantity is more than what is left to ship, or the shipping label could not be created.
  • 404 Not Found: No order exists with this ID.

Sample JSON Response​

{
"success": true,
"message": "Order shipped successfully",
"data": {
"_id": "664f2310d5775459152d6dd8",
"entityId": "ORD-1042",
"orderStatus": "partially fulfilled",
"lineItems": [
{
"_id": "664f2310d5775459152d6ddb",
"name": "Safety Glasses",
"sku": "SFTY-4006",
"quantity": 12,
"fulfilledQuantity": 6
}
],
"fulfilledItems": [
{
"_id": "665a1b2cd5775459152d7001",
"items": [
{
"lineItemId": "664f2310d5775459152d6ddb",
"quantity": 12,
"remainingQuantity": 6
}
],
"carrier": "ups",
"carrierName": "ups",
"trackingNumber": "1Z999AA10123456784",
"trackingUrl": "https://www.ups.com/track?tracknum=1Z999AA10123456784",
"labelId": null,
"labelDownloadUrl": null,
"packageDetail": {
"packageCode": "package",
"weight": { "value": 16, "unit": "ounce" },
"dimensions": { "length": 10, "width": 8, "height": 4, "unit": "inch" }
},
"fulfilledAt": "2024-05-24T15:20:00.000Z",
"voided": false
}
],
"payments": []
}
}

Response Details​

Order Data​

FieldTypeDescription
successBooleanWhether the shipment was recorded.
messageStringResult message.
dataObjectThe updated order. The new shipment is the last entry in fulfilledItems. See Get Order for shipment fields.

Notes​

  • After the shipment, the order status becomes fulfilled when every line is fully shipped, or partially fulfilled otherwise.
  • Shipping labels can be generated when the order's shipping method uses the store's custom shipping integration. The ship-from address comes from the warehouse or the store's origin address settings.
  • The customer receives a fulfillment email.
  • To cancel a shipment, use Void Shipment.