Creates a draft sales invoice in the credential-bound company; approving it (invoice.approve) is a separate action that numbers it and posts it to the ledger. Each line names the income account it posts to by account_id (the chart-of-accounts id from the chart of accounts list: use it when the account has no code) or by account_code; when both are sent they must name the same account. An account_id that is not an active income account of the company is refused with 422 invoice_line_account_unavailable, naming the line in error.fields. A draft may be saved with a line that has no account, but approval refuses it with invoice_line_account_missing until the line has one. Omit number for a new invoice; for an invoice already issued in another system pass its original number in number, never in reference (see the Invoice numbering guide). Send an optional Idempotency-Key to replay the stored response safely for 24 hours. Requires the invoices:write OAuth scope; the legacy approve: true flag also needs invoices:action. A foreign-currency document whose ECB exchange rate cannot be read in time is refused with 503 exchange_rate_unavailable (error.fields.currency and error.fields.date name the lookup, error.retryable is true) and a Retry-After: 30 header; nothing is written, so retry the same request, with the same Idempotency-Key, after that many seconds.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
