Invoices API
Access and create your sales invoices.
Read scope: invoices:read
Write scope: invoices:write
List Invoices
GET /invoicesReturns all invoices for your business.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: draft, awaiting_payment, paid, overdue, voided |
client_id | string | Filter by client ID |
from_date | date | Filter invoices from this date (YYYY-MM-DD) |
to_date | date | Filter invoices to this date (YYYY-MM-DD) |
page | integer | Page number (default: 1) |
page_size | integer | Items per page (default: 50, max: 100) |
Example Request
curl -H "Authorization: Bearer rb_live_YOUR_API_KEY" \
"https://api.rebased.app/api/v1/external/invoices?status=awaiting_payment&from_date=2026-01-01"Example Response
{
"invoices": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"invoice_number": "INV-1001",
"client_id": "660e8400-e29b-41d4-a716-446655440000",
"client_name": "Acme Corporation",
"status": "awaiting_payment",
"issue_date": "2026-02-15",
"due_date": "2026-03-15",
"subtotal": 1000.00,
"tax_total": 100.00,
"total": 1100.00,
"amount_paid": 0.00,
"amount_due": 1100.00,
"currency": "AUD",
"notes": "Thank you for your business",
"line_items": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"description": "Consulting Services",
"quantity": 10,
"unit_price": 100.00,
"amount": 1000.00,
"tax_amount": 100.00,
"account_id": "880e8400-e29b-41d4-a716-446655440000",
"tax_code_id": "990e8400-e29b-41d4-a716-446655440000"
}
],
"created_at": "2026-02-15T10:30:00Z",
"updated_at": "2026-02-15T10:30:00Z"
}
],
"total": 1,
"page": 1,
"page_size": 50,
"has_more": false
}Get Invoice
GET /invoices/{id}Returns a single invoice by ID, including line items.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | The invoice ID |
Example Request
curl -H "Authorization: Bearer rb_live_YOUR_API_KEY" \
"https://api.rebased.app/api/v1/external/invoices/550e8400-e29b-41d4-a716-446655440000"Download Invoice PDF
GET /invoices/{id}/pdfReturns the invoice as a PDF file (application/pdf). Use this after receiving invoice_id from a quote.accepted webhook or from GET /invoices/{id}.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | The invoice ID |
Example Request
curl -H "Authorization: Bearer rb_live_YOUR_API_KEY" \
-o "Invoice-INV-1001.pdf" \
"https://api.rebased.app/api/v1/external/invoices/550e8400-e29b-41d4-a716-446655440000/pdf"The response body is raw PDF bytes. The Content-Disposition header includes a filename such as Invoice-INV-1001.pdf.
Create Invoice
POST /invoicesCreates a new invoice with line items. An invoice number is automatically generated unless you supply invoice_number (e.g. a CRM invoice number such as INV-000002).
Use default_account_id and default_tax_code_id when importing invoices from an external system (e.g. legacy quotes from another platform). Line items can then omit account_id and tax_code_id — defaults apply to any line that does not set them explicitly.
When reference is provided (e.g. the external quote number), Rebased returns the existing invoice with that reference instead of creating a duplicate (HTTP 200). New invoices return HTTP 201.
When invoice_number is provided, Rebased uses that number instead of auto-generating one. If the number already exists for the business, the API returns HTTP 409.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
client_id | string | Yes | Client ID (must belong to your business) |
issue_date | date | No | Issue date in YYYY-MM-DD format (default: today) |
due_date | date | No | Due date in YYYY-MM-DD format |
payment_terms_days | integer | No | Days until due (used if due_date not provided) |
currency | string | No | Currency code (default: AUD) |
notes | string | No | Notes displayed on the invoice |
reference | string | No | External reference (e.g. legacy quote number or CRM invoice id). Used for idempotent imports — resubmitting the same reference returns the existing invoice |
invoice_number | string | No | Caller-supplied invoice number (e.g. INV-000002). When omitted, Rebased auto-generates a number. Duplicate numbers for the business return HTTP 409 |
default_account_id | string | No* | Revenue account ID applied to line items missing account_id (from GET /accounts?type=revenue) |
default_tax_code_id | string | No* | Tax code ID applied to line items missing tax_code_id (from GET /tax-codes) |
status | string | No | draft or awaiting_payment (default: draft) |
line_items | array | Yes | At least one line item (see below) |
*Required on each line item unless set here as a default.
Line Item Fields
| Field | Type | Required | Description |
|---|---|---|---|
description | string | No | Line item description |
quantity | decimal | No | Quantity (default: 1) |
unit_price | decimal | Yes | Price per unit |
account_id | string | No* | Revenue account ID (overrides default_account_id for this line) |
tax_code_id | string | No* | Tax code ID (overrides default_tax_code_id for this line). Tax rate is looked up automatically. |
item_id | string | No | Catalog item ID |
*Required per line unless default_account_id / default_tax_code_id is set on the request.
Legacy quote import example
Import an accepted quote from an external system (quote never existed in Rebased). Set defaults once; put the external quote number in reference for traceability and safe retries.
curl -X POST \
-H "Authorization: Bearer rb_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "660e8400-e29b-41d4-a716-446655440000",
"reference": "QTE-2019-0042",
"default_account_id": "880e8400-e29b-41d4-a716-446655440000",
"default_tax_code_id": "990e8400-e29b-41d4-a716-446655440000",
"payment_terms_days": 30,
"status": "awaiting_payment",
"line_items": [
{
"description": "Kitchen install",
"quantity": 1,
"unit_price": 8500.00
},
{
"description": "Labour",
"quantity": 40,
"unit_price": 95.00
}
]
}' \
"https://api.rebased.app/api/v1/external/invoices"Resubmitting the same reference returns HTTP 200 with the original invoice (no duplicate).
CRM invoice import example (preserve external number)
When syncing from a CRM (e.g. Go High Level), pass the CRM display number as invoice_number so bank reconciliation can match payment descriptions, and pass the CRM’s stable invoice id as reference for idempotency and webhook round-trips.
curl -X POST \
-H "Authorization: Bearer rb_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "660e8400-e29b-41d4-a716-446655440000",
"invoice_number": "INV-000002",
"reference": "ghl-invoice-abc123",
"default_account_id": "880e8400-e29b-41d4-a716-446655440000",
"default_tax_code_id": "990e8400-e29b-41d4-a716-446655440000",
"payment_terms_days": 30,
"status": "awaiting_payment",
"line_items": [
{
"description": "Monthly retainer",
"quantity": 1,
"unit_price": 800.00
}
]
}' \
"https://api.rebased.app/api/v1/external/invoices"Duplicate invoice_number for the same business returns HTTP 409.
Example Request (explicit account/tax per line)
curl -X POST \
-H "Authorization: Bearer rb_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "660e8400-e29b-41d4-a716-446655440000",
"issue_date": "2026-04-04",
"payment_terms_days": 30,
"notes": "Thank you for your business",
"reference": "PO-12345",
"line_items": [
{
"description": "Consulting Services",
"quantity": 10,
"unit_price": 100.00,
"account_id": "880e8400-e29b-41d4-a716-446655440000",
"tax_code_id": "990e8400-e29b-41d4-a716-446655440000"
},
{
"description": "Travel Expenses",
"quantity": 1,
"unit_price": 250.00,
"account_id": "880e8400-e29b-41d4-a716-446655440000",
"tax_code_id": "990e8400-e29b-41d4-a716-446655440000"
}
]
}' \
"https://api.rebased.app/api/v1/external/invoices"Example Response (201 Created)
Returns HTTP 201 when a new invoice is created. If reference matched an existing invoice, the response is HTTP 200 with the existing invoice (see Legacy quote import above).
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"invoice_number": "INV-1002",
"client_id": "660e8400-e29b-41d4-a716-446655440000",
"client_name": "Acme Corporation",
"status": "draft",
"issue_date": "2026-04-04",
"due_date": "2026-05-04",
"subtotal": 1250.00,
"tax_total": 125.00,
"total": 1375.00,
"amount_paid": 0.00,
"amount_due": 1375.00,
"currency": "AUD",
"notes": "Thank you for your business",
"line_items": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"description": "Consulting Services",
"quantity": 10,
"unit_price": 100.00,
"amount": 1100.00,
"tax_amount": 100.00,
"account_id": null,
"tax_code_id": null
},
{
"id": "771e8400-e29b-41d4-a716-446655440000",
"description": "Travel Expenses",
"quantity": 1,
"unit_price": 250.00,
"amount": 275.00,
"tax_amount": 25.00,
"account_id": null,
"tax_code_id": null
}
],
"created_at": "2026-04-04T10:30:00Z",
"updated_at": null
}Invoice Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (UUID) |
invoice_number | string | Auto-generated invoice number (e.g., INV-1001) |
client_id | string | Client ID |
client_name | string | Client name |
status | string | Invoice status |
issue_date | date | Issue date |
due_date | date | Due date |
subtotal | decimal | Subtotal before tax |
tax_total | decimal | Total tax amount |
total | decimal | Total including tax |
amount_paid | decimal | Amount paid |
amount_due | decimal | Amount still due |
currency | string | Currency code (e.g., AUD) |
notes | string | Invoice notes |
line_items | array | Line items (see below) |
created_at | datetime | When created |
updated_at | datetime | When last updated |
Line Item Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
description | string | Line item description |
quantity | decimal | Quantity |
unit_price | decimal | Price per unit |
amount | decimal | Line total (quantity x unit_price + tax) |
tax_amount | decimal | Tax amount for this line |
account_id | string | Revenue account ID |
tax_code_id | string | Tax code ID |