Try our conversational search powered by Generative AI!

Getting RemovedDueToInvalidPrice error


While adding cart to cart service, I have validation from OrderValidationService.ValidateOrder and I am getting RemovedDueToInvalidPrice  error (Item has been removed due to invalid price.). I have set AUD100 to variant price.

Edited, Jun 20, 2019 7:08

Please check what is your current market and have you added price for your current market? (see Market column in below image)

Jun 20, 2019 13:16

It's the default one.

Jul 09, 2019 15:07

Can you also verify few more things,

Quantity is set (more than 0), for example

Product is not expired

In addition, I want to know your default curreny set in CommerceManager -> Administration -> Common Settings (see below image)

Jul 09, 2019 15:39

The default currency is US Dollar. Product is not expired and min and max quantity in inventory tab are 1 and 4 repectively. BTW I have min and max quantity in pricing tab of catalog management in Commerce Manager as well, what the difference between them?

Jul 10, 2019 7:07

Hi Muller

The RemovedDueToInvalidPrice validation issue is returned because no suitable price value was found. Or they were found, but filtered away because:

  1. the line item quantity is outside of the range on the price value,
  2. the price applies to a specific customer or customer group and your cart does not belong to that, or
  3. the price value is not yet valid (valid in the future) or is not valid anymore (expired).

I assume that the cart currency is AUD (since you are testing with a price of AUD 100), the cart market is DEFAULT and that the price value is for "All Customers". Is that correct?

Jul 10, 2019 11:55

Price is applied to all customer and not expired.How to check if price is in the range? Where is the price range defined? Currency is matching with Currency in administration, I have also tried with different currencies though. Cart market is Default and price value is for "All Customers".

Jul 16, 2019 11:49

The range I mentioned is about quantity, not price.

When you have mininum quantity of 1 and maximum quantity of 4, what is the quantity on the line item you are testing with?

Jul 16, 2019 12:03

Yes, quantity on the line item is 1 which lies within the range

Jul 16, 2019 12:33
                new CatalogKey(code),
                new PriceFilter { Currencies = new[] { currency } })
                .OrderBy(x => x.UnitPrice.Amount).FirstOrDefault();
is giving null for some variants. This is causing issue. No idea why getprices gives null.
Jul 16, 2019 14:08

Do you want to get all market prices? If yes, then pass new PriceFilter() as empty and if no then it will return prices for the currencies that you are passing into PriceFilter()

And, are you trying to get the currency as?

var currency = SiteContext.Current.Currency;
Edited, Jul 16, 2019 14:26

Price issue is fixed. But I'm still getting RemovedDueToInvalidPrice error.

Jul 17, 2019 6:06

Can you describe the full story scene? Like: Number of items in cart, their quantity in cart and their inventory and pricing details in commerce. Are you adding more items than max quantity (of item) in cart? When does your validation is called? Your complete test scenario. 

Jul 17, 2019 9:26

Removing sales code fixed the issue. No idea why sales code is giving Invalid price validation error.

Jul 17, 2019 12:46

You means promotion code?

Jul 17, 2019 13:04

Is that percentage based or amount based? If it was amount based and did you try with amount in your (default) currency. For example USD in my case (US Dollar)?

Jul 17, 2019 13:11

No, not promotion code. It's SALE CODE in pricing tab of variant (you can see this in pricing tab of the second screenshot you posted). All the price and quantity were proper and there is no discount.

Jul 17, 2019 15:19

Hi Muller,

Episerver out of the box code ignores a pricing record when "All Customers" price/sales type is applied with a sales code for a valid reason. Sales code is used in various ways and it is always dependent on what type of price/sales type you are using it for. E.g. When we use "Customer Price Group" as sales type, it tries to match contact's customer price group, and assigns a matching price record applicable for the user. In case of the system does not find a matching record, then it falls back to All Customers price (with empty sales code), which is usually used for MSRP price. There is "User Name" sales or price type, which can also be another way to assign specific price to specific customers.

On top of out of the box price/sales type, you can also add additional price/sales type to your application and customize the pricing scenarios to your business need. Once we added a new sales type as "Minimum Advertised Price" which is also called MAP in B2B market, to display MAP price to the customer. Episerver Pricing system is expandable based on various need.

~ Sujit

Edited, Jul 22, 2019 2:38

Though sale code fixed the issue. I've got the issue again in another variant. Currently, it has minimum quantity 2, if I change it to 1, the issue is fixed. I am really wondering why I am getting this issue in different different scenarios.

Aug 01, 2019 15:13

Hi Muller,

I would suggest you to read more carefully about the uses of the pricing and inventory. If the cart validation doesn't fit into the criteria of pricing and inventory to the items in the cart you will face these errors. That's obvious. So, here is the link to documentation. I hope this will help you.


Aug 01, 2019 15:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.