Skip to main content
xPay API utilizes cursor based pagination to efficiently handle large datasets. All list API methods share a common structure and accept pagination parameters to facilitate navigation through results.

Understanding Cursor-Based Pagination

Cursor based pagination utilizes a special token (called an offset) that functions as a bookmark, instructing the API precisely where to resume fetching data from. This approach is efficient for large datasets because it eliminates the necessity for the API to count total results.

Implementation Steps

  1. Initial request: Omit offset parameter
  2. Continue: For each subsequent request, supply the exact offset value received in the previous response’s metadata.offset field. Do not alter, generate, or reuse old offsets.
  3. Complete: Terminate when metadata.offset is absent or null
Modifying query parameters: Changing any query parameters (such as filters or sorting) invalidates current offsets, restart pagination from the beginning if you change them.
Too many requests: Excessive paginated requests within a short period may result in rate limiting.

Parameters

limit
number
Specifies the number of objects to return, ranging between 1 and 100. Default varies by endpoint.
offset
string
An opaque string that defines your position in the list.
Critical: Utilize the exact offset value from the previous response’s metadata.offset field. Do not modify, decode, or generate your own offset values.

Response Format

All paginated endpoints return responses in this format:
data
array
required
Array of response elements containing the actual data objects
metadata
object
required
Metadata object containing pagination information
I