Generate Peppol UBL or VeriFactu XML from JSON
einvoice_generateGenerate a complete, XML-escaped, cent-balanced EN 16931 Peppol BIS 3.0 UBL 2.1 XML invoice or Spanish AEAT VeriFactu sf:RegistroAlta XML block directly from JSON line items. Stateless, deterministic, read-only with zero storage; self-audits generated UBL XML and returns xml, totals {net, tax, gross, currency}, selfAuditValid, plus fingerprintSha256, qrValidationUrl, and qrSvg for VeriFactu format (returns isError=true if lines are empty or inputs invalid). Use when creating new compliant XML invoices from ERP/JSON data; use einvoice_validate to audit an existing XML, and pair with sepa_epc_qr for PDF payment QRs.
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": {
"format": "<format>",
"invoiceNumber": "<invoiceNumber>",
"issueDate": "<issueDate>",
"supplier": "<supplier>",
"customer": "<customer>",
"lines": "<lines>"
},
"name": "einvoice_generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | One or more invoice line items used to compute exact net, VAT, and gross totals. | |
| format | Yes | Target XML standard: "peppol_ubl_2_1" (EN 16931 / Peppol BIS 3.0 UBL 2.1) or "verifactu_registro_alta" (AEAT VeriFactu <sf:RegistroAlta> + SHA-256 + QR). | |
| currency | No | ISO 4217 3-letter currency code (defaults to "EUR"). | EUR |
| customer | Yes | Buyer/recipient party metadata. | |
| supplier | Yes | Seller/issuer party metadata. | |
| issueDate | Yes | Invoice issue date in ISO YYYY-MM-DD format (e.g. "2026-11-29"); automatically converted to DD-MM-YYYY for VeriFactu. | |
| paymentIban | No | Optional beneficiary SEPA IBAN included in UBL PaymentMeans (e.g. "ES9121000418450200051332"). | |
| previousHash | No | Optional previous 64-char VeriFactu SHA-256 Huella when format is "verifactu_registro_alta" (leave "" for first record). | |
| invoiceNumber | Yes | Unique invoice series and identifier (e.g. "INV-2026/0105" or "PEPPOL-2026-0042"). | |
| generationTimestamp | No | Optional ISO-8601 timestamp with timezone offset for VeriFactu FechaHoraHusoGenRegistro (defaults to current UTC/offset time). |