nopSolutions/nopCommerce · error · Exception

This shipment is can't be shipped. The order has been placed

Error message

This shipment is can't be shipped. The order has been placed with 'pickup in store' shipping option.

What it means

Thrown by ShipAsync when the order was placed with the 'pickup in store' shipping option. Such orders have no physical shipment to send - the customer collects from the store - so calling Ship is a domain violation. Uses plain Exception.

Source

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

            return false;

        return true;
    }

    /// <summary>
    /// Send a shipment
    /// </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 ShipAsync(Shipment shipment, bool notifyCustomer)
    {
        ArgumentNullException.ThrowIfNull(shipment);

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

        if (order.PickupInStore)
            throw new Exception("This shipment is can't be shipped. The order has been placed with 'pickup in store' shipping option.");

        if (shipment.ShippedDateUtc.HasValue)
            throw new Exception("This shipment is already shipped");

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

        //process products with "Multiple warehouse" support enabled
        await BookReservedInventoryAsync(shipment, string.Format(await _localizationService.GetResourceAsync("Admin.StockQuantityHistory.Messages.Ship"), shipment.OrderId));

        //check whether we have more items to ship
        if (await _orderService.HasItemsToAddToShipmentAsync(order) || await _orderService.HasItemsToShipAsync(order))
            order.ShippingStatusId = (int)ShippingStatus.PartiallyShipped;
        else
            order.ShippingStatusId = (int)ShippingStatus.Shipped;
        await _orderService.UpdateOrderAsync(order);

        //add a note

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. For pickup orders, call ReadyForPickupAsync instead of ShipAsync.
  2. In the admin/API layer, branch on order.PickupInStore to choose the correct action.
  3. Hide/disable the Ship button in the UI for pickup-in-store orders.

Example fix

// before
await _orderProcessingService.ShipAsync(shipment, notify);

// after
if (order.PickupInStore)
    await _orderProcessingService.ReadyForPickupAsync(shipment, notify);
else
    await _orderProcessingService.ShipAsync(shipment, notify);
Defensive patterns

Strategy: validation

Validate before calling

var order = await _orderService.GetOrderByIdAsync(shipment.OrderId);
if (order is null)
    return BadRequest("Order not found.");
if (order.PickupInStore)
    return BadRequest("Cannot ship a pickup-in-store order; use ReadyForPickupAsync.");

await _orderProcessingService.ShipAsync(shipment, notifyCustomer);

Type guard

async Task<bool> IsShippableAsync(Shipment shipment)
{
    var order = await _orderService.GetOrderByIdAsync(shipment.OrderId);
    return order is not null && !order.PickupInStore;
}

Try / catch

try
{
    await _orderProcessingService.ShipAsync(shipment, notifyCustomer);
}
catch (Exception ex) when (ex.Message.Contains("pickup in store"))
{
    // route to the correct action
    await _orderProcessingService.ReadyForPickupAsync(shipment, notifyCustomer);
}

Prevention

When it happens

Trigger: Admin UI or API marks a shipment as shipped for an order where order.PickupInStore == true. Typically a workflow mistake: the operator used the wrong action (Ship instead of ReadyForPickup) on a pickup order.

Common situations: Operator confusion between Ship and ReadyForPickup actions; custom fulfilment integration calling Ship unconditionally for all shipments; mixed-mode orders handled by a single code path.

Related errors


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