Servidor MCP

Factur-X: Generate & Validate E-Invoices

io.github.LeBorgneAntoine/facturx
Negocio y operaciones Legal y cumplimiento Público y accesible MCP 2025-11-25

Qué hace este MCP

Generates, validates, embeds, extracts, and explains EN 16931-compliant Factur-X, CII, and UBL electronic invoices.

check_invoice_parties
Check seller and buyer before generating an invoice
Check both invoice parties together and return their readiness and separate evidence before generation. Use before generate_invoice; use check_party for one party and validate_invoice for document rules. Each party needs siren, siret or vat; siret wins over siren. French identifiers or country_code=FR require SIREN/SIRET; a French lookup can derive omitted vat. Address fields activate address checks. requester_vat applies to both lookups but cannot replace either party's vat. Roles follow seller/buyer argument names; no invoice lines or full invoice body is needed. Makes at most two EU Verify requests with the caller's plan key; Pro/Scale enable register access. Returns status and parties.seller/buyer, each with status, reasons and available evidence. Only two positive results yield invoice_ready; any not_ready yields not_ready, otherwise inconclusive. Inspect both results: denied plans, invalid input, quotas and outages never establish readiness. No document quota is consumed; upstream limits still apply per lookup. Results may change on retry. No invoice is generated, stored or sent.
Solo lectura Acceso externo Idempotente
Esquema de entrada
{'type': 'object', '$defs': {'PartyCheckInput': {'type': 'object', 'title': 'PartyCheckInput', 'properties': {'vat': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Vat', 'default': None, 'description': "Party's EU VAT number, including country prefix."}, 'city': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'City', 'default': None, 'description': 'City for address verification.'}, 'eori': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Eori', 'default': None, 'description': 'Optional EORI to verify.'}, 'iban': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Iban', 'default': None, 'description': 'Optional party IBAN to verify.'}, 'siren': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Siren', 'default': None, 'description': '9-digit French SIREN, including leading zeros.'}, 'siret': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Siret', 'default': None, 'description': '14-digit French SIRET, including leading zeros.'}, 'address': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Address', 'default': None, 'description': 'Street address to verify.'}, 'postal_code': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Postal Code', 'default': None, 'description': 'Postal code for address verification.'}, 'country_code': {'anyOf': [{'type': 'string', 'maxLength': 256, 'minLength': 1}, {'type': 'null'}], 'title': 'Country Code', 'default': None, 'description': 'ISO 3166-1 alpha-2 country code, e.g. FR or DE.'}}, 'additionalProperties': False}}, 'title': 'check_invoice_partiesArguments', 'required': ['seller', 'buyer'], 'properties': {'buyer': {'$ref': '#/$defs/PartyCheckInput', 'description': "Buyer's registry identifiers and optional checks."}, 'seller': {'$ref': '#/$defs/PartyCheckInput', 'description': "Seller's registry identifiers and optional checks."}, 'requester_vat': {'anyOf': [{'type': 'string', 'maxLength': 256}, {'type': 'null'}], 'title': 'Requester Vat', 'default': None, 'description': 'Your VAT number for VIES request evidence.'}}}
Esquema de salida
{'type': 'object', 'title': 'check_invoice_partiesDictOutput', 'additionalProperties': True}
check_party
Check whether a party is invoice-ready
Ask EU Verify whether one seller or buyer can appear on an invoice. Use to correct one party's identifiers; use check_invoice_parties to check seller and buyer together, or validate_invoice for document rules. Supply siren, siret or vat; siret wins over siren. A SIREN/SIRET, country_code=FR or FR VAT triggers French checks requiring a SIREN/SIRET. Omitted vat can be derived from a successful French lookup; foreign parties normally need explicit VAT. Send address fields with a coherent country_code; requester_vat cannot substitute for the checked party's vat. Sends supplied fields to EU Verify and applicable registers. A Pro/Scale key enables checks; other plans return plan_excluded. No Factur-X document quota is consumed. Returns status, reasons with field pointers and available evidence: invoice_ready is positive, not_ready needs correction, upstream_unavailable is inconclusive and retryable, invalid_input indicates rejected input. Register results and evidence ids may change between calls. No invoice is created or stored.
Solo lectura Acceso externo Idempotente
Esquema de entrada
{'type': 'object', 'title': 'check_partyArguments', 'properties': {'vat': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Vat', 'default': None, 'description': "Party's EU VAT number, for example FR40732829320."}, 'city': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'City', 'default': None, 'description': 'City, checked with the address.'}, 'eori': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Eori', 'default': None, 'description': 'EORI. Checked only when you send it.'}, 'iban': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Iban', 'default': None, 'description': 'Party IBAN. Checked only when you send it.'}, 'role': {'enum': ['seller', 'buyer'], 'type': 'string', 'title': 'Role', 'default': 'buyer', 'description': 'Party role recorded in the evidence; defaults to buyer.'}, 'siren': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Siren', 'default': None, 'description': '9-digit French SIREN, including leading zeros.'}, 'siret': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Siret', 'default': None, 'description': '14-digit French SIRET, including leading zeros.'}, 'address': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Address', 'default': None, 'description': 'Street line; any address, postal_code or city activates address checking.'}, 'postal_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Postal Code', 'default': None, 'description': 'Postal code, checked with the address.'}, 'country_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Country Code', 'default': None, 'description': 'ISO 3166-1 alpha-2 country code, for example FR or DE.'}, 'requester_vat': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Requester Vat', 'default': None, 'description': 'Your VAT number, so the evidence pack can include a VIES request identifier.'}}}
Esquema de salida
{'type': 'object', 'title': 'check_partyDictOutput', 'additionalProperties': True}
draft_credit_note
Draft a credit note from an invoice
Return the credit-note body for an invoice: type 381, same parties and lines, amounts unchanged. Use for a full credit of an existing invoice, not for extracting a PDF or validating a document. invoice must be the original generate_invoice input object, not extract_invoice output. number and issue_date belong to the new credit note; the original number/date are copied into preceding_invoices. Give number a distinct value and use YYYY-MM-DD dates. due_date replaces the original deadline; omitting it removes that deadline rather than inheriting it. All original lines, quantities and amounts are retained, so this does not calculate a partial refund. Keep amounts positive: type 381 expresses the credit. Existing credit notes, a reused invoice number or negative line amounts produce a tool error. Default payment remittance references follow the new number; a custom reference is preserved. Returns invoice, type_code, preceding_invoice and next. Pass the returned invoice to generate_invoice with the original profile to create the document. No key or document quota is needed for drafting; nothing is stored, sent or refunded.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', '$defs': {'Line': {'type': 'object', 'title': 'Line', 'required': ['item_name', 'quantity', 'unit_price'], 'properties': {'id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Id', 'default': None, 'description': 'BT-126, auto-numbered when omitted'}, 'note': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Note', 'default': None, 'description': 'BT-127'}, 'charges': {'type': 'array', 'items': {'$ref': '#/$defs/LineAllowanceCharge'}, 'title': 'Charges', 'description': 'BG-28'}, 'quantity': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,20}0*$)\\d{0,13}\\.\\d{0,6}0*$)'}], 'title': 'Quantity', 'description': 'BT-129'}, 'vat_rate': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Vat Rate', 'default': None, 'description': 'BT-152, required for category S'}, 'item_name': {'type': 'string', 'title': 'Item Name', 'description': 'BT-153'}, 'unit_code': {'type': 'string', 'title': 'Unit Code', 'default': 'C62', 'description': 'UN/ECE Rec 20, BT-130 (C62 unit, HUR hour, DAY, KGM, MTR, LTR...)'}, 'allowances': {'type': 'array', 'items': {'$ref': '#/$defs/LineAllowanceCharge'}, 'title': 'Allowances', 'description': 'BG-27'}, 'attributes': {'type': 'object', 'title': 'Attributes', 'description': 'BG-32 item attributes', 'additionalProperties': {'type': 'string'}}, 'net_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Net Amount', 'default': None, 'description': 'BT-131. Computed as quantity x unit_price / base_qty - allowances + charges when omitted'}, 'period_end': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period End', 'default': None, 'description': 'BT-135'}, 'unit_price': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Unit Price', 'description': 'Net unit price, BT-146'}, 'period_start': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period Start', 'default': None, 'description': 'BT-134'}, 'vat_category': {'$ref': '#/$defs/VatCategory', 'default': 'S', 'description': 'BT-151'}, 'buyer_item_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Item Id', 'default': None, 'description': 'BT-156'}, 'origin_country': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Origin Country', 'default': None, 'description': 'BT-159'}, 'price_discount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Price Discount', 'default': None, 'description': 'BT-147'}, 'seller_item_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Seller Item Id', 'default': None, 'description': 'BT-155'}, 'gross_unit_price': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Gross Unit Price', 'default': None, 'description': 'BT-148'}, 'item_description': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Item Description', 'default': None, 'description': 'BT-154'}, 'standard_item_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Standard Item Id', 'default': None, 'description': 'BT-157, e.g. EAN/GTIN'}, 'price_base_quantity': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,20}0*$)\\d{0,13}\\.\\d{0,6}0*$)'}, {'type': 'null'}], 'title': 'Price Base Quantity', 'default': None, 'description': 'BT-149'}, 'order_line_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Order Line Reference', 'default': None, 'description': 'BT-132'}, 'price_base_unit_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Price Base Unit Code', 'default': None, 'description': 'BT-150'}, 'standard_item_id_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Standard Item Id Scheme', 'default': None, 'description': 'BT-157-1, e.g. 0160 = GTIN'}, 'buyer_accounting_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Accounting Reference', 'default': None, 'description': 'BT-133'}}, 'additionalProperties': False}, 'Note': {'type': 'object', 'title': 'Note', 'required': ['text'], 'properties': {'text': {'type': 'string', 'title': 'Text', 'description': 'BT-22'}, 'subject_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Subject Code', 'default': None, 'description': 'UNTDID 4451 code, BT-21 (e.g. AAI general, PMT payment, PMD penalties)'}}, 'additionalProperties': False}, 'Party': {'type': 'object', 'title': 'Party', 'required': ['name', 'address'], 'properties': {'name': {'type': 'string', 'title': 'Name', 'description': 'Legal name, BT-27 / BT-44'}, 'siren': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Siren', 'default': None, 'description': 'French SIREN (9 digits). Written as legal registration id BT-30 / BT-47 with scheme 0002.'}, 'siret': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Siret', 'default': None, 'description': 'French SIRET (14 digits). Shortcut for electronic_address with scheme 0225.'}, 'vat_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Vat Id', 'default': None, 'description': 'BT-31 / BT-48, e.g. FR12345678901'}, 'address': {'$ref': '#/$defs/Address'}, 'contact': {'anyOf': [{'$ref': '#/$defs/Contact'}, {'type': 'null'}], 'default': None}, 'global_ids': {'type': 'object', 'title': 'Global Ids', 'description': "BT-29 / BT-46: {schemeID: identifier}, e.g. {'0009': SIRET}", 'additionalProperties': {'type': 'string'}}, 'legal_info': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Legal Info', 'default': None, 'description': 'Seller only, BT-33: legal form, share capital, RCS city...'}, 'trading_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Trading Name', 'default': None, 'description': 'BT-28 / BT-45'}, 'electronic_address': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Electronic Address', 'default': None, 'description': 'BT-34 / BT-49'}, 'tax_registration_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tax Registration Id', 'default': None, 'description': 'Seller only, BT-32'}, 'legal_registration_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Legal Registration Id', 'default': None, 'description': 'BT-30 / BT-47 when not a SIREN. Ignored if siren is set.'}, 'electronic_address_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Electronic Address Scheme', 'default': None, 'description': 'EAS code for electronic_address (BT-34-1 / BT-49-1), e.g. 0225 = SIRET (FR)'}, 'legal_registration_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Legal Registration Scheme', 'default': None, 'description': 'ISO 6523 ICD for legal_registration_id (BT-30-1 / BT-47-1), e.g. 0002 = SIREN'}}, 'additionalProperties': False}, 'Totals': {'type': 'object', 'title': 'Totals', 'required': ['line_total', 'tax_exclusive', 'tax_total', 'tax_inclusive', 'amount_due'], 'properties': {'prepaid': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Prepaid', 'default': None, 'description': 'BT-113'}, 'rounding': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Rounding', 'default': None, 'description': 'BT-114'}, 'tax_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Total', 'description': 'BT-110'}, 'amount_due': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Amount Due', 'description': 'BT-115'}, 'line_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Line Total', 'description': 'BT-106'}, 'charge_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Charge Total', 'default': None, 'description': 'BT-108'}, 'tax_exclusive': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Exclusive', 'description': 'BT-109'}, 'tax_inclusive': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Inclusive', 'description': 'BT-112'}, 'vat_breakdown': {'type': 'array', 'items': {'$ref': '#/$defs/VatBreakdown'}, 'title': 'Vat Breakdown', 'description': 'BG-23'}, 'allowance_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Allowance Total', 'default': None, 'description': 'BT-107'}}, 'description': 'Document totals (BG-22). All computed by the engine when omitted.', 'additionalProperties': False}, 'Address': {'type': 'object', 'title': 'Address', 'required': ['country'], 'properties': {'city': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'City', 'default': None, 'description': 'BT-37 / BT-52'}, 'line1': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Line1', 'default': None, 'description': 'BT-35 / BT-50'}, 'line2': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Line2', 'default': None, 'description': 'BT-36 / BT-51'}, 'line3': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Line3', 'default': None, 'description': 'BT-162 / BT-163'}, 'country': {'type': 'string', 'title': 'Country', 'maxLength': 2, 'minLength': 2, 'description': 'ISO 3166-1 alpha-2, BT-40 / BT-55'}, 'postal_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Postal Code', 'default': None, 'description': 'BT-38 / BT-53'}, 'country_subdivision': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Country Subdivision', 'default': None, 'description': 'BT-39 / BT-54'}}, 'additionalProperties': False}, 'Contact': {'type': 'object', 'title': 'Contact', 'properties': {'name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Name', 'default': None, 'description': 'BT-41 / BT-56'}, 'email': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Email', 'default': None, 'description': 'BT-43 / BT-58'}, 'phone': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Phone', 'default': None, 'description': 'BT-42 / BT-57'}, 'department': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Department', 'default': None, 'description': 'BT-41-0 / BT-56-0 (used when name is empty)'}}, 'additionalProperties': False}, 'Invoice': {'type': 'object', 'title': 'Invoice', 'required': ['number', 'issue_date', 'seller', 'buyer', 'lines'], 'properties': {'buyer': {'$ref': '#/$defs/Party', 'description': 'BG-7'}, 'lines': {'type': 'array', 'items': {'$ref': '#/$defs/Line'}, 'title': 'Lines', 'minItems': 1, 'description': 'BG-25'}, 'notes': {'type': 'array', 'items': {'$ref': '#/$defs/Note'}, 'title': 'Notes', 'description': 'BG-1'}, 'number': {'type': 'string', 'title': 'Number', 'pattern': '^[A-Za-z0-9._/\\-]+$', 'maxLength': 35, 'description': 'BT-1 (BR-FR-01/02: max 35 chars, letters, digits, . _ / -)'}, 'seller': {'$ref': '#/$defs/Party', 'description': 'BG-4'}, 'totals': {'anyOf': [{'$ref': '#/$defs/Totals'}, {'type': 'null'}], 'default': None, 'description': 'BG-22, computed when omitted'}, 'charges': {'type': 'array', 'items': {'$ref': '#/$defs/AllowanceCharge'}, 'title': 'Charges', 'description': 'BG-21'}, 'payment': {'anyOf': [{'$ref': '#/$defs/Payment'}, {'type': 'null'}], 'default': None, 'description': 'BG-16'}, 'currency': {'type': 'string', 'title': 'Currency', 'default': 'EUR', 'maxLength': 3, 'minLength': 3, 'description': 'BT-5'}, 'delivery': {'anyOf': [{'$ref': '#/$defs/Delivery'}, {'type': 'null'}], 'default': None, 'description': 'BG-13'}, 'due_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Due Date', 'default': None, 'description': 'BT-9'}, 'type_code': {'enum': ['380', '381', '384', '386', '389', '261', '751'], 'type': 'string', 'title': 'Type Code', 'default': '380', 'description': 'UNTDID 1001, BT-3: 380 invoice, 381 credit note, 384 corrected, 386 prepayment, 389 self-billed'}, 'allowances': {'type': 'array', 'items': {'$ref': '#/$defs/AllowanceCharge'}, 'title': 'Allowances', 'description': 'BG-20'}, 'issue_date': {'type': 'string', 'title': 'Issue Date', 'format': 'date', 'description': 'BT-2'}, 'already_paid': {'type': 'boolean', 'title': 'Already Paid', 'default': False, 'description': 'Invoice already paid at issuance (French BT-23 variants B2/S2/M2)'}, 'payment_terms': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Payment Terms', 'default': None, 'description': 'BT-20'}, 'operation_type': {'enum': ['goods', 'services', 'mixed'], 'type': 'string', 'title': 'Operation Type', 'default': 'services', 'description': 'Nature of the operation, used to derive the French business process code BT-23 (B1/S1/M1)'}, 'prepaid_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Prepaid Amount', 'default': None, 'description': 'BT-113 shortcut when totals are computed'}, 'tax_point_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Tax Point Date', 'default': None, 'description': 'BT-7'}, 'buyer_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Reference', 'default': None, 'description': 'BT-10'}, 'french_mentions': {'$ref': '#/$defs/FrenchMentions', 'description': 'Mandatory French legal mentions (BR-FR-05)'}, 'rounding_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Rounding Amount', 'default': None, 'description': 'BT-114 shortcut when totals are computed'}, 'business_process': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Business Process', 'default': None, 'description': 'Explicit BT-23 business process code (e.g. S1). Overrides operation_type/already_paid.'}, 'tender_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tender Reference', 'default': None, 'description': 'BT-17'}, 'project_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Project Reference', 'default': None, 'description': 'BT-11'}, 'contract_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Contract Reference', 'default': None, 'description': 'BT-12'}, 'preceding_invoices': {'type': 'array', 'items': {'$ref': '#/$defs/PrecedingInvoice'}, 'title': 'Preceding Invoices', 'description': 'BG-3'}, 'additional_documents': {'type': 'array', 'items': {'$ref': '#/$defs/AdditionalDocument'}, 'title': 'Additional Documents', 'description': 'BG-24'}, 'tax_exemption_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tax Exemption Reason', 'default': None, 'description': "Default BT-120 text for E/AE/K/G/O categories, e.g. 'TVA non applicable, art. 293 B du CGI'"}, 'sales_order_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Sales Order Reference', 'default': None, 'description': 'BT-14'}, 'vat_accounting_currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Vat Accounting Currency', 'default': None, 'description': 'BT-6'}, 'purchase_order_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Purchase Order Reference', 'default': None, 'description': 'BT-13'}, 'despatch_advice_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Despatch Advice Reference', 'default': None, 'description': 'BT-16'}, 'tax_exemption_reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tax Exemption Reason Code', 'default': None, 'description': 'Default BT-121 VATEX code'}, 'buyer_accounting_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Accounting Reference', 'default': None, 'description': 'BT-19'}, 'receiving_advice_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Receiving Advice Reference', 'default': None, 'description': 'BT-15'}}, 'additionalProperties': False}, 'Payment': {'type': 'object', 'title': 'Payment', 'properties': {'bic': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Bic', 'default': None, 'description': 'BT-86'}, 'iban': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Iban', 'default': None, 'description': 'Payee account, BT-84'}, 'terms': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Terms', 'default': None, 'description': 'BT-20'}, 'means_code': {'type': 'string', 'title': 'Means Code', 'default': '30', 'description': 'UNTDID 4461, BT-81. 30 credit transfer, 58 SEPA transfer, 59 SEPA direct debit, 48 card'}, 'means_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Means Text', 'default': None, 'description': 'BT-82'}, 'account_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Account Name', 'default': None, 'description': 'BT-85'}, 'debited_iban': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Debited Iban', 'default': None, 'description': 'Direct debit, BT-91'}, 'mandate_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Mandate Reference', 'default': None, 'description': 'Direct debit, BT-89'}, 'creditor_reference_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Creditor Reference Id', 'default': None, 'description': 'Direct debit, BT-90'}, 'remittance_information': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Remittance Information', 'default': None, 'description': 'BT-83'}}, 'additionalProperties': False}, 'Delivery': {'type': 'object', 'title': 'Delivery', 'properties': {'name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Name', 'default': None, 'description': 'Deliver-to party name, BT-70'}, 'address': {'anyOf': [{'$ref': '#/$defs/Address'}, {'type': 'null'}], 'default': None}, 'period_end': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period End', 'default': None, 'description': 'BT-74'}, 'actual_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Actual Date', 'default': None, 'description': 'BT-72'}, 'location_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Location Id', 'default': None, 'description': 'BT-71'}, 'period_start': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period Start', 'default': None, 'description': 'BT-73'}, 'location_id_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Location Id Scheme', 'default': None, 'description': 'BT-71-1'}}, 'additionalProperties': False}, 'VatCategory': {'enum': ['S', 'Z', 'E', 'AE', 'K', 'G', 'O', 'L', 'M'], 'type': 'string', 'title': 'VatCategory', 'description': 'UNTDID 5305 subset used by EN 16931 (BT-151 / BT-118).'}, 'VatBreakdown': {'type': 'object', 'title': 'VatBreakdown', 'required': ['category', 'taxable_amount', 'tax_amount'], 'properties': {'rate': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Rate', 'default': None, 'description': 'BT-119'}, 'category': {'$ref': '#/$defs/VatCategory', 'description': 'BT-118'}, 'tax_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Amount', 'description': 'BT-117'}, 'taxable_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Taxable Amount', 'description': 'BT-116'}, 'exemption_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Exemption Reason', 'default': None, 'description': 'BT-120'}, 'exemption_reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Exemption Reason Code', 'default': None, 'description': 'VATEX code, BT-121'}}, 'additionalProperties': False}, 'FrenchMentions': {'type': 'object', 'title': 'FrenchMentions', 'properties': {'enabled': {'type': 'boolean', 'title': 'Enabled', 'default': True, 'description': 'Add the three mandatory French mentions when missing'}, 'recovery_fee': {'type': 'string', 'title': 'Recovery Fee', 'default': 'Indemnité forfaitaire pour frais de recouvrement en cas de retard de paiement : 40 €.', 'description': 'Note code PMT'}, 'early_payment_discount': {'type': 'string', 'title': 'Early Payment Discount', 'default': "Pas d'escompte pour paiement anticipé.", 'description': 'Note code AAB'}, 'late_payment_penalties': {'type': 'string', 'title': 'Late Payment Penalties', 'default': "Tout retard de paiement entraîne une pénalité exigible à compter de la date d'échéance, calculée sur la base de trois fois le taux d'intérêt légal.", 'description': 'Note code PMD'}}, 'description': 'Legal mentions required on French B2B invoices (BR-FR-05). Added as BG-1 notes with codes PMD, PMT, AAB.', 'additionalProperties': False}, 'AllowanceCharge': {'type': 'object', 'title': 'AllowanceCharge', 'required': ['amount'], 'properties': {'amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Amount', 'description': 'BT-92 / BT-99, tax excluded'}, 'reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason', 'default': None, 'description': 'BT-97 / BT-104'}, 'vat_rate': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Vat Rate', 'default': None, 'description': 'BT-96 / BT-103'}, 'percentage': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Percentage', 'default': None, 'description': 'BT-94 / BT-101'}, 'base_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Base Amount', 'default': None, 'description': 'BT-93 / BT-100'}, 'reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason Code', 'default': None, 'description': 'UNTDID 5189 / 7161, BT-98 / BT-105'}, 'vat_category': {'$ref': '#/$defs/VatCategory', 'default': 'S', 'description': 'BT-95 / BT-102'}}, 'description': 'Document-level allowance (BG-20) or charge (BG-21).', 'additionalProperties': False}, 'PrecedingInvoice': {'type': 'object', 'title': 'PrecedingInvoice', 'required': ['number'], 'properties': {'number': {'type': 'string', 'title': 'Number', 'description': 'BT-25'}, 'issue_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Issue Date', 'default': None, 'description': 'BT-26'}}, 'additionalProperties': False}, 'AdditionalDocument': {'type': 'object', 'title': 'AdditionalDocument', 'required': ['id'], 'properties': {'id': {'type': 'string', 'title': 'Id', 'description': 'BT-122'}, 'url': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Url', 'default': None, 'description': 'BT-124'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Description', 'default': None, 'description': 'BT-123'}}, 'additionalProperties': False}, 'LineAllowanceCharge': {'type': 'object', 'title': 'LineAllowanceCharge', 'required': ['amount'], 'properties': {'amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Amount', 'description': 'BT-136 / BT-141'}, 'reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason', 'default': None, 'description': 'BT-139 / BT-144'}, 'percentage': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Percentage', 'default': None, 'description': 'BT-138 / BT-143'}, 'base_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Base Amount', 'default': None, 'description': 'BT-137 / BT-142'}, 'reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason Code', 'default': None, 'description': 'BT-140 / BT-145'}}, 'additionalProperties': False}}, 'title': 'draft_credit_noteArguments', 'required': ['invoice', 'number', 'issue_date'], 'properties': {'number': {'type': 'string', 'title': 'Number', 'description': 'Credit note number, different from the invoice number. Max 35 characters: letters, digits, and . _ / -.'}, 'invoice': {'$ref': '#/$defs/Invoice', 'description': 'The original invoice object you passed to generate_invoice. Not an extract_invoice result.'}, 'due_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Due Date', 'default': None, 'description': 'Optional due date. Omit it to drop the original invoice due date.'}, 'issue_date': {'type': 'string', 'title': 'Issue Date', 'format': 'date', 'description': 'Credit note issue date, ISO 8601 (YYYY-MM-DD).'}}}
Esquema de salida
{'type': 'object', 'title': 'draft_credit_noteDictOutput', 'additionalProperties': True}
embed_xml
Embed CII XML into a PDF
Combine a visual PDF you already have with CII XML into one Factur-X PDF/A-3. Use for an existing visual invoice; use generate_invoice to render invoice data or produce UBL. Match the PDF's parties, lines and totals to xml yourself: check examines only XML and cannot detect disagreement with the visible PDF. The embedded profile comes from xml; neither check nor language changes it. language does not translate the PDF. Invalid input or failed rules return a tool error with no file; rule errors include ids. For a findings report use validate_invoice. Success returns a JSON summary (profile, size_bytes, warning count) and a base64 PDF/A-3 resource. Requires a plan key; success consumes one document, errors consume none. Nothing is stored or sent.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', '$defs': {'Language': {'enum': ['fr', 'en'], 'type': 'string', 'title': 'Language'}}, 'title': 'embed_xmlArguments', 'required': ['pdf_base64', 'xml'], 'properties': {'xml': {'type': 'string', 'title': 'Xml', 'description': 'Unencoded CII XML text (Factur-X / EN 16931); UBL is not supported.'}, 'check': {'enum': ['base', 'fr-ctc'], 'type': 'string', 'title': 'Check', 'default': 'fr-ctc', 'description': 'XML validation rules: fr-ctc adds French BR-FR-* to EN 16931; base uses EN 16931 only.'}, 'language': {'$ref': '#/$defs/Language', 'default': 'fr', 'description': 'Language written in the PDF metadata: fr (default) or en.'}, 'pdf_base64': {'type': 'string', 'title': 'Pdf Base64', 'description': 'Standard base64 of PDF bytes starting with %PDF-. Not a URL or data-URI.'}}}
explain_finding
Explain a validation finding
Turn a validation rule id into the invoice field to change and an example value. Use after validate_invoice or a generate_invoice rule error, not to validate an invoice itself. rule is trimmed and uppercased to select a guide entry. message/json_pointer must come from that same finding: nonempty values override its generic context, but never change the selected fix or example. Omit them to use guide defaults for known rules. Returns rule, known, message, json_pointer, fix and example; known rules also include problem. Selected BR-FR rules and BR-CO-17/BR-CO-26 have guidance. Unknown ids return known=false and example=null with the supplied context, not an error; consult the original finding. No key or document quota is needed; nothing is stored.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', 'title': 'explain_findingArguments', 'required': ['rule'], 'properties': {'rule': {'type': 'string', 'title': 'Rule', 'description': 'Validation rule identifier, for example BR-FR-01 or BR-CO-26.'}, 'message': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Message', 'default': None, 'description': "Original finding's message text."}, 'json_pointer': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Json Pointer', 'default': None, 'description': "Original finding's json_pointer field path."}}}
Esquema de salida
{'type': 'object', 'title': 'explain_findingDictOutput', 'additionalProperties': True}
extract_invoice
Extract e-invoice data
Extract invoice parties, dates, lines, totals and VAT as JSON for bookkeeping or matching. Use validate_invoice for compliance; this performs no OCR or recalculation. Supply one source: nonblank xml overrides document_base64 without inspecting it, so omit xml to extract a PDF's attachment. include_xml returns that selected source for archiving or validation, not XML reconstructed from fields. Extracted fields need mapping before use as generate_invoice input. Returns fields and format/profile metadata, plus PDF metadata for PDF input. Missing business values remain null; numeric values are strings. Missing input, invalid base64, malformed/unrecognized XML or a PDF without embedded XML returns a tool error, not an empty extraction. Requires a plan key; success consumes one document, errors consume none. Nothing is stored or sent.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', 'title': 'extract_invoiceArguments', 'properties': {'xml': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Xml', 'default': None, 'description': 'CII or UBL XML as unencoded text.'}, 'include_xml': {'type': 'boolean', 'title': 'Include Xml', 'default': False, 'description': 'Include source XML text in the result; this can substantially increase response size.'}, 'document_base64': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Document Base64', 'default': None, 'description': 'Standard base64 of a Factur-X PDF, CII XML or UBL XML file; no data-URI prefix.'}}}
Esquema de salida
{'type': 'object', 'title': 'extract_invoiceDictOutput', 'additionalProperties': True}
generate_invoice
Generate an EN 16931 invoice
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 a plan key; each successful result uses one document, 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.
Solo lectura Acceso externo Idempotente
Esquema de entrada
{'type': 'object', '$defs': {'Line': {'type': 'object', 'title': 'Line', 'required': ['item_name', 'quantity', 'unit_price'], 'properties': {'id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Id', 'default': None, 'description': 'BT-126, auto-numbered when omitted'}, 'note': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Note', 'default': None, 'description': 'BT-127'}, 'charges': {'type': 'array', 'items': {'$ref': '#/$defs/LineAllowanceCharge'}, 'title': 'Charges', 'description': 'BG-28'}, 'quantity': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,20}0*$)\\d{0,13}\\.\\d{0,6}0*$)'}], 'title': 'Quantity', 'description': 'BT-129'}, 'vat_rate': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Vat Rate', 'default': None, 'description': 'BT-152, required for category S'}, 'item_name': {'type': 'string', 'title': 'Item Name', 'description': 'BT-153'}, 'unit_code': {'type': 'string', 'title': 'Unit Code', 'default': 'C62', 'description': 'UN/ECE Rec 20, BT-130 (C62 unit, HUR hour, DAY, KGM, MTR, LTR...)'}, 'allowances': {'type': 'array', 'items': {'$ref': '#/$defs/LineAllowanceCharge'}, 'title': 'Allowances', 'description': 'BG-27'}, 'attributes': {'type': 'object', 'title': 'Attributes', 'description': 'BG-32 item attributes', 'additionalProperties': {'type': 'string'}}, 'net_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Net Amount', 'default': None, 'description': 'BT-131. Computed as quantity x unit_price / base_qty - allowances + charges when omitted'}, 'period_end': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period End', 'default': None, 'description': 'BT-135'}, 'unit_price': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Unit Price', 'description': 'Net unit price, BT-146'}, 'period_start': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period Start', 'default': None, 'description': 'BT-134'}, 'vat_category': {'$ref': '#/$defs/VatCategory', 'default': 'S', 'description': 'BT-151'}, 'buyer_item_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Item Id', 'default': None, 'description': 'BT-156'}, 'origin_country': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Origin Country', 'default': None, 'description': 'BT-159'}, 'price_discount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Price Discount', 'default': None, 'description': 'BT-147'}, 'seller_item_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Seller Item Id', 'default': None, 'description': 'BT-155'}, 'gross_unit_price': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Gross Unit Price', 'default': None, 'description': 'BT-148'}, 'item_description': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Item Description', 'default': None, 'description': 'BT-154'}, 'standard_item_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Standard Item Id', 'default': None, 'description': 'BT-157, e.g. EAN/GTIN'}, 'price_base_quantity': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,20}0*$)\\d{0,13}\\.\\d{0,6}0*$)'}, {'type': 'null'}], 'title': 'Price Base Quantity', 'default': None, 'description': 'BT-149'}, 'order_line_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Order Line Reference', 'default': None, 'description': 'BT-132'}, 'price_base_unit_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Price Base Unit Code', 'default': None, 'description': 'BT-150'}, 'standard_item_id_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Standard Item Id Scheme', 'default': None, 'description': 'BT-157-1, e.g. 0160 = GTIN'}, 'buyer_accounting_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Accounting Reference', 'default': None, 'description': 'BT-133'}}, 'additionalProperties': False}, 'Note': {'type': 'object', 'title': 'Note', 'required': ['text'], 'properties': {'text': {'type': 'string', 'title': 'Text', 'description': 'BT-22'}, 'subject_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Subject Code', 'default': None, 'description': 'UNTDID 4451 code, BT-21 (e.g. AAI general, PMT payment, PMD penalties)'}}, 'additionalProperties': False}, 'Party': {'type': 'object', 'title': 'Party', 'required': ['name', 'address'], 'properties': {'name': {'type': 'string', 'title': 'Name', 'description': 'Legal name, BT-27 / BT-44'}, 'siren': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Siren', 'default': None, 'description': 'French SIREN (9 digits). Written as legal registration id BT-30 / BT-47 with scheme 0002.'}, 'siret': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Siret', 'default': None, 'description': 'French SIRET (14 digits). Shortcut for electronic_address with scheme 0225.'}, 'vat_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Vat Id', 'default': None, 'description': 'BT-31 / BT-48, e.g. FR12345678901'}, 'address': {'$ref': '#/$defs/Address'}, 'contact': {'anyOf': [{'$ref': '#/$defs/Contact'}, {'type': 'null'}], 'default': None}, 'global_ids': {'type': 'object', 'title': 'Global Ids', 'description': "BT-29 / BT-46: {schemeID: identifier}, e.g. {'0009': SIRET}", 'additionalProperties': {'type': 'string'}}, 'legal_info': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Legal Info', 'default': None, 'description': 'Seller only, BT-33: legal form, share capital, RCS city...'}, 'trading_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Trading Name', 'default': None, 'description': 'BT-28 / BT-45'}, 'electronic_address': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Electronic Address', 'default': None, 'description': 'BT-34 / BT-49'}, 'tax_registration_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tax Registration Id', 'default': None, 'description': 'Seller only, BT-32'}, 'legal_registration_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Legal Registration Id', 'default': None, 'description': 'BT-30 / BT-47 when not a SIREN. Ignored if siren is set.'}, 'electronic_address_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Electronic Address Scheme', 'default': None, 'description': 'EAS code for electronic_address (BT-34-1 / BT-49-1), e.g. 0225 = SIRET (FR)'}, 'legal_registration_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Legal Registration Scheme', 'default': None, 'description': 'ISO 6523 ICD for legal_registration_id (BT-30-1 / BT-47-1), e.g. 0002 = SIREN'}}, 'additionalProperties': False}, 'Totals': {'type': 'object', 'title': 'Totals', 'required': ['line_total', 'tax_exclusive', 'tax_total', 'tax_inclusive', 'amount_due'], 'properties': {'prepaid': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Prepaid', 'default': None, 'description': 'BT-113'}, 'rounding': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Rounding', 'default': None, 'description': 'BT-114'}, 'tax_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Total', 'description': 'BT-110'}, 'amount_due': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Amount Due', 'description': 'BT-115'}, 'line_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Line Total', 'description': 'BT-106'}, 'charge_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Charge Total', 'default': None, 'description': 'BT-108'}, 'tax_exclusive': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Exclusive', 'description': 'BT-109'}, 'tax_inclusive': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Inclusive', 'description': 'BT-112'}, 'vat_breakdown': {'type': 'array', 'items': {'$ref': '#/$defs/VatBreakdown'}, 'title': 'Vat Breakdown', 'description': 'BG-23'}, 'allowance_total': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Allowance Total', 'default': None, 'description': 'BT-107'}}, 'description': 'Document totals (BG-22). All computed by the engine when omitted.', 'additionalProperties': False}, 'Address': {'type': 'object', 'title': 'Address', 'required': ['country'], 'properties': {'city': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'City', 'default': None, 'description': 'BT-37 / BT-52'}, 'line1': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Line1', 'default': None, 'description': 'BT-35 / BT-50'}, 'line2': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Line2', 'default': None, 'description': 'BT-36 / BT-51'}, 'line3': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Line3', 'default': None, 'description': 'BT-162 / BT-163'}, 'country': {'type': 'string', 'title': 'Country', 'maxLength': 2, 'minLength': 2, 'description': 'ISO 3166-1 alpha-2, BT-40 / BT-55'}, 'postal_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Postal Code', 'default': None, 'description': 'BT-38 / BT-53'}, 'country_subdivision': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Country Subdivision', 'default': None, 'description': 'BT-39 / BT-54'}}, 'additionalProperties': False}, 'Contact': {'type': 'object', 'title': 'Contact', 'properties': {'name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Name', 'default': None, 'description': 'BT-41 / BT-56'}, 'email': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Email', 'default': None, 'description': 'BT-43 / BT-58'}, 'phone': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Phone', 'default': None, 'description': 'BT-42 / BT-57'}, 'department': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Department', 'default': None, 'description': 'BT-41-0 / BT-56-0 (used when name is empty)'}}, 'additionalProperties': False}, 'Invoice': {'type': 'object', 'title': 'Invoice', 'required': ['number', 'issue_date', 'seller', 'buyer', 'lines'], 'properties': {'buyer': {'$ref': '#/$defs/Party', 'description': 'BG-7'}, 'lines': {'type': 'array', 'items': {'$ref': '#/$defs/Line'}, 'title': 'Lines', 'minItems': 1, 'description': 'BG-25'}, 'notes': {'type': 'array', 'items': {'$ref': '#/$defs/Note'}, 'title': 'Notes', 'description': 'BG-1'}, 'number': {'type': 'string', 'title': 'Number', 'pattern': '^[A-Za-z0-9._/\\-]+$', 'maxLength': 35, 'description': 'BT-1 (BR-FR-01/02: max 35 chars, letters, digits, . _ / -)'}, 'seller': {'$ref': '#/$defs/Party', 'description': 'BG-4'}, 'totals': {'anyOf': [{'$ref': '#/$defs/Totals'}, {'type': 'null'}], 'default': None, 'description': 'BG-22, computed when omitted'}, 'charges': {'type': 'array', 'items': {'$ref': '#/$defs/AllowanceCharge'}, 'title': 'Charges', 'description': 'BG-21'}, 'payment': {'anyOf': [{'$ref': '#/$defs/Payment'}, {'type': 'null'}], 'default': None, 'description': 'BG-16'}, 'currency': {'type': 'string', 'title': 'Currency', 'default': 'EUR', 'maxLength': 3, 'minLength': 3, 'description': 'BT-5'}, 'delivery': {'anyOf': [{'$ref': '#/$defs/Delivery'}, {'type': 'null'}], 'default': None, 'description': 'BG-13'}, 'due_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Due Date', 'default': None, 'description': 'BT-9'}, 'type_code': {'enum': ['380', '381', '384', '386', '389', '261', '751'], 'type': 'string', 'title': 'Type Code', 'default': '380', 'description': 'UNTDID 1001, BT-3: 380 invoice, 381 credit note, 384 corrected, 386 prepayment, 389 self-billed'}, 'allowances': {'type': 'array', 'items': {'$ref': '#/$defs/AllowanceCharge'}, 'title': 'Allowances', 'description': 'BG-20'}, 'issue_date': {'type': 'string', 'title': 'Issue Date', 'format': 'date', 'description': 'BT-2'}, 'already_paid': {'type': 'boolean', 'title': 'Already Paid', 'default': False, 'description': 'Invoice already paid at issuance (French BT-23 variants B2/S2/M2)'}, 'payment_terms': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Payment Terms', 'default': None, 'description': 'BT-20'}, 'operation_type': {'enum': ['goods', 'services', 'mixed'], 'type': 'string', 'title': 'Operation Type', 'default': 'services', 'description': 'Nature of the operation, used to derive the French business process code BT-23 (B1/S1/M1)'}, 'prepaid_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Prepaid Amount', 'default': None, 'description': 'BT-113 shortcut when totals are computed'}, 'tax_point_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Tax Point Date', 'default': None, 'description': 'BT-7'}, 'buyer_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Reference', 'default': None, 'description': 'BT-10'}, 'french_mentions': {'$ref': '#/$defs/FrenchMentions', 'description': 'Mandatory French legal mentions (BR-FR-05)'}, 'rounding_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Rounding Amount', 'default': None, 'description': 'BT-114 shortcut when totals are computed'}, 'business_process': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Business Process', 'default': None, 'description': 'Explicit BT-23 business process code (e.g. S1). Overrides operation_type/already_paid.'}, 'tender_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tender Reference', 'default': None, 'description': 'BT-17'}, 'project_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Project Reference', 'default': None, 'description': 'BT-11'}, 'contract_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Contract Reference', 'default': None, 'description': 'BT-12'}, 'preceding_invoices': {'type': 'array', 'items': {'$ref': '#/$defs/PrecedingInvoice'}, 'title': 'Preceding Invoices', 'description': 'BG-3'}, 'additional_documents': {'type': 'array', 'items': {'$ref': '#/$defs/AdditionalDocument'}, 'title': 'Additional Documents', 'description': 'BG-24'}, 'tax_exemption_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tax Exemption Reason', 'default': None, 'description': "Default BT-120 text for E/AE/K/G/O categories, e.g. 'TVA non applicable, art. 293 B du CGI'"}, 'sales_order_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Sales Order Reference', 'default': None, 'description': 'BT-14'}, 'vat_accounting_currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Vat Accounting Currency', 'default': None, 'description': 'BT-6'}, 'purchase_order_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Purchase Order Reference', 'default': None, 'description': 'BT-13'}, 'despatch_advice_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Despatch Advice Reference', 'default': None, 'description': 'BT-16'}, 'tax_exemption_reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Tax Exemption Reason Code', 'default': None, 'description': 'Default BT-121 VATEX code'}, 'buyer_accounting_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Buyer Accounting Reference', 'default': None, 'description': 'BT-19'}, 'receiving_advice_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Receiving Advice Reference', 'default': None, 'description': 'BT-15'}}, 'additionalProperties': False}, 'Payment': {'type': 'object', 'title': 'Payment', 'properties': {'bic': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Bic', 'default': None, 'description': 'BT-86'}, 'iban': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Iban', 'default': None, 'description': 'Payee account, BT-84'}, 'terms': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Terms', 'default': None, 'description': 'BT-20'}, 'means_code': {'type': 'string', 'title': 'Means Code', 'default': '30', 'description': 'UNTDID 4461, BT-81. 30 credit transfer, 58 SEPA transfer, 59 SEPA direct debit, 48 card'}, 'means_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Means Text', 'default': None, 'description': 'BT-82'}, 'account_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Account Name', 'default': None, 'description': 'BT-85'}, 'debited_iban': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Debited Iban', 'default': None, 'description': 'Direct debit, BT-91'}, 'mandate_reference': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Mandate Reference', 'default': None, 'description': 'Direct debit, BT-89'}, 'creditor_reference_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Creditor Reference Id', 'default': None, 'description': 'Direct debit, BT-90'}, 'remittance_information': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Remittance Information', 'default': None, 'description': 'BT-83'}}, 'additionalProperties': False}, 'Profile': {'enum': ['basicwl', 'en16931', 'extended', 'extended-ctc-fr'], 'type': 'string', 'title': 'Profile', 'description': 'Factur-X / CII profile for generation.'}, 'Delivery': {'type': 'object', 'title': 'Delivery', 'properties': {'name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Name', 'default': None, 'description': 'Deliver-to party name, BT-70'}, 'address': {'anyOf': [{'$ref': '#/$defs/Address'}, {'type': 'null'}], 'default': None}, 'period_end': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period End', 'default': None, 'description': 'BT-74'}, 'actual_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Actual Date', 'default': None, 'description': 'BT-72'}, 'location_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Location Id', 'default': None, 'description': 'BT-71'}, 'period_start': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Period Start', 'default': None, 'description': 'BT-73'}, 'location_id_scheme': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Location Id Scheme', 'default': None, 'description': 'BT-71-1'}}, 'additionalProperties': False}, 'Language': {'enum': ['fr', 'en'], 'type': 'string', 'title': 'Language'}, 'VatCategory': {'enum': ['S', 'Z', 'E', 'AE', 'K', 'G', 'O', 'L', 'M'], 'type': 'string', 'title': 'VatCategory', 'description': 'UNTDID 5305 subset used by EN 16931 (BT-151 / BT-118).'}, 'OutputFormat': {'enum': ['facturx-pdf', 'cii-xml', 'ubl-xml'], 'type': 'string', 'title': 'OutputFormat'}, 'VatBreakdown': {'type': 'object', 'title': 'VatBreakdown', 'required': ['category', 'taxable_amount', 'tax_amount'], 'properties': {'rate': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Rate', 'default': None, 'description': 'BT-119'}, 'category': {'$ref': '#/$defs/VatCategory', 'description': 'BT-118'}, 'tax_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Tax Amount', 'description': 'BT-117'}, 'taxable_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Taxable Amount', 'description': 'BT-116'}, 'exemption_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Exemption Reason', 'default': None, 'description': 'BT-120'}, 'exemption_reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Exemption Reason Code', 'default': None, 'description': 'VATEX code, BT-121'}}, 'additionalProperties': False}, 'FrenchMentions': {'type': 'object', 'title': 'FrenchMentions', 'properties': {'enabled': {'type': 'boolean', 'title': 'Enabled', 'default': True, 'description': 'Add the three mandatory French mentions when missing'}, 'recovery_fee': {'type': 'string', 'title': 'Recovery Fee', 'default': 'Indemnité forfaitaire pour frais de recouvrement en cas de retard de paiement : 40 €.', 'description': 'Note code PMT'}, 'early_payment_discount': {'type': 'string', 'title': 'Early Payment Discount', 'default': "Pas d'escompte pour paiement anticipé.", 'description': 'Note code AAB'}, 'late_payment_penalties': {'type': 'string', 'title': 'Late Payment Penalties', 'default': "Tout retard de paiement entraîne une pénalité exigible à compter de la date d'échéance, calculée sur la base de trois fois le taux d'intérêt légal.", 'description': 'Note code PMD'}}, 'description': 'Legal mentions required on French B2B invoices (BR-FR-05). Added as BG-1 notes with codes PMD, PMT, AAB.', 'additionalProperties': False}, 'AllowanceCharge': {'type': 'object', 'title': 'AllowanceCharge', 'required': ['amount'], 'properties': {'amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Amount', 'description': 'BT-92 / BT-99, tax excluded'}, 'reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason', 'default': None, 'description': 'BT-97 / BT-104'}, 'vat_rate': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Vat Rate', 'default': None, 'description': 'BT-96 / BT-103'}, 'percentage': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Percentage', 'default': None, 'description': 'BT-94 / BT-101'}, 'base_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Base Amount', 'default': None, 'description': 'BT-93 / BT-100'}, 'reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason Code', 'default': None, 'description': 'UNTDID 5189 / 7161, BT-98 / BT-105'}, 'vat_category': {'$ref': '#/$defs/VatCategory', 'default': 'S', 'description': 'BT-95 / BT-102'}}, 'description': 'Document-level allowance (BG-20) or charge (BG-21).', 'additionalProperties': False}, 'PrecedingInvoice': {'type': 'object', 'title': 'PrecedingInvoice', 'required': ['number'], 'properties': {'number': {'type': 'string', 'title': 'Number', 'description': 'BT-25'}, 'issue_date': {'anyOf': [{'type': 'string', 'format': 'date'}, {'type': 'null'}], 'title': 'Issue Date', 'default': None, 'description': 'BT-26'}}, 'additionalProperties': False}, 'AdditionalDocument': {'type': 'object', 'title': 'AdditionalDocument', 'required': ['id'], 'properties': {'id': {'type': 'string', 'title': 'Id', 'description': 'BT-122'}, 'url': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Url', 'default': None, 'description': 'BT-124'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Description', 'default': None, 'description': 'BT-123'}}, 'additionalProperties': False}, 'LineAllowanceCharge': {'type': 'object', 'title': 'LineAllowanceCharge', 'required': ['amount'], 'properties': {'amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}], 'title': 'Amount', 'description': 'BT-136 / BT-141'}, 'reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason', 'default': None, 'description': 'BT-139 / BT-144'}, 'percentage': {'anyOf': [{'type': 'number', 'maximum': 100.0, 'minimum': 0.0}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Percentage', 'default': None, 'description': 'BT-138 / BT-143'}, 'base_amount': {'anyOf': [{'type': 'number'}, {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*(?:\\d{0,15}|(?=[\\d.]{1,20}0*$)\\d{0,15}\\.\\d{0,4}0*$)'}, {'type': 'null'}], 'title': 'Base Amount', 'default': None, 'description': 'BT-137 / BT-142'}, 'reason_code': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason Code', 'default': None, 'description': 'BT-140 / BT-145'}}, 'additionalProperties': False}}, 'title': 'generate_invoiceArguments', 'required': ['invoice'], 'properties': {'check': {'enum': ['base', 'fr-ctc'], 'type': 'string', 'title': 'Check', 'default': 'fr-ctc', 'description': '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).'}, 'output': {'$ref': '#/$defs/OutputFormat', 'default': 'facturx-pdf', 'description': '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.'}, 'invoice': {'$ref': '#/$defs/Invoice', 'description': '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': {'$ref': '#/$defs/Profile', 'default': 'en16931', 'description': '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)'}, 'language': {'$ref': '#/$defs/Language', 'default': 'fr', 'description': 'Language of the visual PDF: fr (default) or en. Ignored when output is cii-xml or ubl-xml.'}, 'footer_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Footer Text', 'default': None, 'description': 'Optional text printed in the PDF footer. Omit it for no footer. Ignored for XML-only output.'}, 'party_check': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'title': 'Party Check', 'default': None, 'description': '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.'}}}
get_invoice_example
Get a valid invoice body
Return a complete invoice body you can edit and pass to generate_invoice. Use this first, instead of inventing fields. No API key is required, and the call does not count as a document. The seller and buyer are sample data: replace them, the number, the dates and the lines before you generate. Amounts are positive decimal strings. Nothing is stored, and no file is created. Returns the invoice plus the profile and check to pass to generate_invoice.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', 'title': 'get_invoice_exampleArguments', 'properties': {'profile': {'enum': ['en16931', 'extended-ctc-fr'], 'type': 'string', 'title': 'Profile', 'default': 'en16931', 'description': 'en16931 (default) or extended-ctc-fr. The body is the same. extended-ctc-fr sets party_check so generate_invoice asks EU Verify before emitting a file.'}}}
Esquema de salida
{'type': 'object', 'title': 'get_invoice_exampleDictOutput', 'additionalProperties': True}
validate_invoice
Validate e-invoice
Check a Factur-X PDF, CII XML or UBL XML against EN 16931, and report the fields to fix. Use on received documents or after corrections; use extract_invoice for business data. Supply one source: nonblank xml overrides document_base64 without inspecting it. To check a PDF's attachment, omit xml. check adds rules to the detected profile; it cannot change that profile. Use base for non-French invoices to avoid French-field findings. Returns validity and findings with rule ids and field pointers for explain_finding. XSD failures skip schematron; inspect checks_skipped before treating validation as complete. Warnings alone do not invalidate an invoice. Rule failures or a PDF without XML return valid=false; missing input, invalid base64, malformed or unrecognized XML return a tool error. Requires a plan key: completed reports consume one document even when invalid; tool errors do not. No invoice is changed, stored or sent.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', 'title': 'validate_invoiceArguments', 'properties': {'xml': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Xml', 'default': None, 'description': 'CII or UBL XML as unencoded text.'}, 'check': {'enum': ['base', 'fr-ctc'], 'type': 'string', 'title': 'Check', 'default': 'fr-ctc', 'description': 'fr-ctc: EN 16931 plus French CTC rules (BR-FR-*). base: EN 16931 only.'}, 'document_base64': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Document Base64', 'default': None, 'description': 'Standard base64 of a Factur-X PDF, CII XML or UBL XML file; no data-URI prefix.'}}}
Esquema de salida
{'type': 'object', 'title': 'validate_invoiceDictOutput', 'additionalProperties': True}
view_invoice_demo
Try free invoice validation or download sample files
Try validation without signup, a key or paid credits, using fixed synthetic invoices. Choose sample=valid to inspect a passing CII invoice or sample=invalid to see the missing-buyer-name finding. Both use the production XSD and EN 16931 engine; results may be cached for 24 hours for the same engine version and input. Inspect validated_at and cached; a cache hit is not a fresh run. Call with {} for PDF/CII/UBL downloads and the separate published validation report. Accepts no document data, URLs or extra arguments. No PDF or business-register checks in live mode. Shared rate limits return a retryable tool error; unavailable checks never become a passing result. Use explain_finding for a returned rule id. Your own invoices require validate_invoice with an evaluation or monthly-plan key. Nothing is stored except reports for these public fixtures.
Solo lectura Idempotente
Esquema de entrada
{'type': 'object', 'title': 'view_invoice_demoArguments', 'properties': {'sample': {'anyOf': [{'enum': ['valid', 'invalid'], 'type': 'string'}, {'type': 'null'}], 'title': 'Sample', 'default': None, 'description': 'valid: fixed CII invoice; invalid: same invoice without the buyer name. Omit for downloads.'}}}
Esquema de salida
{'type': 'object', 'title': 'view_invoice_demoDictOutput', 'additionalProperties': True}
Modificado
view_invoice_demo
1 de October de 2026 a las 02:45
Modificado
draft_credit_note
29 de September de 2026 a las 02:52
Modificado
explain_finding
29 de September de 2026 a las 02:52
Añadido
check_invoice_parties
29 de September de 2026 a las 02:52
Modificado
check_party
29 de September de 2026 a las 02:52
Modificado
extract_invoice
29 de September de 2026 a las 02:52
Modificado
validate_invoice
29 de September de 2026 a las 02:52
Modificado
embed_xml
29 de September de 2026 a las 02:52
Modificado
generate_invoice
29 de September de 2026 a las 02:52
Añadido
view_invoice_demo
29 de September de 2026 a las 02:52
Añadido
draft_credit_note
27 de September de 2026 a las 02:45
Añadido
get_invoice_example
27 de September de 2026 a las 02:45
Añadido
explain_finding
27 de September de 2026 a las 02:45
Añadido
check_party
27 de September de 2026 a las 02:45
Modificado
extract_invoice
27 de September de 2026 a las 02:45
Modificado
validate_invoice
27 de September de 2026 a las 02:45
Modificado
embed_xml
27 de September de 2026 a las 02:45
Modificado
generate_invoice
27 de September de 2026 a las 02:45
Añadido
extract_invoice
17 de September de 2026 a las 12:43
Añadido
validate_invoice
17 de September de 2026 a las 12:43
Añadido
embed_xml
17 de September de 2026 a las 12:43
Añadido
generate_invoice
17 de September de 2026 a las 12:43