Validate and convert
This guide describes how to validate documents (check format and business rules) and convert between formats (e.g. to XRechnung or Peppol BIS) using the Format API.
Why validate
- Check XML or model before creating a document — avoid failed status after upload.
- Get a structured report with errors and warnings (e.g. missing required field, invalid code).
Why convert
- Produce a target format (e.g. XRechnung UBL, Peppol BIS) from another format or from the model (JSON).
- Use the result as input for upload or for sending (e.g. convert to Peppol BIS then upload and send via Peppol).
Conversions between supported formats go through the central hub xtool.canonical.1_0 (source → canonical → target). Typed xTool formats xtool.invoice.1_0 and xtool.credit_note.1_0 remain available; see Formats.
Web
- Validation: Tools → Validation — upload an XML file (under 10 MB), choose a format or leave auto-detect, run validation. The report shows XSD and XSLT (or CSV) errors and warnings with locations. See Tools interface.
- Convert an existing document: Open the document → Format conversion. Choose the target format. You need permission to delete documents to see this action (same rule as in Upload PDF).
- Update PDF: On the document, Update PDF replaces the visualisation PDF.
See Documents interface and Web overview.
API
- Validate: Call the format validation endpoint (e.g. validate XML or validate model). Send the document body (XML or JSON) and optionally the format code. Response: validation result and list of issues.
- Convert/transform: Call the transform endpoint: send source document (XML or model) and target format; response is the converted document (e.g. XML or model).
Base path for format endpoints is usually under /api/v2/formats/ (e.g. validate, transform). See API reference for exact paths and parameters.
Next steps
- Create document from validated/converted data — Create documents.
- Supported formats — Formats, Format models.