Pagination, Sorting, and Filtering

In Lidia APIs, pagination, sorting, and filtering fields can be used in listing, search, and query endpoints to control the amount of data returned, retrieve results in a specific order, and fetch only the records that are needed.

These fields may vary by endpoint. The request fields supported by each endpoint, required parameters, and sample usage are provided on the relevant API Reference page.

Pagination

Pagination is used to retrieve large datasets page by page instead of fetching them all at once. This approach helps control the response size and process data more manageably on the integration side.

In supported endpoints, pageIndex specifies the page to be retrieved, while pageSize specifies the number of records returned on a page. In the Search endpoint, the pageIndex field is defined as a zero-based page number, and the pageSize field is defined as the number of records per page.

pageIndex and pageSize parameters

Sorting

Sorting allows the records returned in the response to be ordered by a specific field. In supported endpoints, the sorting field can be used.

In the Search endpoint, the sorting field allows results to be returned according to the sorting expression. The sorting format and the fields that can be sorted may vary by endpoint. Therefore, the format to be used should be checked on the API Reference page of the relevant endpoint.

sorting parameter

Filtering

Filtering is used to query records that match specific criteria. Filter fields vary depending on the data model managed by the endpoint. For example, product listing, category query, brand search, or general search endpoints may have different filter fields.

Sample Search Request

curl --request POST \
  --url https://{pim-api-url}/api/v1/search \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{
    "clientId": "{clientId}",
    "appKey": "{appKey}",
    "searchKey": "seramik",
    "entityTypes": ["Product", "Category"],
    "pageIndex": 0,
    "pageSize": 25,
    "sorting": "{field} asc",
    "status": ["Active"]
  }'
Usage note: Pagination, sorting, and filtering parameters do not have to be the same across all endpoints. This section explains the general approach; the relevant API Reference page should be checked for endpoint-based required and optional fields.


Did this page help you?