document_create
Creates a draft invoice or other document with computed totals stored at creation, so you can render it only after finalizing.
Instructions
Create a document in draft.
Totals are computed and stored at creation, so the figures you read back are
the ones that were issued rather than a recalculation. Nothing is rendered —
use create_document_render once the document is final.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| terms | No | ||
| locale | No | en-US | |
| number | Yes | ||
| reason | No | ||
| payment | No | ||
| ship_to | No | ||
| branding | No | ||
| currency | Yes | ||
| due_date | No | ||
| shipping | No | ||
| discounts | No | ||
| issue_date | Yes | ||
| line_items | Yes | ||
| tax_scheme | No | UNCL5153 — what kind of tax this invoice states. One document, one answer: an invoice is issued under a tax regime, not a different one per line. Optional, and deliberately not defaulted, because a PDF does not need it and assuming `VAT` would put a claim in a tax document that you did not make. Required to produce or check an e-invoice, where it must be `VAT` — every ruleset built on EN 16931 describes VAT and tests for that string literally, so a document stating anything else is refused rather than relabelled. | |
| customer_id | Yes | ||
| custom_fields | No | ||
| delivery_date | No | BT-72. When the goods or services were actually supplied — not the issue date, and what decides the VAT period. XRechnung requires this, an invoicing period, or a period on every line. | |
| document_type | No | invoice | |
| Idempotency-Key | No | ||
| buyer_reference | No | BT-10. Mandatory in Peppol BIS unless an order reference is present — often the buyer's own PO or cost-centre string. | |
| source_document_id | No | ||
| branding_profile_id | No | ||
| business_profile_id | Yes |