Preview invoice calculations
POST
https://app.speybooks.com/api/v1/invoices/previewCalculates line totals, VAT, and invoice total without creating an invoice. Use this for real-time UI previews while the user is editing line items.
Request lines use the create format: quantity and
unitPrice as exact decimal strings, with unitPrice in
pounds and both accepting fractional values. The response
returns per-line net, vat, and total plus aggregate
subtotal, vatTotal, and total, all as integers in
pence. The calculation path is identical to create, so what you
preview is what you get on submit. Deterministic and stateless;
nothing is persisted.
This endpoint is stateless and idempotent. No authentication scope is required beyond a valid API key.
Body parameters
linesarray<object>requiredShow child parameters
quantitystringrequiredunitPricestringrequiredvatRateintegerrequiredResponse
200Default Response
Show response fields
linesarray<object>Show child attributes
netintegertotalintegervatintegersubtotalintegertotalintegervatTotalinteger