• Pages
  • /
  • Dealers
  • /
  • Data Depot
  • /
  • Version 4
  • /
  • API
  • /
  • Helpers
  • /
  • Sorting


The sorting helpers allow you to control the arrangement of the response data in a prescribed sequence.

Arrange the API responses in the order that you wish to receive it by sending a sort parameter in your requests.

The parameter syntax structure is: ?sort[direction]=field.

Example requests

Sort by name ascending

Get a collection of Attributekeys sorted in alphabetical order by name.




Note that both these requests return the same result, sorted in the same way, because [asc] is the default behavior.

Sort by name descending

Get a collection of Attributekeys sorted in reverse-alphabetical order by name.


Sort a primary collection based on it's relation field

Get a collection of Products that are sorted based on it's child Items list_price.


Sorting includes

Include all the Items of a specific Product and sort those Items by list_price in descending order highest to lowest.


As with primary collections, if the sort direction is left off, we'll assume you want asc order.

You can also explicitly pass a direction by adding a pipe character (|) between the field and the direction.