Pagination

The API uses cursor-based pagination. All list endpoints return data in reverse chronological order, and have the following common structure

Example using cursors

In this example, we request the page that starts after the cursor with id s4WycXedwhQrEFuM. As a result, we get a list of customers and can tell by the has_next attribute that we have more results to fetch. We can use the cursor_next attribute to fetch the next page.

Request Query Params

  • Name
    cursor
    Type
    string
    Description

    The cursor privided in the page you're currently on when you want to fetch the next page.

  • Name
    limit
    Type
    integer
    Description

    Limit the number of items returned. The default is 20 and the maximum is 100.

Response Body

  • Name
    data
    Type
    array<T>
    Description

    The list of items returned.

  • Name
    has_next
    Type
    boolean
    Description

    Indicates if there are more items to be fetched.

  • Name
    cursor_next
    Type
    string
    Description

    The cursor to be used to fetch the next page.

Paginated request

https://api.kernelpay.com/v1/customers?cursor_next=s4WycXedwhQrEFuM&limit=10

Paginated response

{
  "data": [
    {
      "id": "cus_WAz8eIbvDR60rouK",
      // ...
    },
    {
      "id": "cus_hSIhXBhNe8X1d8Et"
      // ...
    },
    {
      "id": "cus_fbwYwpi9C2ybt6Yb"
      // ...
    },
    // ...
  ],
  "has_next": true,
  "cursor_next": "jj324rwejbhvt61s"
}

Was this page helpful?