/v1/validateValidate an e-invoice XML against EN 16931 and format rules
Run full compliance validation on an e-invoice XML document. The pipeline performs XSD schema validation followed by Schematron business-rule checks and returns a structured report with per-rule severity, location (XPath), message, suggestion, and EN 16931 Business Term reference where available. **Auto-detection:** if `format_hint` is omitted the service inspects the XML root element and namespaces to pick the correct rule set (UBL 2.1, CII D16B, Peppol BIS 3.0, XRechnung, Factur-X/ZUGFeRD). **Size limit:** XML payloads up to 5 MB. **`is_valid`** is true only when both `schema_valid` and `business_rules_valid` are true. Required scope: `einvoice:validate`.
Authentication
Requires API key via X-API-Key header.
Request body
documentstringrequiredXML document content (string). Maximum 5 MB.
maxLen 5242880
format_hintanyoptionalExpected format code (e.g. peppol_bis_3). Auto-detected if omitted.
Example request
curl -X POST \
"https://einvoice.aethar.dev/api/v1/validate" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document":"string"}'Responses
dataValidationResultrequiredValidation result returned in the response envelope.
is_validbooleanrequiredOverall validation result
format_detectedstringrequiredDetected e-invoicing format
schema_validbooleanrequiredXML schema (XSD) validation passed
business_rules_validbooleanrequiredSchematron / business rule validation passed
error_countintegeroptionalNumber of errors
default 0
warning_countintegeroptionalNumber of warnings
default 0
rulesarray<ValidationRule>optionalIndividual rule results
rule_idstringrequiredRule identifier (e.g. PEPPOL-EN16931-R001, BR-01)
severitystringrequiredenum: error | warning | infoRule severity
messagestringrequiredHuman-readable rule description
locationanyoptionalXPath or JSON path to the failing element
suggestionanyoptionalActionable fix suggestion
business_termanyoptionalEN 16931 Business Term (e.g. BT-1)
processing_msanyoptionalmetadataMetadataSchemarequiredsourcesarray<SourceSchema>optionalnamestringrequiredData source name
urlanyoptionalURL to the source
request_idstringrequiredUnique request identifier
rate_limitanyoptionalerrorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
Try this endpoint
Create a free Aethar account and generate an API key in 2 minutes.
Create free account →