PayNowPro

Pagination

Understand cursor-based pagination in PayNowPro API for efficiently browsing large datasets with limit, cursor, and order parameters.

All top-level API resources that return a list of objects, such as GET /customers or GET /products, are paginated. Pagination helps you manage large sets of data by returning them in smaller, more manageable chunks.

PayNowPro uses cursor-based pagination, which is a highly efficient method for browsing large datasets.

Query Parameters

You can control pagination for list endpoints using the following query parameters.

  • limit integer Controls the maximum number of items returned in a single response.

    • Default: 10
    • Maximum: 100
  • cursor string The pagination cursor used to fetch the next page of results. The cursor is an opaque, base64 encoded string that points to the next item in the dataset. You should not attempt to construct or interpret this string yourself.

  • order string Determines the sort order of the results.

    • Values: asc for ascending, desc for descending.
    • Default: desc (newest items first).

How It Works: An Example

Let's walk through an example of fetching a list of customers, two at a time.

1. The Initial Request

To get the first page of results, you make a request to the list endpoint. You can optionally include a limit.

curl "https://api.paynowpro.com/api/v1/customers?limit=2&tenantAlias=YOUR_TENANT_ALIAS" \
  -H "api-key: YOUR_API_KEY"

2. The First Response

The API will return a list of customers in the data array. If there are more customers to fetch, the response will also include a nextCursor field.

{
  "data": [
    {
      "id": "cust_abc123",
      "firstName": "John",
      "createdAt": "2025-10-10T12:00:00.000Z"
    },
    {
      "id": "cust_def456",
      "firstName": "Jane",
      "createdAt": "2025-10-09T11:00:00.000Z"
    }
  ],
  "nextCursor": "eyJsYXN0S2V5Ijp7InBrIjoiVEVOQU5UI0...="
}

3. Fetching the Next Page

To fetch the next page, take the value from the nextCursor field and use it as the cursor parameter in your next request.

curl "https://api.paynowpro.com/api/v1/customers?limit=2&cursor=eyJsYXN0S2V5Ijp7InBrIjoiVEVOQU5UI0...%3D&tenantAlias=YOUR_TENANT_ALIAS" \
  -H "api-key: YOUR_API_KEY"

Note: Remember to URL-encode the cursor string when using it in a URL.

4. The Final page

You continue this process until you receive a response where the nextCursor field is null. This indicates that you have reached the end of the list and there are no more pages to fetch.

{
  "data": [
    {
      "id": "cust_xyz789",
      "firstName": "Peter",
      "createdAt": "2025-10-08T10:00:00.000Z"
    }
  ],
  "nextCursor": null
}

On this page