Validate an EN 16931 e-invoice
validate_invoiceValidate an invoice against EN 16931 and its national CIUS rule sets (XRechnung UBL/CII, Peppol BIS 3.0, Factur-X). Returns every failure as a "teaching error": the official rule id, the business term (BT-/BG-) it constrains, what the regulation actually requires, and a concrete fix. REQUIRES AN API KEY and costs 1 document against the monthly quota — call issue_api_key first if you do not have one. For explaining a rule id you already have, use explain_rule instead: it is free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice | Yes | The invoice to validate, as an InvoiceInput object. Required: profile (one of en16931, xrechnung-ubl, xrechnung-cii, facturx-en16931, peppol-bis-3), invoiceNumber, issueDate ("YYYY-MM-DD"), currency (ISO 4217), seller {name, address{city, postalCode, countryCode}}, buyer {name, address{...}}, and lines[] of {id, description, quantity, unitCode, unitPrice, vatCategory, vatRate}. The XRechnung profiles additionally require buyerReference (BT-10), a seller contact {name, phone, email}, and payment instructions — see BR-DE-1/2/5/6/7/15 via the explain_rule tool. A CREDIT NOTE IS THE SAME OBJECT with invoiceTypeCode (BT-3) set to "381": there is no separate tool and no separate shape, the same rules run, and the amounts stay POSITIVE — the type code is what conveys the direction of the money, so negative amounts on a credit note reverse it back into an invoice. Full schema: https://api.attestwire.com/openapi.json |