#ambi_customer-restricted-promo-codes
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1332398395377189054
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ambi_code, 7 hours ago, 16 messages
- ambi_best-practices, 2 days ago, 19 messages
Hi ๐
So you are talking about restricting Stripe Coupons? Can you clearly describe what the current terms of your coupon are and the specific abuse situation you are trying to guide against.
Sure! Yes indeed I would like to add some restrictions.
So I am looking to turn on the Retention Coupon which will give customers a coupon after they cancel a subscription. I would like to limit that coupon to be able to used on a customer only once.
I cant use the Eligible for first-time order only. โ๏ธ when creating the coupon because these customers have clearly had an order before so it is not a first time order. (since they already subscribed and are canceling it.)
So what other way could I acheive this?
this is the feature I am mentioning
Okay, just as an FYI this server is focused on helping developers coding integrations with Stripe APIs so most of my advice will focus on the Coupon and Promotion Code APIs
We are not focused on what features are in the Dashboard here
right, the feature used doesen't really matter, just giving some perspective
Ack.
In that case, here is how I would try to solve this issue.
- Create a Coupon for whatever discount you want to give <- this you create once for the discount (e.g. 25%, $50 off, etc.)
- For each Customer, create a Promotion Code where you specify the Customer ID (this limits the code to that customer) and
max_redemtions=1. This will limit the number of times that Promotion Code can be used to 1.
- Promo code customer param: https://docs.stripe.com/api/promotion_codes/object#promotion_code_object-customer
- Promo code max redemptions: https://docs.stripe.com/api/promotion_codes/object#promotion_code_object-max_redemptions
Oof, right. then I would probably need to update the customer portal Retention Coupons via API
I'm not sure what you mean but here is the overall customer flow as I would see it.
- Customer cancels a Subscription
- Integration receives
customer.subscription.canceledwebhook event - Integration selects the Coupon object we want to apply and generates a Promotion Code specific to that customer with
max_redemptions:1 - Integration sends an email to the customer, providing them the promotion code
ah right, I see, without the Retention Coupons feature but creating it from scratch, that also makes sense
Yeah i see we describe that as a feature of the Cancelation flow here: https://docs.stripe.com/customer-management/configure-portal#cancellation-management
But I don't see the parameters in the API for the Customer Portal Configuration: https://docs.stripe.com/api/customer_portal/configurations/object
So that is why my approach doesn't use that feature.
I see, well you worked with what you had and you came up with a solution
thanks alot!
๐ค
Happy to help ๐