beliq
v0.5.1Validate, parse, generate, convert EU e-invoices via beliq; delivery through beliq is in development
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
beliq_validate_einvoice beliq: Validate E-Invoice
Validate an EU electronic invoice and report the verdict together with how deep the check went. Accepts an invoice XML document (inline via document, or a file via documentPath), or a Factur-X / ZUGFeRD PDF via documentPath. For a PDF the verdict is about the embedded XML: the PDF itself is not checked, and pdfInput says which embedded file was read. Returns valid, the detected format and profile, the check depth in verificationBadgeLabel, the ruleset versions the check ran, and every error and warning with its rule id, severity, location, and message. valid means the document passed the rule…
| Parameter | Type | Description |
|---|---|---|
document | string | The invoice as XML text. Provide this OR documentPath, not both. |
documentPath | string | Path to an invoice file on disk: an XML document, or a PDF carrying embedded XML (Factur-X / ZUGFeRD). Provide this OR document. |
format | string | Source syntax hint. 'auto' (default) detects the format from the document. |
franceCtc | boolean | Also apply the French CTC rules (BR-FR-CTC) during validation. |
beliq_parse_einvoice beliq: Parse E-Invoice
Parse an EU electronic invoice into a structured EN 16931 invoice object. Accepts a UBL or CII XML document (inline via document, or a file via documentPath), or a Factur-X / ZUGFeRD PDF via documentPath. Returns the detected format and profile, the extracted invoice (number, dates, currency, seller, buyer, lines, totals, and more), and warnings that say what the document holds and the parsed invoice does not. Report the warnings with the invoice. Use it to read the contents of an invoice; use validate to check it against the rules.
| Parameter | Type | Description |
|---|---|---|
document | string | The invoice as XML text. Provide this OR documentPath, not both. |
documentPath | string | Path to an invoice file on disk: a UBL/CII XML, or a Factur-X / ZUGFeRD PDF. Provide this OR document. |
format | string | Source syntax hint. 'auto' (default) detects CII vs UBL from the document. |
beliq_generate_einvoice beliq: Generate E-Invoice
Generate an EU electronic invoice from an EN 16931 invoice object. Set standard to the target format and pass the invoice fields. Use only invoice data the user gave. When a field the target format requires is missing, ask the user for it: do not make up a value so that validation passes. output 'xml' (default) returns the document inline; 'pdf' needs outputPath to write it to, and is a hybrid PDF/A-3 with the XML embedded for facturx and zugferd, or a visualization with no embedded XML for xrechnung and peppol-bis (whose legal document stays the XML). By default the API validates the document…
| Parameter | Type | Description |
|---|---|---|
invoice * | object | The EN 16931 invoice to render. Extra fields (dueDate, buyerReference, paymentMeans, taxSummary, per-country blocks) are passed through to the API. |
standard * | string | Target e-invoice standard to produce. |
facturxProfile | string | Profile for a Factur-X / ZUGFeRD document; ignored for xrechnung and peppol-bis. extended-ctc-fr is Factur-X only: zugferd accepts basicwl, en16931 and extended. |
output | string | 'xml' (default) returns the document inline. 'pdf' needs outputPath to write it to: for facturx and zugferd it is a hybrid PDF/A-3 with the XML embedded; xrechnung and peppol-bis have no hybrid form,… |
outputPath | string | Where to write the generated document on disk. Required for pdf output, optional for xml. The call fails if a file already exists at the path. |
verify | boolean | Validate the generated document before returning it, and fail if it does not pass. Defaults to true. |
beliq_convert_einvoice beliq: Convert E-Invoice
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, ret…
| Parameter | Type | Description |
|---|---|---|
targetFormat * | string | 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. |
document | string | The source invoice as XML text. Provide this OR documentPath, not both. |
documentPath | string | Path to the source invoice on disk: a UBL/CII XML, or a Factur-X / ZUGFeRD PDF. Provide this OR document. |
dropFranceCtcOverlay | boolean | Drop the French CTC overlay from the converted document. |
outputPath | string | 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. |
sourceFormat | string | Source format hint. 'auto' (default) detects it from the document. |
targetProfile | string | Profile for a facturx or zugferd target; ignored for the XML targets. |
beliq_check_account beliq: Check Account
Verify the configured beliq API key and report the plan, the remaining quota, and whether the key is live or a blq_test_ sandbox key, whose generated and converted documents are sandbox specimens. Calls GET /v1/me, which draws no quota. Use it as a connection and credential smoke test.