beliq: Convert E-Invoice
beliq_convert_einvoiceConvert EU electronic invoices between EN 16931 formats by providing a source document or path and a target format; XML sources return XML, while hybrid PDF targets need an output path.
Instructions
Convert an EU electronic invoice from one EN 16931 format to another. Pass the source document (inline via document, or a file via documentPath) and set targetFormat. An XML source comes back as XML inline for every target, facturx and zugferd included: XML is not wrapped into a hybrid PDF. A hybrid PDF source sent to facturx or zugferd comes back as a PDF, written to the outputPath you give: the PDF as sent, with only its annotation flags normalised for PDF/A and its container not checked, when its embedded XML already is the target; otherwise that PDF re-wrapped around the converted XML, returned only after veraPDF passed it against PDF/A-3b. With a test key the PDF is watermarked after any veraPDF check, so do not say veraPDF checked the file returned. A successful result means the API validated the invoice XML before returning it. For a facturx or zugferd target at profile en16931 that validation is the one for plain EN 16931 CII: no Factur-X profile schema is checked. It carries no verdict and no check depth; a converted document that fails comes back as an error that lists the failed rules. lostElementsCount is how many source elements the engine recorded as having no target equivalent. A loss the engine does not detect is not counted, so 0 does not say that every field of the source arrived. lostElements lists those losses, each with its path, value, reason, severity and acceptableLoss. When the list would pass the API's 6 KB header cap, it holds one { truncated: true } entry instead of the losses, and lostElementsCount stays the exact count. beliq produces the converted document and does not send it: delivery through beliq is in development. Until it is available, transmission (Peppol, plateforme agréée, SDI) and tax-authority reporting stay with your access point; archiving stays with you, and beliq does not operate KSeF submission.
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": {
"targetFormat": "<targetFormat>"
},
"name": "beliq_convert_einvoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | No | The source invoice as XML text. Provide this OR documentPath, not both. | |
| outputPath | No | Where to write the converted document on disk. Required when a PDF source goes to a facturx or zugferd target, optional otherwise. The call fails if a file already exists at the path. | |
| documentPath | No | Path to the source invoice on disk: a UBL/CII XML, or a Factur-X / ZUGFeRD PDF. Provide this OR document. | |
| sourceFormat | No | Source format hint. 'auto' (default) detects it from the document. | |
| targetFormat | Yes | Format to convert to. An XML source comes back as XML inline for every target, facturx and zugferd included. A hybrid PDF source sent to facturx or zugferd comes back as a PDF and needs outputPath. | |
| targetProfile | No | Profile for a facturx or zugferd target; ignored for the XML targets. | |
| dropFranceCtcOverlay | No | Drop the French CTC overlay from the converted document. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | ||
| output | Yes | What came back, read from the response: xml, or pdf for a returned hybrid PDF. | |
| livemode | No | ||
| outputPath | No | ||
| contentType | Yes | ||
| bytesWritten | No | ||
| lostElements | No | The losses counted in lostElementsCount, each as https://docs.beliq.eu/api-reference/convert/#lostelement-schema describes, or the one truncation entry the tool description names. | |
| sourceFormat | No | ||
| targetFormat | No | ||
| conversionTools | No | ||
| profileDetected | No | ||
| lostElementsCount | No |