nopSolutions/nopCommerce · error · Exception

This shipment is not shipped yet

Error message

This shipment is not shipped yet

What it means

Thrown by OrderProcessingService.DeliverAsync for a non-pickup order when the shipment has no ShippedDateUtc. It enforces the delivery lifecycle: a normal shipped order must be marked Shipped before it can be marked Delivered. The condition is (!order.PickupInStore && !shipment.ShippedDateUtc.HasValue), so it only applies to standard (non in-store-pickup) shipments.

Source

Thrown at src/Libraries/Nop.Services/Orders/OrderProcessingService.cs:2323

        }

        await _eventPublisher.PublishShipmentReadyForPickupAsync(shipment);
    }

    /// <summary>
    /// Marks a shipment as delivered
    /// </summary>
    /// <param name="shipment">Shipment</param>
    /// <param name="notifyCustomer">True to notify customer</param>
    /// <returns>A task that represents the asynchronous operation</returns>
    public virtual async Task DeliverAsync(Shipment shipment, bool notifyCustomer)
    {
        ArgumentNullException.ThrowIfNull(shipment);

        var order = await _orderService.GetOrderByIdAsync(shipment.OrderId) ?? throw new Exception("Order cannot be loaded");

        if (!order.PickupInStore && !shipment.ShippedDateUtc.HasValue)
            throw new Exception("This shipment is not shipped yet");

        if (order.PickupInStore && !shipment.ReadyForPickupDateUtc.HasValue)
            throw new Exception("This shipment is not yet ready for pickup");

        if (shipment.DeliveryDateUtc.HasValue)
            throw new Exception("This shipment is already delivered");

        shipment.DeliveryDateUtc = DateTime.UtcNow;
        await _shipmentService.UpdateShipmentAsync(shipment);

        if (!await _orderService.HasItemsToAddToShipmentAsync(order) &&
            !await _orderService.HasItemsToShipAsync(order) &&
            !await _orderService.HasItemsToReadyForPickupAsync(order) &&
            !await _orderService.HasItemsToDeliverAsync(order))
        {
            order.ShippingStatusId = (int)ShippingStatus.Delivered;
            await _orderService.UpdateOrderAsync(order);
        }

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. Ensure ShipAsync is called first: if (!order.PickupInStore && !shipment.ShippedDateUtc.HasValue) await _orderProcessingService.ShipAsync(shipment, true);
  2. Inspect shipment.ShippedDateUtc before calling DeliverAsync and surface a meaningful message to the user if it is null.
  3. If the shipment truly was shipped but the date was not recorded, backfill ShippedDateUtc then retry DeliverAsync.
  4. Fix the integration to send events in shipped->delivered order.

Example fix

// before
await _orderProcessingService.DeliverAsync(shipment, true);

// after
if (!order.PickupInStore && !shipment.ShippedDateUtc.HasValue)
    await _orderProcessingService.ShipAsync(shipment, true);

await _orderProcessingService.DeliverAsync(shipment, true);
Defensive patterns

Strategy: validation

Validate before calling

var order = await _orderService.GetOrderByIdAsync(shipment.OrderId);
if (order is null) return;
if (!order.PickupInStore && !shipment.ShippedDateUtc.HasValue)
{
    // must ship first
    return;
}

await _orderProcessingService.DeliverAsync(shipment, true);

Prevention

When it happens

Trigger: Calling DeliverAsync on a standard shipment whose ShipAsync has not been called (or whose ShippedDateUtc is null). Happens when an admin jumps straight to 'Deliver' from the shipment screen, or an integration tries to deliver before the carrier handoff event arrives.

Common situations: Custom order-fulfillment automation that skips the Ship step; a carrier webhook firing the 'delivered' event before the 'shipped' event; admin users clicking Deliver on a freshly created shipment.

Related errors


AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13). Data as JSON: /api/errors/c0268c25d482c519. Report an issue: GitHub.