Sorting

Find available sort modes

You will find this information in the explorer under each endpoint. You will also find information under the meta index when you fetch data. The metadata will look something like this:

"sorting": {
    "current": {
        "name": "name",
        "direction": "asc"
    },
    "available": [
        "id",
        "name"
    ]
}

This is intended to help enable more generic functions for building sort functionality. Keep in mind that you will have to create the titles yourself.

Set sort

You set the sort by passing the sort and sort_direction parameters as part of the URL. See example below.

.../categories.json?sort=name&sort_direction=asc

If you omit sort_direction the default will be used and this will be returned under the “current” as shown above.