> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sorting Syntax

When querying collections, the default sort order will typically be by `id` in descending order. However, you can choose
a different sort order by specifying the `sort` query parameter with one of the field names listed in the endpoint
description. You may specify a secondary sort order by specifying the `sort` value as a comma-separated list of the
field names to use for sorting.

Field names prefixed with `-` will be sorted in **descending** order by the given field, otherwise the result will be
sorted in **ascending** order by the given field.

**Example:**

To sort first by `priority` in descending order and then by `name` in ascending order:

```http Request Query theme={null}
?sort=-priority,name
```

<Note>
  The paging cursor parameters (`cursor_start` and `cursor_end`) are designed to provide consistent results and response
  times and so they only support sorting by either `id` (ascending) or `-id` (descending).
</Note>

```http Request Query theme={null}
?sort=id&cursor_start=38712
```

<Note>
  #### Paging

  See [paging parameters](/global-api/paging-parameters) for more information on paging large result sets.
</Note>
