Invoices
Manage invoices. Invoices can be auto-generated when creating orders with send_invoice: true, or created manually via the API.
Endpoints
GET/invoicesList invoices
GET/invoices/:idGet single invoice
POST/invoicesCreate invoice
PUT/invoices/:idUpdate invoice
List invoices - GET /invoices
| Parameter | Type | Description |
|---|---|---|
| customer_id | UUID | Filter by customer |
| status | String | 'paid' | 'unpaid' | 'cancelled' | 'overdue' |
| from | ISO date | Start date filter |
| to | ISO date | End date filter |
| page | Number | Page number (default: 1) |
| per_page | Number | Results per page (max: 100) |
curl "https://qatxonlxvtgxvqjgfxpl.supabase.co/functions/v1/api/invoices?status=unpaid&per_page=25" \
-H "Authorization: Bearer do_live_YOUR_KEY"const invoices = await client.invoices.list({
status: 'unpaid',
per_page: 25,
})invoices = client.invoices.list(status='unpaid', per_page=25)Invoice response object
{
"id": "f8g9h0i1-...",
"invoice_number": "INV-0018",
"customer_id": "7d2e1f09-...",
"sale_id": "9f3a8c12-...",
"status": "paid",
"subtotal": 194.97,
"tax_amount": 12.50,
"total": 207.47,
"due_date": "2026-07-01",
"paid_date": "2026-06-15",
"items": [
{
"product_id": "a1b2c3d4-...",
"product_name": "Widget Pro",
"quantity": 3,
"unit_price": 49.99,
"total": 149.97
}
],
"created_at": "2026-06-02T14:30:00.000Z"
}
Create invoice - POST /invoices
Create an invoice manually. For automatic invoice generation, use send_invoice: true when creating an order.
| Field | Type | Required | Description |
|---|---|---|---|
| customer_id | UUID | required | Customer UUID |
| items | Array | required | Line items (see below) |
| due_date | ISO date | optional | Payment due date |
| notes | String | optional | Invoice notes |
items[] object
| Field | Type | Required | Description |
|---|---|---|---|
| product_id | UUID | required | Product ID |
| quantity | Number | required | Quantity |
| price | Number | required | Unit price |
Update invoice - PUT /invoices/:id
Update an invoice's status, for example to mark it as paid or cancelled.
| Field | Type | Description |
|---|---|---|
| status | String | 'paid' | 'cancelled' | 'overdue' |
| paid_date | ISO date | Date the invoice was paid (optional) |
PUT /invoices/f8g9h0i1-...
{
"status": "paid",
"paid_date": "2026-06-15"
}