Error Handling

Configure how the extension handles E-Invoice generation failures.

Blocking Document Creation on Error

The primary “hard stop” control is blocking document creation when E-Invoice generation fails.

Configuration

Go to Stores >Configuration > MageB2B > E-Invoice:

SettingBehavior
Invoice Settings → Block Invoice on E-Invoice ErrorPrevent invoice creation if generation fails
Credit Memo Settings → Block Credit Memo on E-Invoice ErrorPrevent credit memo creation if generation fails

Error Types

Validation Errors

E-Invoice doesn't meet format requirements:

  • Missing required fields (VAT ID, etc.)
  • Invalid data formats
  • XSD schema violations

Generation Errors

Technical failures during generation:

  • PDF generation failed
  • XML creation error
  • File storage error

Configuration Errors

Missing or invalid configuration:

  • Company data incomplete
  • Invalid IBAN/BIC format
  • Missing seller contact details (XRechnung BR-DE-2)

Error Notifications

Enable Notifications

Stores >Configuration > MageB2B > E-Invoice > Validation & Error Handling:

SettingDescriptionDefault
Enable Error NotificationsSend email on failuresNo
Error Notification EmailRecipient address-
Error Notification ThresholdSend after X consecutive failures3

Notification Contents

Email includes:

  • Invoice increment ID
  • Error message
  • Timestamp
  • Store view
  • Link to invoice in admin

Batch Error Notifications

For cron/queue modes, batch notifications are sent:

  • After configured threshold is reached
  • Summary of all failed invoices
  • Individual error details

Error Recovery

Manual Retry

  1. Go to Sales >Invoices
  2. Open the failed invoice
  3. Click Generate E-Invoice

For credit memos, use Sales >Credit Memos and run Generate E-Invoice from the document view.

Mass Retry

  1. Go to Sales >Invoices
  2. Filter by status "error"
  3. Select invoices
  4. Choose Generate E-Invoice (mass action)

Common Errors

"VAT ID is required"

Cause: Company VAT ID not configured

Solution: Configure VAT ID in E-Invoice settings

"Invalid IBAN format"

Cause: IBAN doesn't pass validation

Solution: Verify IBAN is correct with country prefix

"Leitweg-ID missing"

Cause: This extension does not require a Leitweg-ID for XRechnung generation (B2B usage). If you need B2G submission requirements (Leitweg-ID, routing, portals), handle that in your integration layer.

Solution: Verify required company/contact data and validate the generated XML with your target receiver rules.

"PDF generation failed"

Cause: Magento PDF renderer error

Solution:

  • Check Magento's standard PDF works
  • Verify all fonts are available
  • Check PHP memory limits

"XSD validation failed"

Cause: XML doesn't match schema

Solution:

  • Check all required fields are filled
  • Verify data formats
  • Review validation error details

Logging

Log Location

The extension writes to Magento’s standard logs:

  • var/log/system.log
  • var/log/exception.log

Log Contents

  • Generation start/end
  • Validation steps
  • File operations
  • Error stack traces (when exceptions occur)

Best Practices

  1. Keep Block on Error disabled while you validate your setup
  2. Enable notifications in production
  3. Enable Retry Failed Generations to auto-recover transient issues

Found an issue with this documentation? Let us know