Skip to Content

Invoices API

Access and create your sales invoices.

Read scope: invoices:read Write scope: invoices:write

List Invoices

GET /invoices

Returns all invoices for your business.

Query Parameters

ParameterTypeDescription
statusstringFilter by status: draft, awaiting_payment, paid, overdue, voided
client_idstringFilter by client ID
from_datedateFilter invoices from this date (YYYY-MM-DD)
to_datedateFilter invoices to this date (YYYY-MM-DD)
pageintegerPage number (default: 1)
page_sizeintegerItems 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

ParameterTypeDescription
idstring (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}/pdf

Returns 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

ParameterTypeDescription
idstring (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 /invoices

Creates 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

FieldTypeRequiredDescription
client_idstringYesClient ID (must belong to your business)
issue_datedateNoIssue date in YYYY-MM-DD format (default: today)
due_datedateNoDue date in YYYY-MM-DD format
payment_terms_daysintegerNoDays until due (used if due_date not provided)
currencystringNoCurrency code (default: AUD)
notesstringNoNotes displayed on the invoice
referencestringNoExternal reference (e.g. legacy quote number or CRM invoice id). Used for idempotent imports — resubmitting the same reference returns the existing invoice
invoice_numberstringNoCaller-supplied invoice number (e.g. INV-000002). When omitted, Rebased auto-generates a number. Duplicate numbers for the business return HTTP 409
default_account_idstringNo*Revenue account ID applied to line items missing account_id (from GET /accounts?type=revenue)
default_tax_code_idstringNo*Tax code ID applied to line items missing tax_code_id (from GET /tax-codes)
statusstringNodraft or awaiting_payment (default: draft)
line_itemsarrayYesAt least one line item (see below)

*Required on each line item unless set here as a default.

Line Item Fields

FieldTypeRequiredDescription
descriptionstringNoLine item description
quantitydecimalNoQuantity (default: 1)
unit_pricedecimalYesPrice per unit
account_idstringNo*Revenue account ID (overrides default_account_id for this line)
tax_code_idstringNo*Tax code ID (overrides default_tax_code_id for this line). Tax rate is looked up automatically.
item_idstringNoCatalog 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

FieldTypeDescription
idstringUnique identifier (UUID)
invoice_numberstringAuto-generated invoice number (e.g., INV-1001)
client_idstringClient ID
client_namestringClient name
statusstringInvoice status
issue_datedateIssue date
due_datedateDue date
subtotaldecimalSubtotal before tax
tax_totaldecimalTotal tax amount
totaldecimalTotal including tax
amount_paiddecimalAmount paid
amount_duedecimalAmount still due
currencystringCurrency code (e.g., AUD)
notesstringInvoice notes
line_itemsarrayLine items (see below)
created_atdatetimeWhen created
updated_atdatetimeWhen last updated

Line Item Object

FieldTypeDescription
idstringUnique identifier
descriptionstringLine item description
quantitydecimalQuantity
unit_pricedecimalPrice per unit
amountdecimalLine total (quantity x unit_price + tax)
tax_amountdecimalTax amount for this line
account_idstringRevenue account ID
tax_code_idstringTax code ID
Last updated on