Update a draft invoice

PUThttps://app.speybooks.com/api/v1/invoices/{id}

Replaces the fields and line items of a draft invoice. Only invoices with status draft can be updated; an issued invoice cannot be updated.

This is a full replacement, not a merge: the request body has the same shape as create (minus the immutable invoiceType and status), existing line items are deleted and replaced with the provided set, and totals are recomputed. Metadata, if provided, also replaces existing metadata entirely. Line amounts use the create format: exact decimal strings, pounds.

Path parameters

idstringrequired

Body parameters

contactIdstringrequired
dueDatestringrequired
date
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
termsstringoptional
max length: 2000

Response

200Default Response
Show response fields
idstring
invoiceNumberstring

Error codes

400Default Response
404Invoice not found.