Skip to content

Pagination

Most top-level API resources have support for a list API method to enable bulk fetches. For instance you can list your Payment or Customer objects. These list API methods share a common structure.

The pagination is cursor based and if the results exceed the limit the API will return a next or prev attribute in the _links section. These can be used to continue with the results where prev will contain the previous entities and next will contain the next entities. You can also specify a limit by setting the limit query parameter.

All official clients support pagination.

Parameters


limit optional, default is 10

Determines the maximum number of objects returned. Minimum of 1 and a maximum of 100.


cursor optional

The cursor to use for pagination. To determine which cursor variable to use look in the _links section of the response. The prev will contain the previous results and next to next results.

Example response

json
{
  "type": "list",
  "data": [
    {
      "id": "PPH25H07JYWLR7PA82",
      "type": "payment",
      "amount": 1000,
      "description": "Test Payment",
      "currency": "EUR",
      "state": "paid",
      "refunded_amount": 0,
      "return_url": "https://example.com/thank-you",
      "cancel_url": "https://example.com/cancel",
      "paid_at": "2023-06-30T12:44:35Z",
      "created_at": "2023-06-30T12:40:10Z",
      "_links": {
        "self": "https://api.paypro.nl/payments/PPH25H07JYWLR7PA82"
      }
    },
    {},
    {}
  ],
  "count": 10,
  "_links": {
    "self": "https://api.paypro.nl/payments",
    "next": "https://api.paypro.nl/payments?cursor=bjpQUDM1QzZCS1BQU1I0UQ",
    "prev": "https://api.paypro.nl/payments?cursor=cDpQUE00MVZGUVlaU0RTMg"
  }
}