---
title: "Best Practice | New orderBy parameter for API sorting"
slug: "best-practice-new-standard-for-api-sorting"
updated: 2025-12-16T15:40:47Z
published: 2025-12-16T15:40:47Z
canonical: "developers.cmicglobal.com/best-practice-new-standard-for-api-sorting"
---

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

# Best Practice | New orderBy parameter for API sorting

## Introduction
Starting from Nexus 1, a new sorting query parameter will be available to simplify sorting behaviour and ensure consistent pagination results across CMiC APIs. When applied, this parameter automatically uses the default sort order defined in the underlying database view, eliminating the need to manually specify sort columns. 
```
orderBy=default
```
This parameter is compatible with all existing query features listed below and we recommend using it in combination with other filtering options to maintain a stable and well-performing integration:

* Finders
* Pagination (limit & offset)
* q parameter
* totalResults
* fields=parameter

:::(Info) (Example)
```
/hcm-rest-api/rest/1/pyemployee?finder=PyEmployeeFinder;EmpStatusVar=A&q=EmpCompCode='ZZ'&fields=EmpNo,EmpCompCode,EmpFirstName,EmpLastName,EmpEmailAddress,EmpStatusDesc,EmpStatus,EmpCellPhone,EmpLastUpdDate,EmpVUuid&limit=200&orderBy=default
```
:::

:::(Warning) (Note)

orderBy=default **cannot** be used for explicit sorting.

For example, 
```
orderBy=default&orderBy=ColumnName:asc
```
:::

### Currently supported APIs

We will continue rolling out orderBy=default support across all CMiC API views to simplify integration patterns, improve consistency, and reduce pagination-related issues.

The following APIs are supported now:

#### Accounts Payable:
```
ap-rest-api/rest/1/apallvoucher
```
```
ap-rest-api/rest/1/apvendor
```
#### Accounts Receivable:
```
ar-rest-api/rest/1/arcustomer
```
```
ar-rest-api/rest/1/arinvoice
```
#### System:
```
sys-rest-api/rest/1/businesspartner
```
#### Inventory:

```
ci-rest-api/rest/1/ciitem
```
#### Potential Change Items (PCI)
```
cm-rest-api/rest/1/cmdetail
```
```
cm-rest-api/rest/1/cmmast
```
#### Human Capital Management (HCM)
```
hcm-rest-api/rest/1/employees
```
```
hcm-rest-api/rest/1/pyetimesheet
```
#### Job Cost
```
jc-rest-api/rest/1/jcdetailposted
```
```
jc-rest-api/rest/1/jcjob
```
```
jc-rest-api/rest/1/jcjobcategory
```
#### Project Management
```
pm-rest-api/rest/1/pmproject
```
#### Subcontract
```
pm-rest-api/rest/1/scmast
```
```
pm-rest-api/rest/1/scsched
```
#### Purchase Order
```
po-rest-api/rest/1/podetail
```
```
po-rest-api/rest/1/pomaster
```
#### General Ledger
```
gl-rest-api/rest/1/rtiledgerwithyearperiod
```
```
glrestapi/rest/v1/glperactivitylog
```

### Continued Support for Manual Sorting
Users can continue to use manual sorting for APIs not yet supported, provided that the API has been properly indexed. 

:::(Info) (Example)
```
orderBy=ColumnName:asc
orderBy=ColumnName:desc
```
:::
If any deviation is encountered, please reach out to CMiC Support.
