Getting Orders
Getting Multiple Orders
This endpoint enables you to get all orders, or to select a subset of orders using the various filtering parameters:
GET /merchants/{merchant_id}/orders
Except for merchant_id
, all query parameters are optional.
Get all Orders for a Merchant
This httpie call gets all orders for one Merchant ID:
http \
https://api-sandbox.merchants.zalando.com\
/merchants/{merchant_ID}/orders \
Accept:application/vnd.api+json \
"Authorization:Bearer $YOUR_ACCESS_TOKEN"
This call may return a large number of orders, so it can be helpful to add request filters.
Filtering
You may limit your return results with the following filters (please use appropriate URL encoding where required):
created_after
created_before
last_updated_after
last_updated_before
order_status
order_number
order_type
sales_channel_id
locale
exported
For example, to get only unexported orders with the status of approved
:
GET merchants/{merchant_ID}/orders?order_status=approved&exported=false
With httpie:
http \
https://api-sandbox.merchants.zalando.com\
merchants/{merchant_ID}/orders \
order_status=approved&exported=false \
Accept:application/vnd.api+json \
"Authorization:Bearer $YOUR_ACCESS_TOKEN"
Note
The temporal filters last_updated_after
, last_updated_before
, created_after
and created_before
use exclusive conditions. For example, if you use last_updated_after= 2019-07-01T06:55:47Z
the query will return all orders where modified_at > 2019-07-01T06:55:47Z
. Please consider this when fetching orders with temporal filters to avoid losing new orders/order updates.
Sorting
Sort Attributes
Returned orders can be sorted by the following attributes:
order_number
modified_at
order_lines_price_amount
order_lines_count
order_date
Attributes and values are separated by =
, and multiple values are separated with a comma (,
).
Sort Order
By default, sort order is ascending for all the attributes. To change sort order to descending, add a minus sign (-
) before the sorting attribute.
Example
The example below gets all unexported orders for a merchant and sorts the returned orders by order_date
in descending order. That is, the latest orders are returned first.
http \
https://api-sandbox.merchants.zalando.com\
/merchants/{merchant_ID}/orders \
exported=false \
sort=-order_date \
Accept:application/vnd.api+json \
"Authorization:Bearer $YOUR_ACCESS_TOKEN"
Default sort
If a sorting attribute is not provided, the default attribute is modified_at
and the order is descending. That is the orders modified or created recently are returned first.
Additional Parameters
include
Description | This parameter gets additional order data beyond the default Order tier data, such as Order Item and Order Line data. Multiple values must be comma separated. |
---|---|
Type | String |
Possible values | orders order_items order_lines order_transitions order_lines.order_line_transitions order_items.order_lines order_items.order_lines.order_line_transitions |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders include=order_items,order_lines Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
page[size]
Description | Number of orders returned in a single page. |
---|---|
Type | Integer |
Default | 50 |
Possible values | 1..1000 |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders page[size]=10 Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
page[number]
Description | Which page number to return (uses zero-based counting). |
---|---|
Type | Integer |
Default | 0 |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders page[number]=2 Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
sort
Description | Sorting attributes separated by a comma. Default order is ascending. Minus(-) should be used in front of an attribute name if you want descending order. |
---|---|
Type | String |
Default | -modified_at |
Possible values | All possible order attributes |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders sort=order_number Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
created_after
Description | All the orders created after a given timestamp (exclusive). The timestamp is in the ISO 8601 format. The Date and time are separated by the "T" literal, and the Time and Timezone are separated by the "+" literal. For UTC time, you should simply use "Z" as the suffix, for other cases use URL encoding for the "+" literal. e.g., "2019-07-01T06:55:47Z" for UTC "2017-01-01T09:11:48%2B01:00" for +01:00 timezone. |
---|---|
Type | Date-time |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders created_after=2017-01-01T09:11:48Z Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
created_before
Description | All the orders created before a given timestamp (exclusive). The timestamp is in the ISO 8601 format. The Date and time are separated by the "T" literal, and the Time and Timezone are separated by the "+" literal. For UTC time, you should simply use "Z" as the suffix, for other cases use URL encoding for the "+" literal. e.g., "2019-07-01T06:55:47Z" for UTC "2017-01-01T09:11:48%2B01:00" for +01:00 timezone. |
---|---|
Type | Date-time |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders created_before=2017-01-01T09:11:48Z Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
last_updated_after
Description | All the orders updated after a given timestamp (exclusive). The timestamp is in the ISO 8601 format. The Date and time are separated by the "T" literal, and the Time and Timezone are separated by the "+" literal. For UTC time, you should simply use "Z" as the suffix, for other cases use URL encoding for the "+" literal. e.g., "2019-07-01T06:55:47Z" for UTC "2017-01-01T09:11:48%2B01:00" for +01:00 timezone. |
---|---|
Type | Date-time |
Possible values | |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders last_updated_after=2017-01-01T09:11:48Z Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
last_updated_before
Description | All the orders updated before a given timestamp (exclusive). The timestamp is in the ISO 8601 format. The Date and time are separated by the "T" literal, and the Time and Timezone are separated by the "+" literal. For UTC time, you should simply use "Z" as the suffix, for other cases use URL encoding for the "+" literal. e.g., "2019-07-01T06:55:47Z" for UTC "2017-01-01T09:11:48%2B01:00" for +01:00 timezone. |
---|---|
Type | Date-time |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders last_updated_before=2017-01-01T09:11:48%2B01:00 Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
order_status
Description | All the orders that have a specific status. |
---|---|
Type | String |
Possible values | Initial, Approved, Fulfilled |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders order_status=Initial Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
order_type
Description | All the orders that have a specific type. |
---|---|
Type | String |
Possible values | ZalandoFulfilled, PartnerFulfilled |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders order_type=PartnerFulfilled Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
sales_channel_id
For a list of sales channel codes, see the Products FAQ.
Description | All the orders sold in a given sales channel. |
---|---|
Type | String (UUID) |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders sales_channel_id=bf48ba35-149d-4b76-8ac9-d08d126b517f Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
locale
Following is a list of possible locales:
Country | Locale |
---|---|
Austria | de-AT |
Belgium | nl-BE, fr-BE |
Croatia | hr-HR |
Czech Republic | cs-CZ |
Denmark | da-DK |
Estonia | et-EE |
Finland | fi-FI |
France | fr-FR |
Germany | de-DE |
Hungary | hu-HU |
Italy | it-IT |
Latvia | lv-LV |
Lithuania | lt-LT |
Netherlands | nl-NL |
Norway | no-NO |
Poland | pl-PL |
Republic of Ireland | en-IE |
Romania | ro-RO |
Slovakia | sk-SK |
Slovenia | sl-SI |
Spain | es-ES |
Sweden | sv-SE |
Switzerland | fr-CH, de-CH |
United Kingdom | en-GB |
Description | All the orders having a given locale (BCP-47). |
---|---|
Type | String |
Possible values | BCP-47 compliant values |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders locale=de-DE Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
exported
Description | All the orders (non-ZFS only) already exported (true) or not (false). |
---|---|
Type | Boolean |
Possible values | true, false |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders exported=true Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
order_number
Description | All the orders with a given Zalando order number. |
---|---|
Type | String |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders order_number={order_number} Accept:application/vnd.api+json "Authorization:Bearer $YOUR_ACCESS_TOKEN" |
Getting a Specific Order
This endpoint enables you to obtain a specific order:
GET /merchants/{merchant_id}/orders/{order_id}
Example
This httpie call returns an order with the specified Merchant ID and Order ID:
http \
https://api-sandbox.merchants.zalando.com\
/merchants/{merchant_id}/orders/{order_id} \
Accept:application/vnd.api+json \
"Authorization:Bearer $YOUR_ACCESS_TOKEN"
Query parameters
All the query parameters are optional.
include
Description | This parameter gets additional order data beyond the default Order tier data, such as Order Item and Order Line data. Multiple values must be comma separated. |
---|---|
Type | String |
Possible values | orders order_items order_lines order_transitions order_lines.order_line_transitions order_items.order_lines order_items.order_lines.order_line_transitions |
Example | http https://api-sandbox.merchants.zalando.com/merchants/{merchant_ID}/orders/{order_ID} include=order_items,order_lines Accept:application/vnd.api+json Authorization:Bearer $YOUR_ACCESS_TOKEN |
Additional Resources
- Getting Orders in our Developer Guide.