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
- Ensure the customer completes the shipping address checkout step before payment is submitted.
- In a custom integration, set the shipping address via ICustomerService.AddCustomerAddressAsync and assign Customer.ShippingAddressId before calling PlaceOrder.
- For digital/downloadable goods, verify the cart is correctly flagged so shipping is not required.
- 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
- On the payment checkout step, check customer.ShippingAddressId and redirect to the shipping step if null.
- For custom integrations, always set ShippingAddressId or mark PickupInStore before calling PlaceOrder.
- Implement a checkout progress guard that validates each step's prerequisites before allowing the next.
- For guest checkout, ensure the entered address is persisted to the customer record before payment.
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
- Email is not valid
- Cart is empty
- {warning1};{warning2};...
- Billing address is not provided
- recurringCyclesError
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/08723d14f37b7c74.
Report an issue: GitHub.