Pagination
GET /payments uses cursor pagination, which stays stable even while new payments arrive between page requests.
| Parameter | Meaning |
|---|---|
limit | Page size, 1 to 100. Default 20. |
starting_after | The next_cursor from the previous page. |
status | Optional filter, for example succeeded. |
{
"data": [ { "id": "6f0c1a52-...", "status": "succeeded" } ],
"has_more": true,
"next_cursor": "6f0c1a52-3f3a-4b6e-9b0e-6d0a1c2f9a11"
}Results are newest first. Pass next_cursor as starting_after to get the next page. has_more is true when the page was full, so the last page can also be full, in which case the next request returns an empty data. Stop when data is empty or next_cursor is null.
let cursor
do {
const url = new URL('https://merchant.olympuspay.co/api/v1/payments')
url.searchParams.set('limit', '100')
if (cursor) url.searchParams.set('starting_after', cursor)
const page = await (await fetch(url, { headers: { Authorization: `Bearer ${process.env.OLYMPUS_API_KEY}` } })).json()
for (const payment of page.data) handle(payment)
cursor = page.data.length ? page.next_cursor : undefined
} while (cursor)Other lists: GET /payouts returns the 50 most recent payouts. GET /settlements takes a date range (from, to) and returns everything that settled in it, with a format=csv option.