Log in
Factory

ShipmentDocumentFactory

Magento\Sales\Model\Order\ShipmentDocumentFactory

What it does

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

Developers use it when programmatically creating shipments, as it handles the complex logic of converting order items to shipment items, adding tracking information, comments, and processing extension attributes.

It's particularly useful in custom shipping workflows or automated fulfillment systems.

Public Methods

  • create()