Pagination

Our API uses cursor-based pagination to help you handle responses that contain large datasets, for example, when you view a list of payments. If your request returns a large number of results, we limit the number of results that we send back to you in the response. We also include links that you can use to navigate through the results.

How to use pagination to navigate your results

You don't need to include any query parameters in your initial GET request. However, you can use the limit parameter to restrict the number of results that we return. By default, we return a maximum of ten results in each response. After you send a successful GET request to our API, we return a response that includes an array of data objects and an array of links objects. The data objects contain your results, and the links objects contain HATEOAS links that you can use to retrieve your other results. Each links object contains the following fields:
  • rel - The relationship of the linked URI to the current resource. For pagination, the value is either next or previous.
  • method - The method that you use to navigate to the next page or previous page.
  • href - The URI for the next page or previous page. Send your request to this endpoint.
The following diagram shows how you navigate between pages of results:

Example

If you want to view a list of processing accounts that are linked to a merchant platform, send a GET request to our List merchant platforms endpoint: https://api.payroc.com/v1/merchant-platforms/12346/processing-accounts We return the processing accounts in the array of data objects. To navigate to the next page of results, send a GET request to the endpoint in the href parameter.
{
"limit" : "10",
"count" : "100",
"has_more": true,
"links": [
{
"rel": "next",
"method": "GET",
"href": "https://api.payroc.com/v1/merchant-platforms/12346/processing-accounts?after=12346&limit=10"
},
]
"data" : [array of objects]
}