Generation Modes

The E-Invoice extension supports multiple generation modes to fit different business scenarios. These modes apply to invoices and, when enabled, to credit memos.

Overview

ModeProcessingBest For
Disabled (Manual Only)No automatic generationFully manual workflows
ImmediateDuring invoice saveLow volume, real-time needs
QueuedMessage queue backgroundMedium volume, async processing
Cron HourlyScheduled batch processingHigh volume, continuous batching
Cron DailyScheduled batch processingBatch windows (e.g. nightly)

Immediate Mode

E-invoices are generated synchronously when an invoice is created.

How It Works

  1. Admin creates invoice
  2. E-invoice is generated immediately
  3. Files are saved to storage
  4. Invoice status is updated
  5. Invoice save completes

Pros & Cons

ProsCons
Instant feedbackSlows invoice creation
Real-time statusNot suitable for high volume
Simple setupErrors block invoice (if configured)

Configuration

Stores >Configuration > MageB2B > E-Invoice > Invoice Settings Generation Mode: Immediate

Queued Mode

E-invoices are added to a message queue for background processing.

How It Works

  1. Admin creates invoice
  2. Generation request is queued
  3. Invoice save completes immediately
  4. Background consumer processes queue
  5. Status is updated asynchronously

Requirements

  • Magento Message Queue configured
  • Queue consumer running:
php bin/magento queue:consumers:start mageb2b.einvoice.generate

Pros & Cons

ProsCons
Non-blocking invoice creationRequires queue setup
ScalableDelayed status updates
Error isolationMore complex monitoring

Configuration

Stores >Configuration > MageB2B > E-Invoice > Invoice Settings Generation Mode: Queued

Cron Hourly Mode

E-invoices are generated in batches by a scheduled cron job.

How It Works

  1. Admin creates invoice
  2. Invoice is marked as "pending" e-invoice
  3. Hourly cron runs
  4. Pending invoices are processed in batch
  5. Status is updated

Schedule

The cron runs every hour at minute 0:

0 * * * * # Every hour

Pros & Cons

ProsCons
Best for high volumeUp to 1 hour delay
No queue infrastructureLess real-time visibility
Batch efficiencyErrors accumulate

Configuration

Stores >Configuration > MageB2B > E-Invoice > Invoice Settings Generation Mode: Cron Hourly

Cron Daily Mode

Cron Daily is also a batch mode, but with a daily schedule (default: 0 2 * * *).

  • Useful when you want a controlled batch window (e.g. after business hours)
  • Supports a Daily Cron Batch Size setting

Disabled / Manual Only

If you choose Disabled - Manual Only, the extension will not automatically generate E-Invoices.

You can still generate manually via:

  • Admin document view action (“Generate E-Invoice”)
  • Admin mass action (“Generate E-Invoice”)
  • CLI command (einvoice:generate)
  • REST API endpoint (POST /V1/einvoice/invoice/{invoiceId}/generate)

Choosing a Mode

Use Immediate When:

  • Processing < 100 invoices/day
  • Real-time status is important
  • Errors should immediately block workflow

Use Queued When:

  • Processing 100-1000 invoices/day
  • You have message queue infrastructure
  • Non-blocking invoice creation is important

Use Cron Hourly When:

  • Processing >1000 invoices/day
  • Batch processing is acceptable
  • Simple infrastructure is preferred

Status Values

StatusMeaning
pendingWaiting for generation (queued/cron modes)
generatedSuccessfully generated
errorGeneration failed
disabledE-invoicing disabled for this invoice

Monitoring

Check Pending Invoices

From admin: Sales >Invoices → Filter by e-invoice status "pending"

Logs

Check Magento logs for generation details:

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

Found an issue with this documentation? Let us know