Pagination

All "list" endpoints are paginated with options_* query parameters, but the defaults and limits differ per endpoint. Always check the endpoint page; this is the summary:

EndpointFirst pageDefault page sizeMaximum page sizeDefault orderoptions_sortOrder values
GET /invoices/issued010no practical cap; responses with more than 1729 results are gzip-compressed when Accept-Encoding: gzip is sentDATE, ascendingASC, DESC
GET /invoices/received0101000 (larger values are silently capped). Pages over ~500 may exceed the 6 MB response limit and return 502; the endpoint also takes 10–25 s for organizations with thousands of invoices regardless of page size, and returns 502 if it exceeds 29 s (retry)unsortedASC, DESC
GET /customerscursor: options_nextToken———ASC, DESC
GET /accounts-payable/prepaid-expenses1201000 (out-of-range values fall back to 20, without error)creation date, descendingasc, desc (lowercase)
GET /accounts-payable/prepaid-expenses/{id}1 (paginates assignedDocuments)20100 (out-of-range values fall back to 20)——

Parameters

options_page

Page number. Zero-based for invoices, one-based for prepaid expenses. Not used by GET /customers. Send integers only: on the prepaid-expense detail endpoint 0 returns an empty page and negative or decimal values return arbitrary slices.

options_pageSize

Page size. See the table for defaults and limits.

options_sortBy

Sort field, defined by each endpoint (for example NUMBER, DATE, DUE_BY, AMOUNT for invoices). Not supported by GET /customers (responds 400).

options_sortOrder

Sort direction. ASC / DESC for invoices and customers; lowercase asc / desc for prepaid expenses.

options_nextToken

Cursor for GET /customers only. Take the nextToken value of the previous response and send it back; nextToken is null on the last page.

Response envelope

Invoice and prepaid-expense lists respond with:

{
  "total": 3132,
  "page": 0,
  "pageSize": 10,
  "pageResults": [],
  "errors": []
}

GET /customers responds with { "data": [], "errors": [], "nextToken": "..." }.