Create an invoice
smartbill_create_invoiceDestructive
Create an invoice for a client with product/service lines. By default it is saved as a DRAFT (no number) for review in SmartBill Cloud. With draft=false the invoice is ISSUED: it takes the next number of the series, cannot be deleted or edited through this server, can only be cancelled or reversed (storno), and, depending on the account's e-Factura setup, may be transmitted to ANAF. Confirm every field with the user before draft=false. Returns series, number, documentId, documentUrl (needs login) and documentViewUrl (public PDF link). POST /invoice/v2.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | No | Default TRUE: the document is saved as a draft without a number, to be finalized in SmartBill Cloud. Pass false ONLY when the user explicitly wants it ISSUED now: that takes the next number of the series, cannot be undone from the API, and may be transmitted to e-Factura / ANAF depending on the account setup. | |
| client | Yes | The client the document is issued to. | |
| currency | No | Document currency (default RON). | |
| due_date | No | Due date yyyy-mm-dd. | |
| language | No | Document language (default RO). | |
| mentions | No | Mentions shown on the document. | |
| products | Yes | 1-200 lines. | |
| issue_date | No | Issue date yyyy-mm-dd (default today). | |
| series_name | Yes | Document series name exactly as configured in SmartBill Cloud (smartbill_list_series lists them). | |
| observations | No | Observations shown on the document. | |
| exchange_rate | No | Exchange rate to RON (default: SmartBill's rate for the date). |