The majority of list resources in the API are paginated to allow clients to traverse data over multiple requests while maintaining good performance for UX.
Responses are likely to contain a pages object that hosts pagination links which a client can use to paginate through the data without having to construct a query.
Parameter | Description |
---|---|
page_num | The page you want to navigate to |
page_size | The total number of objects you want in response |
{{BASE_URL}}/balances?page_num=1&page_size=40
{
"message": "Here are your balances.",
"meta": {
"total": 1,
"per_page": 40,
"current_page": 1,
"last_page": 1,
"first_page": 1,
"first_page_url": "?page_num=1",
"last_page_url": "?page_num=1",
"next_page_url": null,
"previous_page_url": null
},
"balances": [
{
"created_at": "2021-07-30 23:20:22",
"updated_at": "2021-07-30 23:20:22",
"id": "bal_13dae6b74653",
"timezone": "UTC",
"livemode": true,
"customer_id": "cus_69c6c28ce9",
"name": null,
"description": null,
"available_amount": 0,
"pending_amount": 0,
"currency": "USD",
"active": true,
"metadata": {}
},
{},
{},
{}
]
}
Pagination size
All listing endpoints return 30 objects by default. You can override this by passing the query param of size
. You can specify the page by supplying the query param of page
.
Maximum objects in pagination
At the moment, the maximum number of objects per page is 50.
Pagination fields
Field | Description |
---|---|
total | Total objects in query |
per_page | Number of objects per page |
current_page | Current page number |
first_page | First page number |
last_page | Last page number |
first_page_url | Query url for first page |
last_page_url | Query url for last page |
next_page_url | Query url for next page |
previous_page_url | Query url for previous page |