Pagination

Paginating using the since_id parameter

All collection endpoints support a since_id parameter.

When a since_id is specified, the collection will be ordered by id ascending, and contain only resources with an ID strictly greater than the specified since_id.

To fully paginate through a collection, follow the algorithm:

  • Initialize your since_id to 0
  • Specify a limit
  • Make a request with your current since_id and limit
  • If the number of resources returned is less than your limit, finish
  • Otherwise, set since_id equal to the id of the last resource in the response and repeat

Example

Note: some data is omitted from the example responses for clarity.
curl \
  --url 'https://api.loyaltylion.com/v2/customers?since_id=0&limit=2' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json'