Skip to content

apply coupon only from REST API request

I’m working on custom API collections for Magento 2.

i’m trying to add new feature that allow customer to use some coupons from Mobile Apps Only.

So i need to add new condition for Cart Price Rules, for example name it as “Source” with two options “Mobile Apps, Web”.

and when creating new coupon with “Source as Mobile Apps”.. the coupon will only work from REST API request, and it will not applied if the customer try it from the Magento 2 web version.

any idea how to do it?

Thanks