Skip to main content
A list route returns one page at a time, in this shape:

Parameters

A request may carry startingAfter or endingBefore, not both. A list that is worked out on each read, such as QUERY /invoice-previews, always fits on one page. It returns the same shape with hasMore false and no cursors, and ignores limit and cursors if they are sent.

Reading a whole list

  1. Request the first page with no cursor.
  2. If hasMore is true, request the next page with startingAfter set to the nextCursor you received.
  3. Repeat until hasMore is false.

Filters and order

A list route may accept filters, listed in the API Reference for that route. Boolean filters take the words true and false. A filter that takes several values takes them separated by commas, for example filter=FIRST,SECOND, and an empty one is the same as leaving it out. A query parameter the route does not take, such as a misspelled filter, returns 400 rather than a list that ignores it. A cursor is bound to the filters and the orderBy it was issued under. Sending it back with different filters or a different order returns 400 rather than a page that silently skips or repeats records. To change either, start again from the first page with no cursor. Cursors are opaque. Store and return them unchanged, and do not build them yourself.