Configuration Guide

Configure the extension at Stores >Configuration > MageB2B > E-Invoice.

Screenshot placeholder: resources/kb/e-invoice/_screenshots/admin-config-einvoice.png

General Settings

SettingDefaultNotes
Enable E-InvoicingNoMaster switch per store view
Default B2B FormatZUGFeRDUsed as the default invoice format

Invoice Settings

SettingDefaultNotes
Generation ModeImmediatedisabled, immediate, queued, cron_hourly, cron_daily
Generation TriggerOn Invoice Creationinvoice_create, invoice_pay, manual_only
Document Type Code380UN/CEFACT invoice document type
Block Invoice on E-Invoice ErrorNoIf enabled, invoice creation is blocked on generation failures
Attach E-Invoice to Invoice EmailNoAttaches XML/PDF to the invoice email
Attachment Strategyautoauto, xml_only, pdf_only, both
Daily Cron Batch Size100Only relevant for cron_daily
Invoice Filename Patterninvoice-{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.

SettingDefaultNotes
Enable Credit Memo E-InvoicingNoRequired to show actions on credit memo view
Generation ModeImmediateSame options as invoices
Generation TriggerOn Credit Memo Creationcreditmemo_create, manual_only
Document Type Code381UN/CEFACT credit memo type
Block Credit Memo on E-Invoice ErrorNoIf enabled, credit memo creation is blocked on generation failures
Attach E-Invoice to Credit Memo EmailNoAttaches XML/PDF to the credit memo email
Attachment Strategyautoauto, xml_only, pdf_only, both
Daily Cron Batch Size100Only relevant for cron_daily
Credit Memo Filename Patterncreditmemo-{creditmemo_increment_id}-{format}.{type}See “Filename Variables”

Note: Credit memos support ZUGFeRD and XRechnung formats.

Document Storage

SettingDefaultNotes
Storage StrategyPermanent Storagepermanent or on_demand
File Storage PatheinvoiceRelative 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:

VariableInvoiceCredit Memo
{invoice_increment_id}-
{creditmemo_increment_id}-
{order_increment_id}
{format}
{type}✓ (xml/pdf)✓ (xml/pdf)
{date}✓ (YYYY-MM-DD)✓ (YYYY-MM-DD)

Company Information

These values are used for all formats (invoices and credit memos):

FieldNotes
VAT IDRequired
Tax NumberRequired for German formats
Company Registration NumberHRB/HRA
SIRET NumberRequired for Factur-X (France)
Bank IBAN / Bank BIC/SWIFTUsed 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.

SettingNotes
Default Payment Terms TemplateSupports {due_days}, {due_date}, {invoice_date}, {payment_method}
Default Payment Means CodeExample: 58 (SEPA transfer), 59 (SEPA direct debit)
Default Payment Means Code (No IBAN)Fallback when no IBAN is configured (example: 1)
Payment Method MappingOverride terms and means code per payment method

Accounting

Use this section to provide line-level accounting references (BT-133).

SettingNotes
Accounting Source Typenone, order_item_field, product_attribute, customer_attribute
Order Item FieldSelectable when source type is order_item_field
Product AttributeSelectable when source type is product_attribute
Customer AttributeSelectable when source type is customer_attribute

Validation & Error Handling

SettingDefaultNotes
Validation LevelStandardminimal, standard, strict
Strict XSD ValidationNoEnables strict schema validation
Enable Error NotificationsNoSends emails on failures
Error Notification Email(empty)Required when notifications are enabled
Error Notification Threshold3Consecutive failures before sending
Retry Failed GenerationsYesRetries failures via cron job
Max Retry Attempts3Per invoice/credit memo

REST API Settings

SettingDefaultNotes
Include E-Invoice in Invoice APINoAdds einvoice_xml and einvoice_pdf to GET /V1/invoices/{id}
Include E-Invoice in Credit Memo APINoAdds einvoice_xml and einvoice_pdf to GET /V1/creditmemos/{id}

See: REST API

ZUGFeRD / Factur-X Configuration

SettingNotes
ZUGFeRD ProfileApplies to invoices and credit memos

XRechnung Configuration

SettingDefaultNotes
XRechnung Version3.02.2, 2.3, 3.0

Configuration Testing

Use the built-in buttons:

  • Test Configuration
  • Test XSD Schemas
  • Test Company Data

Found an issue with this documentation? Let us know