#whip7
1 messages · Page 1 of 1 (latest)
that's not how it works; 20pff would be the https://stripe.com/docs/api/promotion_codes/object#promotion_code_object-code of the PromoCode object, you need to pass the id of promo_xxxx for example instead
you can use https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code to map user input to the promo code(or use our frontends like Checkout which handle all this)
I'm confused. I'm using this api https://stripe.com/docs/api/subscriptions/update. It has a property called promotion_code. I'm setting it to '20Poff'. This is the code of the coupon that already exists in my account. It was created from the dashboard long time ago.
Does promotion_code need to be an array?
My coupon doesn't seem to have a promo_xxx id. Its url is https://dashboard.stripe.com/test/coupons/20Poff
a Coupon is not a PromotionCode
you can't pass the coupon ID to promotion_code
if you have a coupon ID, you pass that to https://stripe.com/docs/api/subscriptions/update#update_subscription-coupon instead
Oh I see. Which should I use if I want to give a discount to a customer with a running subscription?
The subs is created without a coupon. I want to give a discount on the next payment
well a coupon
a Coupon is what applies a discount to the subscription. A PromotionCode is a separate object for a different use case(it's a way to let an end-customer enter a code and then you can look up the corresponding Coupon object and call the API to apply that Coupon to the subscription to do the actual discount).