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 and optionally include information about which logistic center the item was shipped from.

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.

Failing to set the tracking numbers will lower visibility and so influence your CXM KPIs in a negative way.

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

Note: Orders with multiple shipments

It is not possible to attach more than one set of tracking information to an order, even in cases where multiple shipments are used, because tracking information is attached to the entire order and not individual items.

If multiple updates are received, only the first one will be attached to the order and the other updates will be ignored.

Updating Order Line Status to Shipped or Canceled

When you set the status to shipped, you can also include the ID of the logistic center where the Order Line was shipped from. To do this, create a JSON payload similar to this example:

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

Setting the Outbound Logistic Center ID

The Outbound Logistic Center ID must belong to a warehouse that is already configured in zDirect.

We strongly encourage you to send the Outbound Logistic Center ID if you have multiple outbound warehouses configured in zDirect. If you have a single outbound warehouse, sending the logistic center ID is optional.

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