Choose the Documentation MX Merchant MX Connect

Pagination

Control how many records are returned and navigate through large datasets efficiently.

Pagination allows you to control the number of records returned in a single API response and navigate through large datasets efficiently.

Banking APIs support multiple pagination controls when retrieving entity data.

📘

You can paginate results using either of the following approaches:

  • pageSize and pageNumber
  • limit and offset

Supported Pagination Parameters

ParameterTypeDescription
pageSizeIntegerNumber of records returned per page. Default is 1000. Maximum allowed value is 1000.
pageNumberIntegerPage number of the result set to retrieve. Default value is 1.
limitIntegerMaximum number of records returned in a response. Default is 100. Maximum allowed value is 100.
offsetStringIdentifier of the last record returned in the previous response. Used as the starting point for the next query.

Pagination Behavior

The pagination parameters follow specific precedence rules:

  • pageSize and pageNumber take precedence over other pagination parameters if provided.
  • limit acts as the only governing parameter if passed without pageSize or pageNumber.
  • If no pagination parameters are provided, the API automatically applies:
    • pageSize = 1000
    • pageNumber = 1

Using limit and offset

In addition to pageSize and pageNumber, you can also paginate results using limit and offset.

In this approach:

  • limit specifies the number of records to return in a response.
  • offset indicates the position from which the next set of results should start.

Typically, the offset value corresponds to the identifier of the last record returned in the previous response.

Examples:

GET /v1/accounts?limit=100

This request returns the first 100 records.

GET /v1/accounts?limit=100&offset=<last_record_id>

This request returns the next set of records starting after the specified offset.

This approach allows you to efficiently traverse large datasets by continuously passing the offset of the last retrieved record in subsequent requests.