Configuration Guide
Configure the extension at Stores >Configuration > MageB2B > E-Invoice.
Screenshot placeholder: resources/kb/e-invoice/_screenshots/admin-config-einvoice.png
General Settings
| Setting | Default | Notes |
|---|
| Enable E-Invoicing | No | Master switch per store view |
| Default B2B Format | ZUGFeRD | Used as the default invoice format |
Invoice Settings
| Setting | Default | Notes |
|---|
| Generation Mode | Immediate | disabled, immediate, queued, cron_hourly, cron_daily |
| Generation Trigger | On Invoice Creation | invoice_create, invoice_pay, manual_only |
| Document Type Code | 380 | UN/CEFACT invoice document type |
| Block Invoice on E-Invoice Error | No | If enabled, invoice creation is blocked on generation failures |
| Attach E-Invoice to Invoice Email | No | Attaches XML/PDF to the invoice email |
| Attachment Strategy | auto | auto, xml_only, pdf_only, both |
| Daily Cron Batch Size | 100 | Only relevant for cron_daily |
| Invoice Filename Pattern | invoice-{invoice_increment_id}-{format}.{type} | See “Filename Variables” |
Credit Memo Settings
Credit memo generation is disabled by default and must be enabled per store view.
| Setting | Default | Notes |
|---|
| Enable Credit Memo E-Invoicing | No | Required to show actions on credit memo view |
| Generation Mode | Immediate | Same options as invoices |
| Generation Trigger | On Credit Memo Creation | creditmemo_create, manual_only |
| Document Type Code | 381 | UN/CEFACT credit memo type |
| Block Credit Memo on E-Invoice Error | No | If enabled, credit memo creation is blocked on generation failures |
| Attach E-Invoice to Credit Memo Email | No | Attaches XML/PDF to the credit memo email |
| Attachment Strategy | auto | auto, xml_only, pdf_only, both |
| Daily Cron Batch Size | 100 | Only relevant for cron_daily |
| Credit Memo Filename Pattern | creditmemo-{creditmemo_increment_id}-{format}.{type} | See “Filename Variables” |
Note: Credit memos support ZUGFeRD and XRechnung formats.
Document Storage
| Setting | Default | Notes |
|---|
| Storage Strategy | Permanent Storage | permanent or on_demand |
| File Storage Path | einvoice | Relative to pub/media/ |
Storage locations (default settings):
- Invoices:
pub/media/einvoice/ - Credit memos:
pub/media/einvoice/creditmemo/
Filename Variables
Use these variables in filename patterns:
| Variable | Invoice | Credit Memo |
|---|
{invoice_increment_id} | ✓ | - |
{creditmemo_increment_id} | - | ✓ |
{order_increment_id} | ✓ | ✓ |
{format} | ✓ | ✓ |
{type} | ✓ (xml/pdf) | ✓ (xml/pdf) |
{date} | ✓ (YYYY-MM-DD) | ✓ (YYYY-MM-DD) |
These values are used for all formats (invoices and credit memos):
| Field | Notes |
|---|
| VAT ID | Required |
| Tax Number | Required for German formats |
| Company Registration Number | HRB/HRA |
| SIRET Number | Required for Factur-X (France) |
| Bank IBAN / Bank BIC/SWIFT | Used in payment instructions |
| Default Payment Terms (Days) | Optional |
| Seller Contact (Name/Phone/Email) | Required for XRechnung (BR-DE-2) |
Payment Terms Mapping
Use this section to map payment-method-specific terms and payment means codes.
| Setting | Notes |
|---|
| Default Payment Terms Template | Supports {due_days}, {due_date}, {invoice_date}, {payment_method} |
| Default Payment Means Code | Example: 58 (SEPA transfer), 59 (SEPA direct debit) |
| Default Payment Means Code (No IBAN) | Fallback when no IBAN is configured (example: 1) |
| Payment Method Mapping | Override terms and means code per payment method |
Accounting
Use this section to provide line-level accounting references (BT-133).
| Setting | Notes |
|---|
| Accounting Source Type | none, order_item_field, product_attribute, customer_attribute |
| Order Item Field | Selectable when source type is order_item_field |
| Product Attribute | Selectable when source type is product_attribute |
| Customer Attribute | Selectable when source type is customer_attribute |
Validation & Error Handling
| Setting | Default | Notes |
|---|
| Validation Level | Standard | minimal, standard, strict |
| Strict XSD Validation | No | Enables strict schema validation |
| Enable Error Notifications | No | Sends emails on failures |
| Error Notification Email | (empty) | Required when notifications are enabled |
| Error Notification Threshold | 3 | Consecutive failures before sending |
| Retry Failed Generations | Yes | Retries failures via cron job |
| Max Retry Attempts | 3 | Per invoice/credit memo |
REST API Settings
| Setting | Default | Notes |
|---|
| Include E-Invoice in Invoice API | No | Adds einvoice_xml and einvoice_pdf to GET /V1/invoices/{id} |
| Include E-Invoice in Credit Memo API | No | Adds einvoice_xml and einvoice_pdf to GET /V1/creditmemos/{id} |
See: REST API
ZUGFeRD / Factur-X Configuration
| Setting | Notes |
|---|
| ZUGFeRD Profile | Applies to invoices and credit memos |
XRechnung Configuration
| Setting | Default | Notes |
|---|
| XRechnung Version | 3.0 | 2.2, 2.3, 3.0 |
Configuration Testing
Use the built-in buttons:
- Test Configuration
- Test XSD Schemas
- Test Company Data