#igor-lamas_sub-promo-update
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/1333465054548463636
๐ 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.
- igor-lamas_docs, 1 hour ago, 14 messages
The event descriptions are in Portuguese, but just by looking at the names of the events, we can follow the flow.
Hi there ๐ it looks like part of your post got cut off, but the flow you shared so far sounds right.
after finalizing the checkout
looks good?
but I have one thing
here in this flow I can add a promotion code?
What I see looks good, but again I think part of your initial message got cut off so I didn't see all of it.
on the checkout? and then the subscription will updated to use the promotion code?
You have to add your own field to collect the Promo Code, then include it when you create the Subscription:
https://docs.stripe.com/billing/subscriptions/coupons?dashboard-or-api=api#promo-code-subscriptions
In my flow, the subscription is created before the checkout component, but the promotion code field is part of the checkout. The promotion code will be submitted along with the checkout data. Can I update the subscription to apply the promotion code at that point?
Hereโs how I finalize my checkout and send it to Stripe:
When the user enters the promotion code during checkout, I already validate if it exists. Now I need a way to apply it to the subscription. Should I make a call to apply the promotion code to the subscription before this stripe.confirmSetup call, or can I handle it directly here?
No, you'd have to provide the promo code when creating the Subscription. The Subscription automatically generates and finalizes its first Invoice when you create it, at which point it's too late to apply a Promo Code to that first Invoice.
but even having a free tier? the first invoice aways will be $0.
Is there any way to apply a promo code to an existing subscription?
Ah, I forgot yours are starting with a free trial (I'm in a lot of threads at the moment ๐ )
Yeah, you can apply a Promotion Code to an existing Subsciption, using the same field I pointed to earlier but in an update request:
https://docs.stripe.com/api/subscriptions/update#update_subscription-discounts-promotion_code