Sorting

As well as using queries to limit response data, you can also use the orderBy parameter to specify the order of records in the response.

Ascending Order

By default, results are returned in ascending order. For example, if you want to return a list of transactions in ascending order, oldest first, use the following syntax: {parameter}={value}. In this case, orderBy=date.

curl --location --request GET 'https://api.test.woodcoreapp.com/api/v1/clients?orderBy=date' \
--header 'Authorization: Bearer wc_test_5l0Fk28F2EUWiy01Vs9x7fEDWdYY8zqu9OE986m8LAU'

Descending Order

To return results in descending order you simply prepend a - negative sign to the parameter value. For example, to return the same list of transactions, this time with the newest transactions first, use the following syntax: orderBy=-date.

curl --location --request GET 'https://api.test.woodcoreapp.com/api/v1/clients?orderBy=-date' \
--header 'Authorization: Bearer wc_test_5l0Fk28F2EUWiy01Vs9x7fEDWdYY8zqu9OE986m8LAU'