/api/public/v1/invoices
List invoices
Your organisation's invoices and quotations, whatever their status (drafts and cancelled documents included), newest invoice date first.
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
| page | integer (int32) | 1 | The page to return, from 1. A smaller value is read as 1. |
| pageSize | integer (int32) (1–200) | 20 | How many items per page, from 1 to 200. A value outside the range is held to it. |
Example request
curl "https://api.ayrexa.com/api/public/v1/invoices?page=1&pageSize=50" \
-H "X-Api-Key: $AYREXA_API_KEY"const response = await fetch('https://api.ayrexa.com/api/public/v1/invoices?page=1&pageSize=50', {
headers: { 'X-Api-Key': process.env.AYREXA_API_KEY },
});
if (!response.ok) throw new Error(`Ayrexa API answered ${response.status}`);
const { total, page, pageSize, items } = await response.json();using var http = new HttpClient { BaseAddress = new Uri("https://api.ayrexa.com") };
http.DefaultRequestHeaders.Add("X-Api-Key", Environment.GetEnvironmentVariable("AYREXA_API_KEY"));
using var response = await http.GetAsync("/api/public/v1/invoices?page=1&pageSize=50");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();Response
{
"total": 57,
"page": 1,
"pageSize": 20,
"items": [
{
"invoiceNumber": "INV-0021",
"customerName": "BCX",
"invoiceDate": "2026-09-01T00:00:00Z",
"totalAmount": 11500,
"currencyCode": "ZAR",
"status": "Posted"
},
{
"invoiceNumber": "INV-0020",
"customerName": "Karoo Fresh Produce",
"invoiceDate": "2026-08-28T00:00:00Z",
"totalAmount": 2875.5,
"currencyCode": "ZAR",
"status": "Paid"
}
]
}| Field | Type | Description |
|---|---|---|
| total | integer (int32) | Invoices across all pages. |
| page | integer (int32) | The page returned. |
| pageSize | integer (int32) | Items per page. |
| items | array of PublicInvoiceDto | This page's invoices. |
| invoiceNumber | string, or null | The number printed on the invoice. |
| customerName | string, or null | The customer's name as it was when the invoice was created. |
| invoiceDate | string (date-time) | The invoice date (UTC). |
| totalAmount | number (double) | The total including VAT, in the invoice's currency. |
| currencyCode | string, or null | ISO 4217 currency code of the invoice. |
| status | string, or null | Draft (a quotation, or an invoice not yet issued), Issued, Approved, Posted (due), PartiallyPaid, Paid, or Cancelled. One of: Draft, Issued, Approved, Posted, Paid, Cancelled, PartiallyPaid. |
Status codes
| Status | Meaning |
|---|---|
| 200 | A page of results. |
| 400 | A query parameter could not be read. |
| 401 | The API key is missing, unknown or revoked, or the organisation is suspended. No body. |
| 403 | The organisation is not on the Enterprise plan. No body. |
| 429 | More than 600 requests in a minute from this IP address. No body. Retry-After |
| 500 | Something went wrong on our side. |
