Pagination
A list endpoint, such as GET /payments, answers a page at a time, the newest first. Every page is a list object:
{"object": "list","url": "/payments","has_more": true,"data": [ { "id": "pay_in_01J9…", "object": "payment", … }, …]}data holds the page’s objects, [] when nothing matches. has_more says whether more follow past the page.
Parameters
Section titled “Parameters”limit: how many objects a page holds, 1 to 100. 10 when you leave it out.starting_after: the id of an object. The page starts right after it, older. Pass the last id of a page to get the next one.ending_before: the id of an object. The page ends right before it, newer. Pass the first id of a page to get the one before. With it,has_moresays whether more follow before the page’s first object.
Send at most one of starting_after and ending_before. An id that names none of your objects, in your key’s mode, is 404 resource_missing with the parameter in param.
curl "https://api.63-180-91-99.sslip.io/payments?limit=50&starting_after=pay_in_01J9…" \-H "Authorization: Bearer sk_live_in_…"A page is read by its cursor, not by its number: an object created while you read the pages does not shift them, and the hundredth page is as fast as the first.
A list shows what is already created. A payment is dated when its request starts and listed once it is done, up to a second later, so it can appear behind objects you have already read. Settlements are the same: one our team makes can appear behind ones you have already read. When you poll for new payments, ask for a window of created that overlaps the last one you read by a minute, rather than only what is newer than its first object. Once webhooks are live, they tell you of each payment as it changes.
Filters
Section titled “Filters”A list endpoint’s filters combine: every object listed matches all of them. A range of times takes its bounds in brackets, in seconds since the Unix epoch: created[gt], created[gte], created[lt] and created[lte].
curl -G https://api.63-180-91-99.sslip.io/payments \-H "Authorization: Bearer sk_live_in_…" \-d status=succeeded \-d "created[gte]=1760054400" \-d "created[lt]=1760140800"A parameter the endpoint does not take is 400 parameter_unknown, as in a request body; an empty value, one given twice, or one of the wrong type is 400 parameter_invalid. See Errors.