Pagination
How to paginate through large result sets using cursor-based pagination.
Overview
All list endpoints use cursor-based pagination. This provides stable, consistent pagination even when data is being created or deleted between requests.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 10 | Maximum records per page (1-100) |
starting_after | string | -- | Cursor: ID of the last item from the previous page |
ending_before | string | -- | Reverse cursor: ID of the first item from the previous page |
You cannot use starting_after and ending_before in the same request.
Response Format
Every list response follows the same structure:
jsonJSON
1{2 "object": "list",3 "url": "/v1/customers",4 "data": [...],5 "has_more": true,6 "next_cursor": "cus_a1b2c3d4e5f6"7}
| Field | Description |
|---|---|
object | Always "list" |
url | The endpoint path |
data | Array of resources |
has_more | true if there are more pages |
next_cursor | ID to pass as starting_after for the next page, or null |
Examples
Bash
1# First page2curl "https://api.corebill.io/v1/customers?company_id=com_abc123&limit=10" \3 -H "Authorization: Bearer sk_live_your_api_key"45# Next page (use next_cursor from previous response)6curl "https://api.corebill.io/v1/customers?company_id=com_abc123&limit=10&starting_after=cus_a1b2c3d4e5f6" \7 -H "Authorization: Bearer sk_live_your_api_key"