Create invoice from estimate
create_invoice_from_estimateConvert an accepted proforma into an invoice. The proforma is automatically marked as invoiced, and client and line items are copied from it.
Instructions
Issue an invoice from a proforma the customer has accepted. Returns { series, number, url }.
Prefer this over create_invoice whenever a proforma exists: it links the two documents, so the proforma is reported as invoiced by get_estimate_invoices. Rebuilding the same invoice by hand leaves the proforma looking unbilled.
The client and the line items are copied from the proforma — do not re-send them. seriesName is the invoice series to issue into; estimateSeriesName and estimateNumber identify the source proforma.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dueDate | No | Payment due date (YYYY-MM-DD). | |
| isDraft | No | Issue as a draft instead of a final invoice. | |
| mentions | No | Free text printed on the invoice. | |
| issueDate | No | Invoice issue date (YYYY-MM-DD). Defaults to today at SmartBill. | |
| sendEmail | No | Email the invoice to the client on issue. | |
| seriesName | No | Invoice series to issue into. | |
| observations | No | Internal note; not printed on the invoice. | |
| companyVatCode | No | Issuing company CIF. Falls back to SMARTBILL_VAT_CODE. | |
| estimateNumber | Yes | Number of the source estimate. | |
| estimateSeriesName | No | Series of the source estimate. Falls back to SMARTBILL_ESTIMATE_SERIES. |