If I need to get specific coupon details, it looks like I need to know the coupon ID, which I don't see anywhere aside from the api. *I do see an ID for the coupon that might look like 2860358, but fetching that via the api returns an error. Do I have to get all coupons and then page through looking for the target coupon by name? Or?...
the back story:
Client wants a custom sidecart. I built one using ReactJS, which was a fun exercise. Now they want to handle coupons a bit differently. They use quantity_percentage category discounts 3-15|5-20. But if a coupon will discount by a lesser or equal value than the category discount, they want to reject the coupon since discounts aren't combinable.
So, I figured I'd grab the coupon via the api, check the discount_type, compared the discounted value to the category discount value, and proceed from there. I'm probably thinking about this the wrong way though.
The only other way I could think to do this was:
1. add coupon to cart, but don't update the cart display.
2. compare the coupon Amount to my current discounts total
3. if coupon amount is lesser or equal, remove it from the cart and display a warning/info message of some kind.
That might be simpler in the short term, but I'm expecting to run into unexpected results... or a changing set of requirements.
Thanks for your input, as always.