#vladnis-promocode-questions
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Checkout Sessions create new Subscriptions. But the billing portal is used to make modifications to existing subscriptions. What is it you are trying to do here?
- What is the behavior you want to happen
- What do you see when you test this?
My scenario is as follows: User A triggers a cancellation to their subscription (the subscription will effectively cancel at the end of the billing cycle). During this time (until the end of the billing cycle), my user is still on a subscription. However, I want to make sure that if they are to come back to the billing portal and decide to rejoin, they can obtain a 50% subscription.
(This is the Stripe-hosted billing portal)
Okay are you configuring this with the API?
I can configure it with the API, but I am not sure the steps to achieve my desired behaviour.
You can add promotion_code to the features.subscription_update.default_allowed_features parameter when creating a portal configuration object to allow the user to add a promotion code: https://stripe.com/docs/api/customer_portal/configurations/object
I see. Would I then be able to restrict the use of the promotion code to be 1 per customer?
The most straightforward way I would see handling that is to create a new Coupon object for each Customer and set the max_redemeptions to 1. That way each Customer's coupon is only good for one use.
https://stripe.com/docs/api/coupons/create#create_coupon-max_redemptions
I see in the promotion code api (https://stripe.com/docs/api/promotion_codes/create) that I can create multiple promotion codes based on a single coupon. What does this actually mean? Will the promotion code created based on an unlimited redemption coupon work an unlimited amount of times or just the one time?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
๐ hopping in here since snufkin has to head out soon
Ah, I see that I can customise both the customer and the redemption limit on the promotion code. If I understand correctly, starting from a 50% off coupon with unlimited redemptions, I can create a promotion code for a single user that can only be redeemed once. Is that the correct way to achieve my use case?
Yup!
Lovely! If I want to reduce the friction such that the user does not have to enter the promotion code themselves) what are my options ? Can I boot up the billing portal with the promotion code applied from the beginning? Can I apply a promotion code to a checkout sesson when building one?
What you could do is update the customer and apply the coupon directly to them (https://stripe.com/docs/api/customers/update#update_customer-coupon)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
vladnis-promocode-questions
I tried this but that ends up with every subsequent checkout having the coupon applied. I suppose I could programatically remove it from the customer if I notice an event with a coupon applied. Is there an example event (checkout completed and/or subscription updated) that I can use for reference to detect coupon usage
Ah, you could probably fix that by having a coupon with a duration of once (https://stripe.com/docs/api/coupons/create#create_coupon-duration)
What I mean is that if I attach it to the customer object then every time the customer checks out they will obtain a 50% off discount. If I understand correctly, that once setting means that the 50% off applies only to the first month. I want it to apply only to the first month AND I want to make sure that if they checkout again then the 50% off does not apply.
once means the discount will be single-use. It'll apply to the next invoice for the customer and then by removed (which sounds like what you want?)
Will it be removed from the customer object though? Let's say I attach this coupon to customer A. Sure, once they checkout, they'll have 50% the first month and then full price all the other months. However, if they cancel after their 4th month, and then decide to subscribe again, will the coupon be removed from the customer? Will they just be defaulted to the full price subscription?
Yes the coupon will be removed from the customer
when the resubscribe they'd only get the coupon if you update the customer and added the coupon again after it was used the first time
And do I need to create a coupon for every customer ?
No, you should be able to use the same coupon for every customer
See attached ss. Doesn't the grayed out row mean I cannot use the coupon again?