Ask for an invitation
Menu

Endpoint

List invoices

GET/v1/invoices

Returns your invoices, newest first, a page at a time. Filter by status, customer, overdue or due_date[lte], and by the time each was made, with created[gte] and created[lt].

Scope a restricted key needs
invoices:read
Publishable key
Not allowed: secret or restricted key only
Idempotency-Key
Not used. A GET is already safe to repeat.

Parameters

Parameters of List invoices
ParameterType and placeMeaning
statusstringqueryOne state or a comma-separated list: draft, open, paid, void.
customerstringqueryOnly invoices of this cus_ id.
overduebooleanqueryOnly open invoices past their due date (true), or the others (false).
due_date[lte]string (date)queryAlso [gte], [gt], [lt].
limitintegerqueryItems per page, 1 to 100. Default 20.
starting_afterstringqueryAn object id: return the items after it.
ending_beforestringqueryAn object id: return the items before it.
created[gte]string (date-time)queryCreated at or after. Also created[gt], created[lte], created[lt].
created[lt]string (date-time)queryCreated before.
expandstringqueryComma-separated fields to expand (Filtering, sorting and expanding), up to 5, one level deep: data.customer, data.order. Each field needs the read scope that its object's own GET needs (customers:read for a customer, payments:read for a payment); without it the call answers insufficient_scope naming that scope, and nothing is expanded.
Orrerie-VersionstringheaderAPI version date. Default: the version the key was created with. Example 2026-10-11.

Example request

curl

curl https://api.orrerie.com/v1/invoices \
  -H "Authorization: Bearer $ORRERIE_SECRET_KEY"

JavaScript

const response = await fetch("https://api.orrerie.com/v1/invoices", {
  headers: {
    Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
  },
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result);

Python

import os
import requests

response = requests.get(
    "https://api.orrerie.com/v1/invoices",
    headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
    timeout=30,
)
result = response.json()
if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)

PHP

<?php
$request = curl_init('https://api.orrerie.com/v1/invoices');
curl_setopt_array($request, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
    ],
]);
$body = curl_exec($request);
if ($body === false) {
    throw new RuntimeException(curl_error($request));
}
$result = json_decode($body, true);
if (curl_getinfo($request, CURLINFO_HTTP_CODE) >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);

Responses

200 OK

A list whose data holds invoice objects. Headers: Orrerie-Request-Id.

Example response, 200

{
  "object": "list",
  "url": "/v1/invoices",
  "has_more": false,
  "data": [
    {
      "id": "inv_sxr44t9zk7krg104gmhsqx2p",
      "object": "invoice",
      "livemode": true,
      "created": "2026-10-08T09:00:00.000Z",
      "updated": "2026-10-08T09:02:00.000Z",
      "number": "INV-0042",
      "status": "open",
      "overdue": false,
      "customer": "cus_8ea07c40qsvv19f7rgmeb8ha",
      "order": "ord_18ayqdcy8s50t2dp5r257ep3",
      "currency": "USD",
      "line_items": [
        {
          "name": "Wholesale beans, 20 kg",
          "quantity": 20,
          "unit_amount": "17.50",
          "amount": "350.00",
          "price": null
        }
      ],
      "subtotal": "350.00",
      "discount_amount": "0.00",
      "tax_amount": "0.00",
      "total": "350.00",
      "amount_paid": "0.00",
      "amount_due": "350.00",
      "due_date": "2026-10-22",
      "memo": "Thank you for your order.",
      "footer": "Acme Coffee Roasters LLC",
      "url": "https://pay.orrerie.com/i/inv_sxr44t9zk7krg104gmhsqx2p",
      "pdf": "file_jgxe7twfcheqtdha9pafpnc3",
      "reminders": {
        "days_before_due": [
          3
        ],
        "days_after_due": [
          1,
          7
        ]
      },
      "finalized_at": "2026-10-08T09:02:00.000Z",
      "sent_at": "2026-10-08T09:02:05.000Z",
      "paid_at": null,
      "voided_at": null,
      "metadata": {}
    }
  ]
}

Any other status: an error

A status of 400 or above answers with the error object. Branch on its code, never on its message.

Errors

This call has no error of its own. It answers with the errors every call can answer with: a bad key, a missing scope, an object that does not exist, the rate limit. Every error code has its own entry.