Pagination

In Pay.io APIs pagination functionality is provided with cursor pagination.

Cursor pagination is a method of paginating through large result sets using encoded cursors rather than page numbers. It is more efficient than traditional offset-based pagination, particularly for datasets that are frequently updated or high in volume.


Request Format

The following fields are supported in the request body:

Field
Type
Description

after

string (optional)

The Cursor to paginate after (for forward pagination).

before

string (optional)

The Cursor to paginate before (for backward pagination).

first

integer (optional)

Number of transactions to return.

last

integer (optional)

Return the last N transactions (backward pagination).

Example Request

Asking to return the first 10 transactions, after the fifth and before the 20th transaction.

{
  "after": "5", 
  "before": "20", 
  "first": 10
}

Response Format

The response is given in a page_info object, containing the following parameters:

Field
Type
Description

end_cursor

string

The cursor for the last item in the page.

has_next_page

boolean, required

Indicator, if more results are available.

has_previous_page

boolean, required

Indicator, if previous results are available.

start_cursor

string

The cursor for the first item on this page.

Use next_cursor or previous_cursor in subsequent requests to navigate through the dataset.

Example response structure

  "page_info": {
    "end_cursor": "dxM1QxNDowODoxNXwyMWFmYTc3OS1kMmYzLTQ1NGYtYTI3ZS0xOGUyM2MzZWQzMDA=",
    "has_next_page": false,
    "has_previous_page": false,
    "start_cursor": "dHJhbmY1MTFkYi00YWRlLTQwMWQtYTQ5YS1iMDhlOTJiOWYyM2Y="
  },
  "total_count": 4,

Last updated