Create a sales invoice
smartaccounts_create_sales_invoicePost a new sales (client) invoice (purchasesales/clientinvoices:add). The invoice number is generated by SmartAccounts, totals and VAT are calculated from the rows, and the invoice is booked to the ledger at once (it is not a draft). The client must exist (smartaccounts_list_clients); each row's code must be an article code (smartaccounts_list_articles) and vat_pc a VAT code (smartaccounts_list_vat_rates). Fails if the period is locked. Returns invoiceId, number and the totals. This creates a real accounting record in the company's books. This server cannot edit or delete it; correct it in SmartAccounts. It never retries: if a reply is unclear, look in SmartAccounts before calling again. The vendor limit is 60 requests per minute and 1000 per 24 hours; every call here is one request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Invoice date, yyyy-mm-dd. | |
| rows | Yes | Invoice rows. | |
| comment | No | Internal comment. | |
| currency | No | Currency code (default EUR). | |
| due_date | No | Due date, yyyy-mm-dd (default from the client's settings). | |
| client_id | Yes | The client id (from smartaccounts_list_clients). | |
| invoice_note | No | Additional text printed on the invoice PDF. | |
| exchange_rate | No | Exchange rate; only for a currency without an ECB rate. | |
| reference_number | No | Reference number for payment orders (default generated). |