Skip to main content

Sorting

Most properties are sortable, but not all are. Sortable properties are marked in the API documentation.

note

The v10 list endpoints only support a small set of sort keys, so every sort can be paginated with a cursor. All list endpoints support id (the default); orders and invoices additionally support updated_at, and shipments additionally support created_at. Other sort keys are rejected with a validation error.

To add sorting to a sortable endpoint simply add sort to the querystring. The syntax to use is

[{key: 'item_number', direction: 'ASC'}, {key: 'name', direction: 'DESC'}]

This will sort by item_number in ascending direction first, and then name in descending direction next.