Skip to content

Pagination and filtering

List endpoints return results newest first, in pages:

{
"object": "list",
"url": "/v1/invoices",
"data": [ { "id": "inv_…", "object": "invoice" } ],
"has_more": true,
"next_cursor": "inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11"
}
  • limit sets the page size: 1–100, default 10.
  • When has_more is true, pass next_cursor as starting_after to get the next page.

Cursors stay correct while new invoices are being created, unlike page numbers, which can skip or repeat items.

async function* allInvoices(params = {}) {
let startingAfter;
do {
const qs = new URLSearchParams({ limit: '100', ...params, ...(startingAfter && { starting_after: startingAfter }) });
const res = await fetch(`https://api.brrndops.com/v1/invoices?${qs}`, {
headers: { Authorization: `Bearer ${process.env.BRRNDOPS_API_KEY}` },
});
const page = await res.json();
yield* page.data;
startingAfter = page.has_more ? page.next_cursor : undefined;
} while (startingAfter);
}
for await (const invoice of allInvoices({ status: 'open' })) {
console.log(invoice.number, invoice.total);
}

Filters can be combined, and they apply before pagination.

Parameter Example Notes
status open,sent Comma-separated. deleted invoices are hidden unless you ask for them.
external_ref order_123 Exact match on your own reference.
customer_email bola@example.com Case-insensitive exact match.
created_gte 2026-10-01T00:00:00Z Created on or after, RFC 3339.
created_lt 2026-11-01T00:00:00Z Created before, RFC 3339.