Order fulfillment process - Main flow

A common order fulfillment flow is for ERP system to pack the items for an order, hand it over to the delivery company, and then capture the money for it. This section describes this main flow.

Fullfilling an order

When the ERP system has handed over a delivery package to the shipping provider company, call the following endpoint first to register the shipment and capture money for it.


When a shipment is created, following steps are taken in Litium.

  1. Create the appropriate delivery with delivery rows (if a partial shipment Litium automatically calculates the shipment value)
  2. Litium captures the amount due from customer. (If the funds are already reserved).
    Important In Litium 7 Accelerator previous releases, the payment is captured when a delivery is set to delivered from accelerator state transitions, in the DeliveryStateBuilder.cs . This should  not be done now, since Litium Connect is managing the payment capture. The correct code should be as follows when going to Delivered state should not have any payment captures.
    var delivered = new State<DeliveryCarrier>((short)DeliveryState.Delivered,
    (deliveryCarrier, currentState, token) =>
    //_orderUtilities.CompletePayments(ModuleECommerce.Instance.Orders[deliveryCarrier.OrderID, token], token);


In this flow, the ERP system is not waiting to know whether capture has succeeded or not. Therefore, after the abvoe call to create the shipment, call the following endpoint, to notify Litium that the order is handedover to the delivery company.


Litium will set the delivery status to "Delivered" when the above end-point is called.

Process diagram

The sequence diagrams visualize the flow for a confirmed order from the time a customer places the order, to ERP and when the customer receives a delivery confirmation e-mail.

Prerequisites: A webhook registration to OrderConfirmed event is required for this flow (Step 1 and 1.1)

More details on webhook registration

Sequence of events:

  • The customer places the order (Step 2).
  • Litium Connect sends the order to ERP (Step 2.1 and 3).
    • Connect APP listens to the Order confirmed event.
    • When the order is delivered to ERP, Connect APP notifies back (acknowledgement, OrderExportedToErp)(Step 4, 4.1, 4.2)
  • ERP
    • Picks items from the warehouse (Picked state)
    • Packs items and hands over to the delivery company. (Delivered state)
    • ERP notifies Litium through Litium Connect App (CreateShipment) - (Step 3 - Diagram 2)
      • Litium creates shipment and notifies ERP system back. The ERP system has already delivered it. (Steps through
    • Litium Connect APP notifies Litium NotifyOrderDelivered. Without waiting for the ReadyToShip notification from Litium. (Steps 5 through 5.1.1)
  • PaymentCaptureFailed is a webhook event that ERP Apps can hook in to for taking necessary action.

Application listens to ReadyToShip event in Litium Connect : 


Fullfilment process :

Fullfillment Main flow.PNG


More details on Connect API documentation.