invoice-api.xhub icon

invoice-api.xhub

Generate, parse, convert, and validate e-invoices across 37 countries with 18+ formats

Parse

AI-generated

Summary

Parses an e-invoice document into JSON data by specifying the country and expected format.

Inputs

  • countryCode (required) — The ISO 3166-1 alpha-2 country code (e.g. DE, AT) of the invoice.
  • format (required) — The format identifier of the invoice (e.g. xrechnung, zugferd, facturx).
  • inputType — How to provide the invoice document: 'binary' (reads from binary input) or 'base64' (uses a base64 encoded string). Defaults to 'binary'.
  • binaryPropertyName — Name of the binary property containing the invoice document. Required when inputType is 'binary'. Defaults to 'data'.
  • base64Data — Base64 encoded invoice document. Required when inputType is 'base64'.
  • options.filename — Optional filename hint for the parser.
  • options.includeWarnings — Whether to include validation warnings in the output. Defaults to true.

Output shape

A single record with a 'success' flag, the detected 'format', a 'hash' of the document, and a parsed 'invoice' object. Returns one item per input item.

If validation warnings are found, they are included in the 'warnings' array. If parsing fails, the node throws an error by default (unless 'Continue on Error' is enabled).

Examples

Example 1: Parse a German XRechnung invoice from binary data

Country: DE, Format: xrechnung, Input Type: binary, Binary Property: data, Include Warnings: true

Example 2: Parse a ZUGFeRD invoice provided as a base64 string

Country: CH, Format: zugferd, Input Type: base64, Include Warnings: true

Links

Discussion