1. U4 ERPx
  2. API Reference
  3. ObjectAPI
  4. Sorting

Sorting

Defining the order in which Enterprise Documents are returned

The orderBy query parameter can be used to define the order in which Enterprise Documents are returned. If this query parameter is not used, the key properties will be used for determining the order.

Properties are referenced in the same way as in filtering, where nested properties are accessed with the path separator /. Each property can optionally be followed by a space and the ASC (ascending) or DESC (descending) operator. Multiple properties are comma-separated. See an example below:

&orderBy=lastUpdated/updatedAt DESC, customerName ASC

Examples

Single property sorting:

&orderBy=customerName

Multiple property sorting:

&orderBy=countryCode ASC, customerName DESC

Nested property sorting:

&orderBy=invoice/creditLimit DESC, customerId ASC

Default behavior

When no orderBy parameter is specified, the API will sort results using the key properties of the Enterprise Document in ascending order.