Sending an Invoice
The day-to-day flow for generating a PEPPOL e-document from a Sales Invoice. Connection to the PEPPOL network is handled by a service provider; this page covers the EDocument side.
Prerequisites
- Code lists imported (see Getting Started)
- Company has Electronic Address Scheme + Electronic Address
- Customer has Electronic Address Scheme + Electronic Address (or a fallback email)
- For each invoice item: a UOM mapped to UN/ECE Rec 20, a tax setup that resolves to a UNCL 5305 code
Step 1 — Create the Sales Invoice
Create your Sales Invoice as usual. The EDocument Profile defaults from the Customer if set; otherwise, set it on the invoice manually. The Customer Purchase Order field is mapped to BuyerReference in the PEPPOL XML — required by many customer accounts-payable systems.
Step 2 — EDocument creation
Depending on the profile's Sales Invoice Settings:
- On Save: EDocument record is created when the draft is saved — useful for previewing before submit.
- On Submit (production default): EDocument record is created automatically on submit. If validation fails, submission is blocked.
You can also create an EDocument manually:
- EDocument → New
- Source Type: "Sales Invoice"
- Source Document: the Sales Invoice name
- EDocument Profile: "PEPPOL"
Step 3 — Generate XML
On the EDocument record, click Generate XML. The app:
- Builds UBL 2.1 XML from the source invoice
- Validates the XML against the XSD schema
- Validates business rules using PEPPOL Schematron
- Attaches the XML file to the EDocument
If validation fails, the EDocument status becomes "Validation Failed" and the error is shown. Common causes:
- XSD schema violations — element order, missing required fields
- Schematron business rule violations (BR-CO-15, BR-CO-17, …)
- Missing required codes (no UNCL 5305 mapped) or invalid values
Step 4 — Preview
Click Preview EDocument to view the rendered HTML. The preview uses XSLT to transform the UBL XML into a human-readable invoice, useful for verifying content before transmission.
Step 5 — Transmit
With a service provider configured, click Transmit via API. The integration app handles the network handoff and updates the EDocument with a transmission ID and tracking reference.
Fields included in the XML
| Category | Fields |
|---|---|
| Header | Invoice type, number, date, due date (invoices only), currency, BuyerReference |
| Parties | Company / Customer name, address, tax ID, electronic address |
| Lines | Item name, description, quantity, rate, net amount, tax rate per line |
| Taxes | Rate, amount, taxable amount, exemption codes |
| Payment | Bank account (IBAN + BIC), payment terms |
| Totals | Line extension amount, tax exclusive, tax inclusive, payable amount |
| Allowances | Document-level discounts and allowances |
Credit Notes
Set is_return = 1 on the Sales Invoice. The app automatically:
- Uses
CreditNoteroot XML element instead ofInvoice - Uses
CreditNoteTypeCodeinstead ofInvoiceTypeCode - Uses
CreditNoteLineinstead ofInvoiceLine - Excludes
DueDate(credit notes don't have one) - Includes
BillingReferencepointing at the original invoice - Validates against the CreditNote XSD
External validation
For extra safety before going live, the PEPPOL Validation Service accepts any UBL 2.1 file and runs the official rules. Your service provider's dashboard typically does this too.