Requests, paging and filtering

Headers, response formats, paging with limit and page, filtering and sorting list endpoints.

Headers

HeaderRequiredValue
AcceptYesapplication/json (or text/xml / application/xml for XML)
Authorization or Api-KeyYesBearer <access token>, or the client secret. See Authentication.
Content-TypeFor POST and PUTapplication/json

Use GET to read, POST to create, PUT to update and DELETE to remove.

Paging

List endpoints return 10 items by default. Use limit (maximum 100) and page:

GET /api/rest/products?limit=20&page=2

Filtering and sorting

Many list endpoints accept filters and a sort order as query parameters. Each endpoint page lists the ones it supports.

GET /api/rest/sales2/orders?filters[increment_id][gt]=100000001&order[created_at]=ASC
  • filters[<field>][<operator>]=<value> filters by a field.
  • order[<field>]=ASC|DESC sorts the results.

Currency fields

On quotes, carts and orders, every base_ amount is in the store's default currency and is where calculations happen. The matching field without base_ is the amount in the entity's currency, converted from the base_ value. For example base_subtotal (store currency) and subtotal (order currency).