Preparing and Shipping Orders

Once you have exported an order, you may prepare and ship each Order Line article. If you cannot fulfill any item, update its status to canceled.

You can parse the order however you wish, but we recommend requesting order_lines data when you get the order, as described in the Getting a Specific Order with Additional Details section of "Getting Orders."

Preparing and shipping the order has the following steps:

  1. Prepare each Order Line article for shipping (does not require API).
  2. For any items that you cannot fulfill, update the Order Line status with canceled.
  3. Update the Order with tracking information.
  4. Ship items (does not require API).
  5. Update each shipped item's Order Line status with shipped.

Warning

Make sure to UPDATE tracking information i.e. tracking_number and return_tracking_number BEFORE you ship items. If you place calls to update tracking information and Order Line status close together (within 5 seconds), they may be processed out-of-sequence, which can cause difficulties. Hence recommended delay is 5 seconds.

Note

Tracking information works at order level and should only be updated once for the whole order, in case of multiple updates the first one will be picked.

Providing Tracking Information

You must update each order with a tracking number and a return tracking number. To do so, create a JSON payload similar to the following example and provide values for tracking_number and return_tracking_number.

{
  "data":{
    "type":"Order",
    "id":"$YOUR_ORDER_ID",
    "attributes":{
      "tracking_number":"$YOUR_TRACKING_NUMBER",
      "return_tracking_number":"$YOUR_RETURN_TRACKING_NUMBER"
    }
  }
}

Use the following call to PATCH the order:

PATCH merchants/{merchant_ID}/orders/{order_ID}

This httpie call takes the local file provide-tracking-information.json as input for the PATCH request:

http PATCH \
https://api-sandbox.merchants.zalando.com\
/merchants/{merchant_ID}/orders/{order_ID} \
Accept:application/vnd.api+json \
Content-Type:application/vnd.api+json \
"Authorization:Bearer $YOUR_ACCESS_TOKEN" \
< provide-tracking-information.json

Updating Order Line Status to Shipped or Canceled

To set the status of an Order Line to shipped, create a JSON payload similar to this example:

{
  "data":{
    "id":"$ORDER_LINE_ID",
    "type":"OrderLine",
    "attributes":{
      "status":"shipped"
    }
  }
}

To set the status of an Order Line to canceled, create a JSON payload similar to this example. When an Order Line is canceled, the customer is notified and the appropriate portion of their purchase payment is refunded.

{
  "data":{
    "id":"$ORDER_LINE_ID",
    "type":"OrderLine",
    "attributes":{
      "status":"canceled"
    }
  }
}

Use the following request to update the specified Order Line:

PATCH /merchants/{merchant_ID}/orders/{order_ID}/items/{order_item_ID}/lines/{order_line_ID}

This example httpie call takes the local file order-line-updated.json as input for the PATCH request:

http PATCH \
https://api-sandbox.merchants.zalando.com\
/merchants/{merchant_ID}/orders/{order_ID}\
/items/{order_item_ID}/lines/{order_line_ID} \
Accept:application/vnd.api+json \
Content-Type:application/vnd.api+json \
"Authorization:Bearer $YOUR_ACCESS_TOKEN" \
< order-line-updated.json

Updating Order Status to Fulfilled

We handle this step for you. When you set the status for all Order Lines to shipped or canceled, we set the order status to fulfilled.

Response Codes

HTTP Code Description
204 Order was successfully patched.
400 Error in JSON payload.
403 You do not have authority to patch this order.

For a full list of response codes, see the Orders API OpenAPI Reference.

Contact Support