Update a draft invoice

PUT https://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 — attempting to update a sent, paid, or other non-draft invoice returns a 400 error.

The request body has the same shape as the create endpoint, minus invoiceType and status which are immutable after creation. Line items are replaced entirely — existing lines are deleted and the provided lines are inserted. This is a full replacement, not a merge.

Metadata, if provided, also replaces existing metadata entirely.

Path parameters

id string required

Body parameters

contactId string required
dueDate string required
date
issueDate string required
date
lines array<object> required
min items: 1
Show child parameters
description string required
quantity integer required
min: 1
unitPrice integer required
min: 0
vatRate integer required
min: 0 · max: 100
accountId string optional
metadata object optional
notes string optional
max length: 2000
reference string optional
max length: 100
terms string optional
max length: 2000

Response

200 Default Response
Show response fields
id string
invoiceNumber string

Error codes

400 Default Response
404 Invoice not found or not in draft status.