Create an invoice

POSThttps://app.speybooks.com/api/v1/invoices/

Creates a new invoice with one or more line items. The invoice number is assigned automatically from the organisation's sequence (e.g. INV-0043).

Line quantity and unitPrice are exact decimal strings. unitPrice is in POUNDS: £850.00 is sent as "850" or "850.00", and fractional prices ("100.50") are accepted. Do not send pence; "85000" creates an £85,000 line. quantity may be fractional ("2.5"). JSON numbers are rejected. Totals are computed server-side; the response amounts and all subsequent reads are in pence.

Invoices can be created in draft (default) or sent status. Draft invoices can be edited and deleted; issuing is irreversible. The per-line accountId maps the revenue or expense to a chart of accounts entry, optional while drafting, REQUIRED to issue: creating directly in sent status with any unmapped line is rejected, because issue posts the journal and the journal credits each line's account. Creating as sent posts the issue journal atomically with the invoice.

Body parameters

contactIdstringrequired
dueDatestringrequired
date
invoiceTypestringrequired
salespurchase
issueDatestringrequired
date
linesarray<object>required
min items: 1
Show child parameters
descriptionstringrequired
quantitystringrequired
pattern: ^(?!0+(\.0+)?$)\d+(\.\d+)?$
unitPricestringrequired
pattern: ^\d+(\.\d+)?$
vatRateintegerrequired
min: 0 · max: 100
accountIdstringoptional
metadataobjectoptional
notesstringoptional
max length: 2000
referencestringoptional
max length: 100
statusstringoptionalDefault: draft
draftsent
termsstringoptional
max length: 2000

Response

201Default Response
Show response fields
idstring
invoiceNumberstring

Error codes

400Default Response