#StormFox-coupon
1 messages ยท Page 1 of 1 (latest)
I have a coupon that can be applied to a restricted set of product. with stripe checkout I can't apply to another set of product, but with API seem that is possible
this sub in testing environment sub_1K9S13Bpghjpg7jriIi19Vjb
seems i can apply a coupon for another set of product , coupon xcOhjofh
yeah that's a bit weird I guess, the coupon has applies_to for prod_KTLMayYZyWrqWo but you could use it in a subscription for prod_KdpmzNlSNdy4KA
Yes exaclty. prod_KTLMayYZyWrqWo is a pro pay subscription, prod_KdpmzNlSNdy4KA is the lower price. With checkout when i try to apply the coupon to prod_KdpmzNlSNdy4KA the frontend tell me that i can't use this discount, with API (i don't try manually with dashboard or maybe yes i try ๐ ) i can apply the discount and the api call return ok without error
yeah I don't know if that is expected or not
maybe the applies_to only works for PromotionCodes when using the coupon with Checkout, though I don't think that would make sense
asking some colleagues in case they know
thank you very much for your time ๐
Hi ๐ I'm jumping in here. It looks like the coupon was added to the subscription, but that it didn't actually reduce the charged amount. Is that what you're seeing too?
what I expect is that that coupon cannot be applied to prod_KdpmzNlSNdy4KA , because is only for prod_KTLMayYZyWrqWo
ah yes i see the dashboard and there is a discount of 0
the coupon is applied but the price is unchanged
Yeah, the coupon is added to the subscription but since there are no matching products it doesn't actually apply to anything.
the problem is that i have to tell our customer that you are not eligible for the discount, like the checkout. I would expect an error when i apply to a product that are not the right one, (i'm not currently check in detail the json response, i give a look)
Adding a zero discount if there are no applicable products is the expected behavior. If you want to prevent it, then you'll need to build the logic for that to check if the applies_to parameter matches any of the products that you're adding to the subscription.
so your are saying that i have to reproduce all the (complex sometimes) constraints that i can define with a coupon (first purchase or number of redemptions or eligible customer etc) in my backend?
I'd suggest taking a look at this documentation which discusses these parameters and how they behave. It's where we explicitly say that it's expected to see a zero-dollar discount when adding a coupon to a subscription. You can also do some simple testing with really low limit values (so you hit them quickly) to confirm exactly how everything will behave.
https://stripe.com/docs/billing/subscriptions/coupons#creating-coupons