cancel
Showing results for 
Search instead for 
Did you mean: 

Cart Price Rule based on category does not work via Rest API

Cart Price Rule based on category does not work via Rest API

I have created a Cart Price rule (not catalog) and applied a discount to it. I can apply the discount fine using the store's UI. I can also apply the discount via Rest API. Then if I add an action to only allow the discount if the product belongs to a category I can still apply the discount via store's UI but when I try via Rest I get the response that the discount code is not valid. The Rest request is made through another store view but the category is also visible in said store view. What am I missing?

2 REPLIES 2

Re: Cart Price Rule based on category does not work via Rest API

Hi @WMatos ,

 

Can you try selecting required store as well in cart price rule. And then try to apply the rule using the rest Api for particular category.

 

Also can you please trying applying rule to particular store view after removing category condition from that. Just to confirm issue is with category selection only else cart price rule is working fine.

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!

Re: Cart Price Rule based on category does not work via Rest API

Hi @Nishu Jindal thanks for your reply.

 

I've tried your suggestions but unfortunately no luck. One I can't see anything related to store view while creating/editing the cart price rule (I can see the option when editing category though).

 

If I apply the discount that's not tied to a category everything works as expected. I've tried all other discount codes that's not related to categories and everything works as expected. This is a Magento Enterprise btw but the category permissions have been disabled. When I try to add apply a discount to a cart via GraphQL I get this message: Cannot query field \“applied_coupons\” on type \“Cart\“.

 

Any ideas?