E-Invoice
Introduction
Use this guide to generate hybrid invoices that remain readable as normal PDFs while embedding structured invoice XML for accounting and ERP processing.
Prerequisites
- A PolyDoc account and API key — sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
- Invoice data available in your app/backend (seller, buyer, line items, totals) that can be sent as JSON.
Configuration
Choose standard
Set
eInvoice.standard to choose the e-invoice labeling convention:facturx- recommended for France and many cross-border EU scenarioszugferd- common in German domestic invoicing
Both generate equivalent hybrid invoices and use the same underlying CII XML model.
Choose profile
Set
eInvoice.profile to control compliance depth. en16931 is the recommended default for standard EU B2B invoicing.| Profile | Typical usage |
|---|---|
minimum | Minimal payment information, no line-item detail. |
basicwl | Basic payment data without line items. |
basic | Line items included, no allowances or charges. |
en16931 | Standard EU B2B compliance profile. |
extended | Additional fields for complex or custom invoicing scenarios. |
Provide invoice payload
The
eInvoice.invoice object contains your structured business data. Typical required fields include:- Header fields:
number,issueDate,currencyCode - Parties:
sellerandbuyerwith address data - Lines:
lines[]with quantity, unit price, VAT details - Totals:
totalNetAmount,totalTaxAmount,totalGrossAmount
Optional verification
Set
eInvoice.verify to true to require PDF/A-3b compliance after assembly: if VeraPDF reports non-compliance, the API returns 422 Unprocessable Entity with code: "PDFA_VERIFICATION_FAILED" (and a pdfa object with details). On success you receive a normal 200 response with the PDF body.With
verify omitted or false on eInvoice, the hybrid invoice is returned without enforcing a passing VeraPDF check.{
"source": "<html><body><h1>Invoice INV-2026-042</h1></body></html>",
"eInvoice": {
"standard": "facturx",
"profile": "en16931",
"verify": true,
"invoice": { "...": "..." }
}
}
Compliance behavior
E-invoice conversion creates a hybrid output: human-readable PDF plus machine-readable invoice XML (Factur-X or ZUGFeRD), aligned with the selected profile and invoice payload.
Example request
{
"source": "<html><body><h1>Invoice INV-2026-042</h1></body></html>",
"eInvoice": {
"standard": "facturx",
"profile": "en16931",
"verify": true,
"invoice": {
"number": "INV-2026-042",
"issueDate": "2026-03-15",
"dueDate": "2026-04-14",
"currencyCode": "EUR",
"seller": {
"name": "Acme GmbH",
"address": {
"line1": "Hauptstrasse 1",
"city": "Berlin",
"postalCode": "10115",
"countryCode": "DE"
},
"taxId": "DE123456789"
},
"buyer": {
"name": "Customer AG",
"address": {
"line1": "Rue du Parc 5",
"city": "Paris",
"postalCode": "75008",
"countryCode": "FR"
},
"taxId": "FR98765432100"
},
"lines": [
{
"description": "Consulting services (8 h)",
"quantity": 8,
"unitCode": "HUR",
"unitPrice": 150.00,
"lineTotal": 1200.00,
"vatRate": 19.0,
"vatCategoryCode": "S"
}
],
"totalNetAmount": 1200.00,
"totalTaxAmount": 228.00,
"totalGrossAmount": 1428.00
}
}
}