The orderBy parameter specifies the sorting criteria for customer fields.
Only numeric and date fields can be used for sorting. String fields will be ignored.
Format: field:direction
Directions:
asc (ascending)
desc (descending)
Examples:
age:asc → Sorts customers by the age field in ascending order.
payment_date:desc → Sorts customers by payment_date in descending order.
Multiple sorting criteria can be applied by using multiple orderBy query parameters.
The maximum number of sorting parameters allowed is 3.
Important: The order of orderBy parameters in the query string determines the priority of sorting.
Parameters appearing first take precedence over later ones.
Note: Ensure that URI components are properly encoded. Examples:
age:asc → age%3Aasc
payment_date:desc → payment_date%3Adesc
Null Handling: For the fields used in the orderBy parameter, if a field contains null values, those customers will always appear at the end of the list, regardless of the sorting direction.
Date fields must be in ISO 8601 format. Example: 2021-10-22T10:46:23.897Z