Orders
List orders
Returns the orders on the channels of merchants connected to the current service provider that match the query, with their items, customer and tags. When a merchant is selected, only that merchant's channels are included. The list is not paginated: a request that matches more than 10,000 orders is rejected with a 422 whose `errors.filters` message is `Too many orders match this request. Please narrow the filters (e.g. status or fulfillable) and try again.` A query value that fails validation is also rejected with a 422. A 403 is returned when the user may not view orders, or when the merchant's orders are disabled and the user may not view disabled merchants' orders.
Optional attributes
- Name
fulfillable- Type
- integer
- Description
- `1` returns only orders with a fulfillment request that has not been rejected. `0`, or leaving it out, applies no fulfillability filter. Only `1` and `0` are accepted: `true` and `false` are rejected with a 422.
- Name
filters- Type
- object
- Description
- Exact-match filters, sent as `filters[status]=pending` or `filters[pack_assigned_to]=12`. When both are given, an order must match both. Other keys under `filters` are accepted and ignored.
Request
curl -G https://YOUR_DOMAIN/api/orders \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"Upload orders
Imports orders, usually mapped spreadsheet rows, into one of the merchant's channels. Each order creates a customer (or reuses the channel's customer with the same email), an address used as its default, billing and shipping address (or updates the customer's address with the same city, state/province, country and postal code), and a pending order whose lines create any missing items and channel listings. A filled `channel_id` is looked up first: a channel that does not exist, was deleted or belongs to another merchant returns a 404 before any permission check. Then the caller needs permission to create the merchant's orders (and, while the merchant's orders are disabled, to work with disabled merchants' orders), and the service provider needs the Orders entitlement; otherwise it gets a 403 before the body is validated. Without a `channel_id` the 403 comes before the 422 for the missing field. The body is checked in two passes. Field validation runs first. Only when every field passes are the address (required fields, state/province codes and postal code format of the country), unknown SKUs without a `title` and existing order references checked; their errors are reported together in one 422. Nothing is imported when either pass fails. Once validated, every order is imported, including into an existing deleted order or an order uploaded earlier in the same body when the `order_id` matches, and the response does not return them. The import runs without a transaction, so an unexpected error (a 500) keeps the orders imported before it, and the order it failed on may be left without its lines. Known inputs that fail this way are a `channel_id` that is a non-numeric string or a decimal, a quantity above 2147483647, a new SKU longer than 255 characters, and shapes the schema does not allow, such as an array `order_id` or a string `items`.
Required attributes
- Name
channel_id- Type
- string
- Description
- The ID of one of the merchant's channels to import the orders into. A numeric string is accepted. A channel that does not exist, was deleted or belongs to another merchant returns a 404, and a non-numeric string or a decimal fails the request with a 500, even for callers without permission. Null, an empty string or leaving it out is rejected with a 422. 12
- Name
orders- Type
- string
- Description
- The orders to import. An object keyed by order works like an array of its values: the keys are dropped, so error paths use each order's position, e.g. `orders.1.city` for the second order.
Request
curl -X POST https://YOUR_DOMAIN/api/orders/upload \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"channel_id": 12
}'Get an order
Returns one order on a channel of a merchant connected to the current service provider and fulfilled from one of its warehouses, with the order's channel, items, customer, shipping address, packages, attachments and tracking numbers, and its fulfillment request. When a merchant is selected, only that merchant's orders are returned. A 404 is returned when there is no such order, including a deleted order, an order on a deleted channel and another account's order. A 403 is returned when the user may not view orders, when the merchant's orders are disabled and the user may not view disabled merchants' orders, or when the service provider does not have the Orders entitlement.
Required attributes
- Name
order- Type
- integer
- Description
- The ID of the order 1
Request
curl -G https://YOUR_DOMAIN/api/orders/{order} \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"Upload a shipping label for an order
Stores the uploaded file as an attachment named `Shipping Label (Manually Uploaded)` on the order. The file must be a PDF, AVIF, JPEG, PNG, WebP or BMP, judged by its content. A 422 is returned when no file is sent or the file is not one of those types. A 403 is returned when the user may not update orders, when the service provider does not have the Orders entitlement, or when the merchant's orders are disabled and the user may not view disabled merchants' orders. A 404 is returned when the order does not exist, or is not on a channel and in a warehouse of the current service provider (and, when a merchant is selected, on that merchant's channel).
Required attributes
- Name
order- Type
- integer
- Description
- The ID of the order 1
Request
curl -X POST https://YOUR_DOMAIN/api/orders/{order}/uploadShippingLabel \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"Mark an order as shipped
Marks the order as shipped. A package holding every order item at its full quantity is created and linked to the order's fulfillment request, which the server finds itself. When `tracking_number` is sent, it is stored against the order and the new package with the given carrier. For Purolator and the UK and German carriers (`purolator`, `royal_mail`, `parcel_force`, `dpd_uk`, `dhl_uk`, `evri`, `dhl_paket_de`, `dpd_de`, `gls_de`, `hermes_de`), the tracking number is also registered with a tracking provider during the request. When the tracking provider is rate limiting, registration is retried in the background instead. For `ups`, the request may fetch a UPS access token, but the tracking number is not registered. The order status then becomes `shipped`. The body is optional. Send no body, or omit `carrier`, to mark the order as shipped without tracking. A 422 is returned when the body fails validation, when the order is already shipped or delivered, when the order has no fulfillment request, or when `other` is the carrier of an Amazon order. These checks run together, so one response can report several of them. A 403 is returned when the user may not update orders, when the service provider does not have the Orders entitlement, or when the merchant's orders are disabled and the user may not view disabled merchants' orders. A 404 is returned when the order does not exist, or is not on a channel and in a warehouse of the current service provider (and, when a merchant is selected, on that merchant's channel).
Required attributes
- Name
order- Type
- integer
- Description
- The ID of the order 1
Optional attributes
- Name
carrier- Type
- string
- Description
- The carrier of the tracking number. When sent, `tracking_number` is required. It cannot be `null`: omit it to ship without tracking. Send it whenever `tracking_number` is sent, because a tracking number without a carrier currently fails with a 500. `other` is rejected for Amazon orders. usps
- Name
tracking_number- Type
- string
- Description
- The tracking number for the shipment. Required when `carrier` is sent. 9400111899223197428490
Request
curl -X POST https://YOUR_DOMAIN/api/orders/{order}/markAsShipped \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"carrier": "usps",
"tracking_number": "9400111899223197428490"
}'