nopSolutions/nopCommerce · error · NopException

Shipping address is not provided

Error message

Shipping address is not provided

What it means

Thrown during shipping address validation when the customer's ShippingAddressId is null (not set) and the order is not a pickup-in-store order. The PlaceOrder flow requires a shipping destination to compute rates and deliver goods, so a missing address is a hard failure.

Source

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

                var country = await _countryService.GetCountryByTwoLetterIsoCodeAsync(pickupPoint.CountryCode);
                var state = await _stateProvinceService.GetStateProvinceByAbbreviationAsync(pickupPoint.StateAbbreviation, country?.Id);

                details.PickupInStore = true;
                details.PickupAddress = new Address
                {
                    Address1 = pickupPoint.Address,
                    City = pickupPoint.City,
                    County = pickupPoint.County,
                    CountryId = country?.Id,
                    StateProvinceId = state?.Id,
                    ZipPostalCode = pickupPoint.ZipPostalCode,
                    CreatedOnUtc = DateTime.UtcNow
                };
            }
            else
            {
                if (details.Customer.ShippingAddressId == null)
                    throw new NopException("Shipping address is not provided");

                var shippingAddress = await _customerService.GetCustomerShippingAddressAsync(details.Customer);

                if (!CommonHelper.IsValidEmail(shippingAddress?.Email))
                    throw new NopException("Email is not valid");

                //clone shipping address
                details.ShippingAddress = _addressService.CloneAddress(shippingAddress);

                if (await _countryService.GetCountryByAddressAsync(details.ShippingAddress) is Country shippingCountry && !shippingCountry.AllowsShipping)
                    throw new NopException($"Country '{shippingCountry.Name}' is not allowed for shipping");
            }

            var shippingOption = await _genericAttributeService.GetAttributeAsync<ShippingOption>(details.Customer,
                NopCustomerDefaults.SelectedShippingOptionAttribute, processPaymentRequest.StoreId);
            if (shippingOption != null)
            {
                details.ShippingMethodName = shippingOption.Name;

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. Ensure the customer completes the shipping address checkout step before payment is submitted.
  2. In a custom integration, set the shipping address via ICustomerService.AddCustomerAddressAsync and assign Customer.ShippingAddressId before calling PlaceOrder.
  3. For digital/downloadable goods, verify the cart is correctly flagged so shipping is not required.
  4. Add a UI check on the payment page that redirects to the shipping step if no shipping address is set.

Example fix

// before: PlaceOrder called with customer.ShippingAddressId == null
// after:
await _customerService.AddCustomerAddressAsync(customer, address);
customer.ShippingAddressId = address.Id;
await _customerService.UpdateCustomerAsync(customer);
Defensive patterns

Strategy: validation

Validate before calling

// Before PlaceOrder, confirm the customer has a shipping address
if (!details.PickupInStore && customer.ShippingAddressId == null)
{
    _notificationService.ErrorNotification("Please provide a shipping address.");
    return RedirectToRoute("CheckoutShippingAddress");
}

Type guard

bool HasShippingAddress(Customer c) => c.ShippingAddressId.HasValue;

Try / catch

try
{
    var result = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest);
}
catch (NopException ex) when (ex.Message == "Shipping address is not provided")
{
    return RedirectToRoute("CheckoutShippingAddress");
}

Prevention

When it happens

Trigger: The customer reached PlaceOrder without completing the shipping address step, the ShippingAddressId was cleared from the customer record between checkout steps, or a programmatic/recurring order request was constructed without setting the address attribute.

Common situations: Customer navigated directly to the payment step bypassing the shipping step via a deep link or custom integration. A guest customer's session expired and the address association was lost. A custom checkout flow or API integration that calls PlaceOrder without first persisting the shipping address. Digital-only cart where shipping shouldn't be required but PickupInStore flag wasn't set.

Related errors


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