Validate an e-invoice
validate_einvoiceSays which rules an e-invoice passed, by which validator and release: the file is held to the rule set its specification identifier (BT-24) names, Factur-X and ZUGFeRD by Mustang, XRechnung (CII and UBL) by the KoSIT validator, and each check (syntax, schema, every named rule set) comes back with its own result and findings. Pass exactly one source: render_id, an e-invoice this workspace rendered, which is answered from the report the render keeps and costs nothing; or xml_base64, the XML itself. An XML takes one of the organisation's validations of the day (from the Starter plan; Free validates no uploads). Up to 4 MB of CII or UBL; a PDF is not taken. result is passed, failed or not_checked: not_checked means no rule set here is for the file (reason and explanation say why, such as an identifier it does not know), not that the file is wrong. The report says which rules a file passed; it does not say whether the document is a proper invoice for VAT purposes. To check an _invoice block before rendering it, use check_invoice.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "validate_einvoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | No | auto (default) takes the rule set the file's identifier names; a rule set named here judges only a file whose identifier it is for. en16931 holds a render's EN 16931 invoice to CEN's own rules, which counts like an upload | |
| render_id | No | rnd_ id of a render of this workspace that made an e-invoice; free | |
| xml_base64 | No | The e-invoice XML (CII or UBL), base64 encoded, up to 4 MB; counts one of the day’s validations |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | The rule set and its release, as the validator names it | |
| checks | Yes | ||
| reason | Yes | Why it was not checked, such as unknown_customization_id | |
| result | Yes | passed, failed or not_checked; new values may be added | |
| allowance | Yes | What the day's validations have used after this call; null where nothing was counted | |
| validator | Yes | The validator and its version, e.g. KoSIT validator 1.6.3 | |
| xml_sha256 | Yes | SHA-256 of the XML that was judged | |
| explanation | Yes | ||
| customization_id | Yes | The specification identifier (BT-24) the file names |