Log in
Factory

InvoiceDocumentFactory

Magento\Sales\Model\Order\InvoiceDocumentFactory

What it does

This factory class creates invoice documents for orders in Magento 2.

Developers use it when programmatically generating invoices, as it prepares the invoice with specified items, quantities, and optional comments.

It serves as a convenient wrapper around the InvoiceService to simplify invoice creation with proper data structure conversion.

Public Methods

  • create()