Pagination
Payscribe uses cursor-based pagination for list endpoints.
Page-based pagination
Most list endpoints accept page and per_page parameters.
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number to retrieve |
per_page | integer | 20 | Items per page (max: 100) |
GET /invoices/?page=2&per_page=50
Response meta:
{
"status": true,
"data": [],
"meta": {
"page": 2,
"per_page": 50,
"total": 156,
"page_count": 4
}
}
Cursor-based pagination
Some endpoints support cursor pagination for real-time data. The response includes next and previous cursors.
{
"status": true,
"data": [],
"meta": {
"next": "cursor_abc123",
"previous": null,
"perPage": 50
}
}
Pass the next cursor value as the page parameter to fetch the next set of results.
GET /transactions?page=cursor_abc123&per_page=50
Sorting
List endpoints may support sorting via sort_by and sort_order parameters.
| Parameter | Type | Example |
|---|---|---|
sort_by | string | created_at, amount |
sort_order | string | asc, desc |
GET /invoices/?sort_by=created_at&sort_order=desc
Was this page helpful?