Validate invoice
validate_invoiceValidate one European or UAE (PINT AE) e-invoice against the official rule sets (XSD, EN 16931, XRechnung, Peppol BIS, PINT AE, FatturaPA, KSeF, arithmetic) and return the verdict without the invoice body. Use it for pass/fail and the list of errors and warnings; use read_invoice when you also need lines, totals and payment data. Input: XML (UBL, CII, XRechnung, Peppol BIS 3, UAE PINT AE, FatturaPA, KSeF FA(2)/FA(3)) or a ZUGFeRD/Factur-X hybrid PDF up to 25 MB; plain or scanned PDFs without embedded XML are rejected (no OCR). Returns the validation report (valid flag, counts, rule sets with versions, failed rules with rule id, severity, fix hint in lang, affected field and who must act), the detected source and the document header; an unreadable file returns ok=false with error.code/message/hint instead of raising. For a Polish KSeF invoice, a KSeF number passed in ksef is checked too: shape, NIP check digit, and agreement with the invoice it came with. Costs one invoice credit per call; without an API key the anonymous quota is 5 invoices per day per IP (a free key gives 100: https://invoicein.peculiar.systems/#get). Nothing is stored.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_base64": "<file_base64>"
},
"name": "validate_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ksef | No | Poland only: the KSeF number the National e-Invoice System gave this invoice — 35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF — or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never inside the FA(2)/FA(3) XML: it arrives beside the invoice in the KSeF API response, the UPO or the QR code on a visualisation. Pass it and it is checked against the invoice and returned on payment.ksef_number, the reference a Polish buyer must quote in the bank transfer title from 2027-01-01. Leave empty for invoices from any other country. | |
| lang | No | Language of the fix hints in the validation report and of the labels in HTML output. Default en. | en |
| file_base64 | Yes | Invoice file content, base64-encoded (standard alphabet). Accepted content: XML in UBL 2.1, CII D16B, XRechnung, Peppol BIS Billing 3, FatturaPA 1.2 or KSeF FA(2)/FA(3) syntax, or a ZUGFeRD 1.0/2.x or Factur-X hybrid PDF (the embedded XML is used). Max 25 MB decoded. The hosted server cannot open files on your machine: read the file and send its bytes here. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | False when the file could not be read; then only `error` is set | |
| error | No | Present when ok is false: code, message, hint | |
| source | No | Detected syntax, format, profile and container | |
| credits | No | What this call cost on the hosted server: mode (key or demo) and remaining; without an API key also the daily limit and a note saying where the free key is. Absent when the server runs locally. | |
| document | No | Invoice header: id, issue_date, type_code, currency, due_date … | |
| validation | No |