# No shipments created for placed sales orders in Litium 8

**URL:** <https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776>\
**Category:** Questions\
**Tags:** accelerator, klarna, litium-8\
**Created:** [December 2, 2022, 3:01pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776 "2022-12-02T15:01:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdxperbol](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/kdxperbol/32/513_2.png) [@kdxperbol](https://forum.litium.com/u/kdxperbol)\
**Post date:** [December 2, 2022, 3:01pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/1 "2022-12-02T15:01:00Z")

</div>

In Litium 7, when using Klarna and Klarna Shipping, a delivery/shipment is automatically created with state INIT when an order is placed.

In Litium 8, when using the Klarna App and Klarna Shipping, **no shipments are created when orders are placed**.

Is this how it’s supposed to be?

And if so, how are shipments supposed to get created? Or are sales orders in Litium 8 supposed to be shipment-less when using Klarna Shipping?

We are using the Klarna App, and the Direct Shipment App, and everything works fine. But no Shipments are created.

Litium version: 8.6.1 + Accelerator + Klarna App + Klarna Shipping

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [December 2, 2022, 9:42pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/2 "2022-12-02T21:42:54Z")

</div>

In Litium 8 the ShippingInfo (`SalesOrder.ShippingInfo`) on the order is set during the checkout. When the package is ready to be delivered the shipment is created in Litium and when the shipment is ready to be sent, the payment app will be notified for the capture process. [Order fulfillment (litium.com)](https://docs.litium.com/documentation/litium-platform/sales-area/order-fulfillment)

---

<div class="post-metadata">

**Author:** ![kdxperbol](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/kdxperbol/32/513_2.png) [@kdxperbol](https://forum.litium.com/u/kdxperbol)\
**Post date:** [December 2, 2022, 9:56pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/3 "2022-12-02T21:56:40Z")

</div>

So what should we do in code to tell Litium that

- the package is ready to be delivered, and that
- the shipment is ready to be sent

?

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [December 2, 2022, 11:23pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/4 "2022-12-02T23:23:34Z")

</div>

On the [Order fulfillment (litium.com)](https://docs.litium.com/documentation/litium-platform/sales-area/order-fulfillment) you have a link right after the first image for the order fullfilment flow that take you to [Business processes (litium.com)](https://docs.litium.com/documentation/litium-connect/domain-areas/erp-domain/business-processes).

On the business processes page, you have the [Order fulfilment process - Main flow (litium.com)](https://docs.litium.com/documentation/litium-connect/domain-areas/erp-domain/business-processes/order-fulfilment-process-main-flow) and [Order fullfilment process - Alternative flow (litium.com)](https://docs.litium.com/documentation/litium-connect/domain-areas/erp-domain/business-processes/order-fullfilment-process-alternative-flow) that describes the process and what endpoints that should be executed.

It’s also possible to use the `Litium.Sales.ShipmentManager` directly in the code to create the shipment, and then using the state engine to move the shipment into the `Shipped` state.

---

<div class="post-metadata">

**Author:** ![kdxperbol](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/kdxperbol/32/513_2.png) [@kdxperbol](https://forum.litium.com/u/kdxperbol)\
**Post date:** [December 8, 2022, 10:35pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/5 "2022-12-08T22:35:50Z")

</div>

Thanks. We are not using Litium Connect or ERP Connect, so much of those examples don’t really apply.

**I can’t get creating a shipment from code to work.**

```
    var shipment = await _shipmentManager.Create(salesOrder.SystemId,
        new CreateShipmentArgs
        {
            Rows = salesOrder.Rows.Where(salesOrderRow => salesOrderRow.OrderRowType == OrderRowType.Product)
                .Select(salesOrderRow => new ProductToShipRow
                {
                    Quantity = salesOrderRow.Quantity,
                    ArticleNumber = salesOrderRow.ArticleNumber
                }).ToList(),
            ShippingMethod = salesOrder.ShippingInfo.First().ShippingOption.OptionId,
            Address = salesOrder.ShippingInfo.First().ShippingAddress,
        }
        );
    var stateTransitionResult1 = _stateTransitionsService.SetState<Shipment>(
        shipment.SystemId,
        ShipmentState.Processing
        );

```

The `Shipment` is created, and has a `SystemId` (but no `Id`) and a `OrderSystemId`. But the `SetState` fails with `Success=false` but no exceptions or validation errors, so the `Shipment` is never moved to Processing. And in the Sales UI, no Shipment shows up on the sales order under “Deliveries”, so I can’t see the shipment anywhere in the UI.

If I use an incorrect `ShippingMethod` I get an exception when creating the shipment.

The `ShippingProvider` is `DirectShipment`.

**How exactly do you create a `Shipment` from code?**

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [December 9, 2022, 11:19am UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/6 "2022-12-09T11:19:32Z")

</div>

The `ShipmentManager` is not persisting the shipment so when you try to set the state the platform is not finding the shipment.

Try to store the shipment with the `Create` method on `Litium.Sales.ShipmentService` before setting the new state.

---

<div class="post-metadata">

**Author:** ![kdxperbol](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/kdxperbol/32/513_2.png) [@kdxperbol](https://forum.litium.com/u/kdxperbol)\
**Post date:** [December 9, 2022, 3:26pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/7 "2022-12-09T15:26:43Z")

</div>

Thank you. Everything works fine now.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [January 6, 2023, 3:27pm UTC](https://forum.litium.com/t/no-shipments-created-for-placed-sales-orders-in-litium-8/2776/8 "2023-01-06T15:27:08Z")

</div>

Closed on January 6, 2023, 3:27pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
