#yogeshwari
1 messages · Page 1 of 1 (latest)
That's the Coupon Id. Promotion Code is a different thing
Promotion Code is that you generate them and give to your customer. Your customer input it into a Stripe surface
For example https://stripe.com/docs/billing/subscriptions/coupons?dashboard-or-api=api#add-promotion-codes-to-checkout
Yes, I know but is it possible to give discount based on promotion code directly via subscription update API?
In our case while we upgrade the plan then stripe checkout screen is not coming , Because we call subscription update API and inside this API passing 'promotion_code' => 'Promotion code object ID'.
Yeah Update Subscription API does accept a Promotion Code Id AFAICS. You can try it out in Test mode tho
Currently I pass this value in 'promotion_code' key but while we check on stripe it automatically converted into COUPON
?
what do you mean by automatically converted?
Like I create ABC coupon and under this coupon create "TESTPROMOCODE" this promotion code
I apply TESTPROMOCODE this promotion code then stripe Invoice showing me that i apply "ABC" coupon.
That's expected since a Promotion Code belongs to a Coupon
Ok, Thanks
I have a one concern about Promotion code validation
I create coupon with promotion code for PRO product but I will buy PREMIUM product with PRO product promotion code then not giving error. I want to get error because promotion code created for PRO product and i am applying on PREMIUM product.
https://stripe.com/docs/billing/subscriptions/coupons?dashboard-or-api=api#set-eligible-products for setting the eligible product
That already done while creating coupon but stripe not check while upgrade subscription using PHP API.
Sorry could you outline what you observe? Like which Coupon Id you set to which Product Id, and then what diffrent Product ID it applied to in which request?