Skip to main content
Glama

Factur-X: Generate & Validate E-Invoices

Generate an EN 16931 invoice

generate_invoice
Read-onlyIdempotent

Create an EN 16931 e-invoice from structured data: Factur-X PDF/A-3, CII XML, or UBL 2.1 XML.

Use when you have the parties, lines and dates and need the document. To revise one, correct the input
and regenerate; save and deliver the returned file through your own system. Do not use when you already have a
visual PDF and CII XML: call embed_xml. To check a document you did not create here, call validate_invoice;
to read one, call extract_invoice.

Start invoice from get_invoice_example, replacing sample parties and dates. Leave totals and line
net_amount omitted to compute them from quantities, prices, allowances and charges. For ubl-xml,
profile must be en16931 or extended-ctc-fr; extended and basicwl are CII/PDF-only. profile selects
the XML model while check selects validation rules: use check=base for non-French invoices;
changing check does not disable party_check. language and footer_text affect only the visual PDF.

Omitted party_check enables registry checks only for extended-ctc-fr; true/false explicitly
overrides that default. Enabled checks send party identifiers/address and seller IBAN to EU Verify.
A not_ready verdict blocks output with field pointers. Successful checks add evidence ids;
registry outages do not block generation and are reported as warnings, not proof of readiness.
XSD/business-rule failures return a tool error with rule ids; fix the input and retry.

Requires an authenticated trial, prepaid or subscription allowance (OAuth or API key).
Each successful result uses one document operation, including repeated calls.
Returns a JSON text summary (totals, warnings, evidence) and an embedded resource: base64 PDF
or XML text. No invoice is stored or sent to a recipient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
checkNoRule 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
outputNofacturx-pdf (default): PDF/A-3 with the visual invoice and CII XML inside, the hybrid file French platforms accept. cii-xml: UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone.facturx-pdf
invoiceYesInvoice 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.
profileNoEN 16931 conformance level written in the XML: en16931 (default, full semantic model), extended (optional business terms), extended-ctc-fr (French B2B mandate; parties are checked before the file is emitted), basicwl (no lines)en16931
languageNoLanguage of the visual PDF: fr (default) or en. Ignored when output is cii-xml or ubl-xml.fr
footer_textNoOptional text printed in the PDF footer. Omit it for no footer. Ignored for XML-only output.
party_checkNoAsk EU Verify whether the seller and buyer are invoice-ready before emitting. true checks. false skips. Omit it and extended-ctc-fr checks, other profiles do not. not_ready is a tool error and no file is returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / invoice / type
      Added value: +"object"
    • addedInput schema / properties / language / type
      Added value: +"string"
    • addedInput schema / properties / output / type
      Added value: +"string"
    • addedInput schema / properties / profile / type
      Added value: +"string"
  2. Changed3 schema fields changed
    • changedInput schema / properties / footer_text / description
      Previous value: -"Optional footer text on the PDF"New value: +"Optional text printed in the PDF footer. Omit it for no footer. Ignored for XML-only output."
    • changedInput schema / properties / language / description
      Previous value: -"Language of the visual PDF: fr or en"New value: +"Language of the visual PDF: fr (default) or en. Ignored when output is cii-xml or ubl-xml."
    • changedInput schema / properties / party_check / description
      Previous value: -"Ask EU Verify whether the seller and buyer are invoice-ready before emitting. Defaults to true for extended-ctc-fr. not_ready returns an error and no file."New value: +"Ask EU Verify whether the seller and buyer are invoice-ready before emitting. true checks. false skips. Omit it and extended-ctc-fr checks, other profiles do not. not_ready is a tool error and no file is returned."
  3. Changed3 schema fields changed
    • changedInput schema / properties / output / description
      Previous value: -"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)."New value: +"facturx-pdf (default): PDF/A-3 with the visual invoice and CII XML inside, the hybrid file French platforms accept. cii-xml: UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone."
    • changedInput schema / properties / party_check / description
      Previous value: -"Check parties with EU Verify before emitting. Defaults to true for extended-ctc-fr."New value: +"Ask EU Verify whether the seller and buyer are invoice-ready before emitting. Defaults to true for extended-ctc-fr. not_ready returns an error and no file."
    • changedInput schema / properties / profile / description
      Previous value: -"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)"New value: +"EN 16931 conformance level written in the XML: en16931 (default, full semantic model), extended (optional business terms), extended-ctc-fr (French B2B mandate; parties are checked before the file is emitted), basicwl (no lines)"
  4. Changed1 schema field changed
    • addedInput schema / properties / party_check
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Check parties with EU Verify before emitting. Defaults to true for extended-ctc-fr.",
      +  "title": "Party Check"
      +}
  5. Changed4 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"Schematron rule set: EN 16931 base or + French CTC rules"New value: +"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)."
    • addedInput schema / properties / invoice / description
      Added value: +"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."
    • changedInput schema / properties / output / description
      Previous value: -"facturx-pdf (PDF/A-3 with XML, default), cii-xml or ubl-xml"New value: +"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)."
    • changedInput schema / properties / profile / description
      Previous value: -"EN 16931 conformance level: en16931 (default), extended, extended-ctc-fr, basicwl"New value: +"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)"
  6. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources