Validate an e-invoice
POST/einvoices/validate
Says which rules an e-invoice passed, by which validator and release, and which bytes it judged. It does not say whether the document is a proper invoice for VAT purposes, and it does not replace the recipient's own check of an invoice it received.
A render of the workspace's own e-invoice: a JSON body with render_id. The answer comes
from the report the render keeps: Formfeed validated the file before it was delivered, so
this costs nothing and runs no validator. Asking for another rule set with rules
(en16931, CEN's own EN 16931 rules for the EN 16931 profile) validates the render's file
again and counts like an upload; rules that cannot apply to the file's specification
identifier answer not_checked without counting.
An XML Formfeed did not make: multipart/form-data with a file part, up to 4 MB,
from the Starter plan. Each upload takes one of the organisation's validations of the UTC
day (Starter 100, Pro 500, Business 2,000); a day that is used up answers 403 forbidden with
feature, limit, used and resets_at. A request the validator never answered (503)
gives its validation back. Uploads are never stored. PDF files are not taken: send the XML.
The validator is chosen by the root element and an exact match of the specification
identifier (BT-24): Factur-X and ZUGFeRD 2.x identifiers by Mustang's rules for their profile,
XRechnung 3.0 (CIUS, Extension and CVD, in CII and UBL) by the KoSIT validator with KoSIT's
configuration for XRechnung, and the plain urn:cen.eu:en16931:2017 in UBL by CEN's rules
from the same configuration. Peppol BIS Billing 3.0 is not checked yet. Anything else is
not_checked, naming the identifier it found: neither passed nor failed.
Needs einvoice:validate. A key that lists templates cannot be used here.
Request
Responses
- 200
- 400
- 403
- 404
- 413
- 415
- 422
- 429
- 500
- 503
- default
The report, whatever its result: a file that failed is a report, not an error.
A body that is neither JSON nor multipart, no file part or an empty one, or an unknown rules.
forbidden: the key lacks einvoice:validate or lists templates; an upload on a plan without validations (feature: einvoice_validation, Free), with the day used up (feature: einvoice_validation with limit, used and resets_at), or before uploads are open for the organisation (feature: einvoice_uploads).
No render with this id in the workspace.
file_too_large: the request is larger than the XML limit of 4 MB and its framing. Answered from Content-Length before the body is read.
file_type_unsupported: a PDF, or a file that is not XML.
source_invalid: the render made no e-invoice, is still rendering, or failed and is asked for another rule set. source_not_found: its file was deleted or has expired, for another rule set.
rate_limited: the workspace's bucket of the plan's requests per second is empty (Free test keys also have 30 a minute). The problem names the bucket's limit and its window_seconds. Retry after Retry-After seconds.
Response Headers
Seconds until a request is let through again.
Size of the workspace's request bucket: the plan's requests per second. Free test keys are also held to 30 requests a minute, and the headers then describe whichever bucket is closer to empty.
Requests left in the bucket.
Seconds until the bucket is full again.
einvoice_validator_error: the validator did not finish with the file (a file too large or too slow to judge in the time a validation has). The validation counts.
conformance_unavailable: the validator is busy or not reachable; retry after Retry-After seconds. The validation is given back.
Error (RFC 9457 problem details).