Generate Factur-X invoice
generate_invoiceCreate a new, compliant e-invoice (Factur-X PDF/A-3, CII XML or UBL XML) from structured invoice data.
Use when you have the invoice content (parties, lines, dates) and need the document. Do not use when you
already have a visual PDF and a Factur-X XML to combine: call embed_xml. To check a document you did not
create here, call validate_invoice; to read one, call extract_invoice.
The result is validated (XSD + schematron for `check`) before it is returned; on failure the tool returns
an error listing the failing rule ids (e.g. BR-CO-10, BR-FR-01) so you can fix the input and retry.
Nothing is stored. Returns a text summary (number, totals, warnings) plus the document as an embedded
resource: base64 PDF for facturx-pdf, XML text for cii-xml / ubl-xml.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| check | No | Rule set the output must pass before it is returned: fr-ctc (default) = EN 16931 + French CTC rules (BR-FR-*), base = EN 16931 only (non-French sellers). | fr-ctc |
| output | No | facturx-pdf (default): PDF/A-3 with the visual invoice and the CII XML embedded, the format French platforms accept. cii-xml: the UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone (Peppol-style). | facturx-pdf |
| invoice | Yes | Invoice data: seller, buyer, lines, dates, payment terms. Amounts are decimal strings ("1200.00"), dates ISO 8601. Totals and the VAT breakdown are computed. Full JSON Schema in the resource facturx://schema/invoice. | |
| profile | No | Factur-X conformance level written in the XML: en16931 (default, full EN 16931 semantic model), extended (adds optional business terms), extended-ctc-fr (French B2B mandate profile), basicwl (no lines) | en16931 |
| language | No | Language of the visual PDF: fr or en | fr |
| footer_text | No | Optional footer text on the PDF |