Using Cursor-Based Pagination

Our API uses cursor-based pagination to handle large collections of data efficiently for alpha index endpoints.

How It Works

Each paginated response includes the results and pagination metadata:

{  
  "items": [...],  
  "has_more": true,  
  "next_cursor": "eyJpZCI6MTAwfQ=="  
}

Making Requests

Initial Request

Make your first request without a cursor:

GET /api/external/v2/customer_invoices

You can specify the number of results per page using the limit parameter:

GET /api/external/v2/customer_invoices?limit=50

Note: The default limit is 20. Maximum limit varies by endpoint - refer to the specific endpoint documentation.

Subsequent Pages

To get the next page, use the next_cursor value from the previous response:

GET /api/external/v2/customer_invoices?cursor=eyJpZCI6MTAwfQ==&limit=50

Understanding the Response

  • items: Contains the current page of results
  • has_more: Indicates if more results are available
  • next_cursor: Used to retrieve the next page
    • Present and non-empty when more results exist
    • Empty string ("") when you've reached the end

Important Notes

  • Cursors are temporary and should not be stored for long-term use
  • Invalid cursors will result in a 400 Bad Request response
  • Using a consistent limit value across requests is recommended
  • Check each endpoint's documentation for its specific maximum limit