nopSolutions/nopCommerce · critical · NopException
Merchant PayPal ID not set
Error message
Merchant PayPal ID not set
What it means
Thrown in CreateOrderAsync when settings.MerchantId is null or empty. The MerchantId is PayPal's identifier for the merchant account obtained during onboarding; without it, the order cannot be associated with the correct merchant for payment processing.
Source
Thrown at src/Plugins/Nop.Plugin.Payments.PayPalCommerce/Services/PayPalCommerceServiceManager.cs:1635
/// <param name="settings">Plugin settings</param>
/// <param name="placement">Button placement</param>
/// <param name="paymentSource">Payment source</param>
/// <param name="cardId">Saved card id</param>
/// <param name="saveCard">Whether to save card payment token</param>
/// <returns>
/// A task that represents the asynchronous operation
/// The task result contains the created order; error message if exists
/// </returns>
public async Task<(Order Order, string Error)> CreateOrderAsync(PayPalCommerceSettings settings,
ButtonPlacement placement, string paymentSource, int? cardId, bool saveCard)
{
return await HandleFunctionAsync(async () =>
{
if (!IsConfigured(settings))
throw new NopException("Plugin not configured");
if (string.IsNullOrEmpty(settings.MerchantId))
throw new NopException("Merchant PayPal ID not set");
var details = await PrepareCartDetailsAsync(placement);
var savedPaymentToken = await _tokenService.GetByIdAsync(cardId ?? 0);
if (savedPaymentToken is not null && savedPaymentToken.CustomerId != details.Customer.Id)
throw new NopException("Card details not found");
var isGuest = await _customerService.IsGuestAsync(details.Customer);
var isRecurring = await _shoppingCartService.ShoppingCartIsRecurringAsync(details.Cart);
if (isRecurring)
{
if (!settings.UseVault)
throw new NopException("Vault disabled");
if (isGuest)
throw new NopException("Anonymous checkout disabled for recurring items");
var (error, cycleLength, cyclePeriod, totalCycles) = await _shoppingCartService.GetRecurringCycleInfoAsync(details.Cart);View on GitHub (pinned to 64bdf2ff08)
Solutions
- Re-run the PayPal onboarding flow to capture the MerchantId
- Verify the PayPal account is fully approved for PayPal Commerce (not just sandbox)
- Check that the onboarding callback successfully persists the MerchantId to plugin settings
- Confirm the PayPal account is a business account with PayPal Commerce enabled
Defensive patterns
Strategy: validation
Validate before calling
// Verify merchant ID is set before order creation
if (PayPalCommerceServiceManager.IsConfigured(settings)
&& string.IsNullOrEmpty(settings.MerchantId))
{
_logger.Warning("PayPal Commerce MerchantId not set — onboarding incomplete");
return Error("Merchant account not fully configured");
} Type guard
static bool IsMerchantReady(PayPalCommerceSettings settings)
=> PayPalCommerceServiceManager.IsConfigured(settings)
&& !string.IsNullOrEmpty(settings.MerchantId); Try / catch
var (order, error) = await manager.CreateOrderAsync(settings, placement, paymentSource, cardId, saveCard);
if (!string.IsNullOrEmpty(error) && error == "Merchant PayPal ID not set")
return View("OnboardingRequired"); Prevention
- Complete the full PayPal onboarding flow including merchant ID capture
- Verify MerchantId is persisted after onboarding by checking plugin settings
- Do not deploy to production until IsConfigured AND MerchantId are both set
When it happens
Trigger: CreateOrderAsync is called after IsConfigured passes (ClientId and SecretKey are set), but settings.MerchantId is null or empty — onboarding was partially completed.
Common situations: PayPal onboarding completed the credentials step but the merchant ID was not captured; the merchant's PayPal account was not fully set up for PayPal Commerce; onboarding was interrupted; the MerchantId setting was cleared or not persisted correctly.
Related errors
- Plugin not configured
- No available shipping options
- Vault disabled
- Data provider supports connection only with login and passwo
- Data provider supports connection only with login and passwo
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/dbdeff88f1b7c762.
Report an issue: GitHub.