Money
Every amount is an integer in the currency’s minor unit.- Fractions such as
1500.5return422with"Use whole minor units". - Three-decimal currencies are stored to two decimals, so send a multiple of
10. - The server calculates
subtotal,discount,tax,totalandamount_due. amount_dueequalstotalwhile an invoice isopenoroverdue. Otherwise it’s0.tax_rateanddiscount_percentare percentages from0to100, such as18or7.5.
toMinor('1500.00', 'USD') and formatMoney(150000, 'USD') in Node.js, to_minor and format_money in Python.
Currencies and dates
- Currencies are ISO 4217 codes.
usdis stored asUSD. An invoice withoutcurrencyuses your business currency. - A line that uses a price must be in the invoice’s currency.
- Dates such as
issue_dateanddue_dateareYYYY-MM-DD. Timestamps are ISO 8601 in UTC. - On create, pass
due_dateordays_until_due(0to365).
IDs
Treat ids as opaque strings. A malformed id returns
404.
Responses
A successful response puts its payload underdata. Lists add next_cursor.
DELETE /invoices/{id} and DELETE /webhook-endpoints/{id} return 204 with no body.
Customers, products and prices are archived, not deleted, because invoices refer to them. DELETE /customers/{id} returns the customer with "deleted": true. DELETE /products/{id} and DELETE /prices/{id} return the object with "active": false.