nopSolutions/nopCommerce · error · NopException
Country '{billingCountry.Name}' is not allowed for billing
Error message
Country '{billingCountry.Name}' is not allowed for billing What it means
Thrown when the country resolved from the billing address has AllowsBilling=false, meaning the store does not accept billing from that country. This is a business/policy restriction enforced at order placement to prevent orders from regions where the store cannot legally or operationally process payments.
Source
Thrown at src/Libraries/Nop.Services/Orders/OrderProcessingService.cs:553
/// Prepare and validate billing address
/// </summary>
/// <param name="details">PlaceOrder container</param>
/// <returns>A task that represents the asynchronous operation</returns>
/// <exception cref="NopException">Validation problems</exception>
protected virtual async Task PrepareAndValidateBillingAddressAsync(PlaceOrderContainer details)
{
if (details.Customer.BillingAddressId is null)
throw new NopException("Billing address is not provided");
var billingAddress = await _customerService.GetCustomerBillingAddressAsync(details.Customer);
if (!CommonHelper.IsValidEmail(billingAddress?.Email))
throw new NopException("Email is not valid");
details.BillingAddress = _addressService.CloneAddress(billingAddress);
if (await _countryService.GetCountryByAddressAsync(details.BillingAddress) is Country billingCountry && !billingCountry.AllowsBilling)
throw new NopException($"Country '{billingCountry.Name}' is not allowed for billing");
}
/// <summary>
/// Prepare and validate customer
/// </summary>
/// <param name="details">PlaceOrder container</param>
/// <param name="processPaymentRequest">payment info holder</param>
/// <param name="currentCurrency">The working currency</param>
/// <returns>A task that represents the asynchronous operation</returns>
/// <exception cref="NopException">Validation problems</exception>
protected virtual async Task PrepareAndValidateCustomerAsync(PlaceOrderContainer details, ProcessPaymentRequest processPaymentRequest, Currency currentCurrency)
{
details.Customer = await _customerService.GetCustomerByIdAsync(processPaymentRequest.CustomerId);
if (details.Customer == null)
throw new ArgumentException("Customer is not set");
//check whether customer is guest
View on GitHub (pinned to 64bdf2ff08)
Solutions
- In admin (Configuration > Countries), enable 'Allows billing' for the customer's billing country.
- If billing is intentionally blocked for that country, inform the customer and suggest using an address in a supported country.
- Add checkout-time filtering so billing address country options only show AllowsBilling countries.
- After policy changes, audit customer address books for now-restricted countries and notify affected users.
Example fix
// before (admin): country.AllowsBilling = false // after: country.AllowsBilling = true; await _countryService.UpdateCountryAsync(country);
Defensive patterns
Strategy: validation
Validate before calling
// Before PlaceOrder, check if the billing country allows billing
var billingAddress = await _customerService.GetCustomerBillingAddressAsync(customer);
var country = await _countryService.GetCountryByAddressAsync(billingAddress);
if (country != null && !country.AllowsBilling)
{
_notificationService.ErrorNotification(
$"We don't accept billing from {country.Name}. Please choose another address.");
return RedirectToRoute("CheckoutBillingAddress");
} Type guard
async Task<bool> CountryAllowsBillingAsync(ICountryService svc, Address addr)
{
var c = await svc.GetCountryByAddressAsync(addr);
return c == null || c.AllowsBilling;
} Try / catch
try
{
var result = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest);
}
catch (NopException ex) when (ex.Message.Contains("is not allowed for billing"))
{
_notificationService.ErrorNotification(ex.Message);
return RedirectToRoute("CheckoutBillingAddress");
} Prevention
- Filter the billing address country dropdown to only show countries where AllowsBilling=true.
- When disabling billing for a country, notify affected customers with existing addresses there.
- Audit country settings after any policy change to ensure intended countries are enabled.
- Add a billing-step validation that blocks proceeding if the selected country doesn't allow billing.
When it happens
Trigger: The customer's billing address country is marked as 'not allowed for billing' in Configuration > Countries. The country's AllowsBilling flag was set to false (the default for newly created countries) and was never enabled.
Common situations: Admin created a new country record but didn't enable AllowsBilling. A country was disabled for billing due to fraud prevention or regulatory reasons, but existing customers still have addresses there. Fresh install where only a subset of countries have AllowsBilling enabled. Tax/compliance policy change that restricted billing countries.
Related errors
- Country '{shippingCountry.Name}' is not allowed for shipping
- Checkout.MinOrderSubtotalAmount
- Checkout.MinOrderTotalAmount
- Anonymous checkout is not allowed
- recurringCyclesError
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/b57a9cb026b55cfc.
Report an issue: GitHub.