parse_ubl_invoice
Parse UBL 2.1 invoice XML into an EN 16931 structured dictionary for inspection or round-trip verification.
Instructions
Parse a UBL 2.1 invoice XML string into an EN 16931 structured dict.
Extracts the EN 16931 core field set. Italian national fields (progressivo_invio, regime_fiscale, etc.) are returned with their ItalianInvoice defaults since UBL 2.1 does not carry them.
Use this to inspect cross-border invoices received in UBL format, or to round-trip the output of generate_ubl_invoice() for verification.
On success returns the ItalianInvoice fields as a JSON-serialisable dict. On failure returns {'error': str}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml_string | Yes | UBL 2.1 Invoice or CreditNote XML string to parse. Returns an EN 16931 field dict. National extensions are silently ignored. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||