E-Invoicing
Issue EN 16931-compliant e-invoices (XRechnung, Factur-X, and Peppol BIS Billing 3.0) and understand how e-invoicing changes the way invoices behave through the API.
- Generate compliant e-invoices: overview of e-invoicing
- E-invoicing standards: which standard to choose
- XRechnung & ZUGFeRD / Factur-X: German and French formats
- Peppol via Super PDP: sending e-invoices over Peppol (France and Belgium)
How It Works
E-invoicing is set at two levels:
- Business: e-invoicing is enabled once for the whole business from the dashboard. This turns on the issuance rules described in How E-Invoicing Affects Your Invoices.
- Customer: each customer that requires e-invoices gets an e-invoicing standard. Customers without a standard keep receiving plain PDF invoices.
| Standard | Format | Typical use |
|---|---|---|
XRechnung | German CIUS of EN 16931 | Germany, including B2G |
FacturX | Factur-X | France |
PeppolBis | Peppol BIS Billing 3.0 | Other EU countries |
When you export an e-invoice as PDF, the structured XML is embedded in the PDF (ZUGFeRD hybrid PDF/A-3). The same file is readable by people and by accounting software.
Enable E-Invoicing from the Dashboard
E-invoicing is enabled from the dashboard. It can't be enabled with an API key.
- Go to Settings > Integrations > Compliance.
- On E-invoicing (EN 16931), click Enable e-invoicing and confirm.
- Check Compliance status in the settings dialog. Complete any missing business information it lists (for example your address, country, and VAT ID).
- Open each customer that requires e-invoices and choose an E-invoicing standard. Add the customer's country, VAT ID, and, for German public bodies, the buyer reference (Leitweg-ID).
- Optional: to deliver e-invoices over the Peppol network, see Peppol.
Enabling e-invoicing issues your existing invoices (except drafts) and credit notes. They become read-only and can no longer be deleted, only canceled. Invoices issued this way stay plain PDFs.
If several documents share the same number, enabling fails and lists the duplicates. Give each document a unique number, then enable e-invoicing again.
How E-Invoicing Affects Your Invoices
Once e-invoicing is enabled, invoices and credit notes follow fiscal issuance rules. These rules apply to every invoice of the business, including invoices for customers without a standard.
Issuance
An invoice is issued the first time it leaves Draft. This happens when:
- it is created or updated with a status other than
Draft; - it is issued explicitly;
- it is sent to the customer;
- a payment is recorded on it.
When an e-invoice is issued, it is validated against its standard first. If validation fails, the request is rejected with the list of errors and the invoice stays a draft.
Subscribe to the InvoiceIssued webhook event to know when an invoice is issued.
Numbering
- Invoice and credit note numbers come from a gapless sequence and are assigned at issuance.
- A draft gets a temporary
DRAFT-number, which is replaced when the invoice is issued. - You can't set
numberon a request that issues the invoice, or on an invoice that is already issued. - Number formats must be sequential. Random (UID) number formats can't be used.
Statuses
The status follows the payments and documents recorded on the invoice. Through the API, you can only set:
| Status | Effect |
|---|---|
Draft | Keeps the invoice as a draft. Not allowed once issued. |
Pending | Issues the invoice. |
Paid | Issues the invoice and records its balance as a payment. |
Other statuses are reached by recording a payment, a refund (credit note), or a cancellation.
Issued Invoices
- An issued invoice is read-only: its number, dates, customer, items, taxes, totals, and texts can't change. The
slugandtagsstay editable. - An issued invoice can't be deleted. To void it, cancel it instead: this issues a cancellation credit note for its full amount.
- Issued credit notes are read-only too and can't be deleted.
- Disabling e-invoicing later doesn't change documents that are already issued.
Unsupported Features
- Late fees aren't available once e-invoicing is enabled.
- Payment fees (surcharge) aren't available for e-invoicing. See Card surcharge: what to know.
Both would change the amount due after the e-invoice is issued.
Using the API
Set Up a Customer
Set the customer's standard with the eInvoice parameter.
{
"billTo": {
"company": "ACME",
"email": "billing@example.com",
"address": "1 Example Street",
"city": "Berlin",
"postalCode": "10115",
"country": "DE"
},
"tax": {
"name": "VAT ID",
"id": "DE123456789"
},
"reference": "04011000-12345-67",
"eInvoice": {
"standard": "XRechnung"
}
}
Create an E-Invoice
Set one tax on each item. Use exemption for 0% VAT treatments.
{
"customer": "CUSTOMER_ID",
"items": [
{
"name": "Consulting",
"quantity": 10,
"price": 150,
"taxes": [{ "name": "VAT", "value": 19 }]
},
{
"name": "Training (exempt)",
"quantity": 1,
"price": 500,
"taxes": [
{
"name": "VAT",
"value": 0,
"exemption": "Exempt",
"exemptionReason": "Exempt under § 4 Nr. 21 UStG"
}
]
}
],
"status": "Pending"
}
Leave out status (or send Draft) to create a draft, then issue it later.