#excid3 - Promo Code
1 messages · Page 1 of 1 (latest)
If you want to do apply a pomotion code on the same page as your payment element you would need to code that part of the interface yourself. It's not currently a part of payment elements.
Additionally we call out that you cannot apply it to an existing subscription with an update API call.
https://stripe.com/docs/billing/subscriptions/coupons/codes
I get that part
Am I forced to create another incomplete subscription and then re-render the PaymentElement with the new clientSecret for that one?
Since it's not going to update the invoice for the original subscription used for rendering the page
Am I forced to create another incomplete subscription and then re-render the PaymentElement with the new clientSecret for that one?
Are you collecting new payment method information?
Depends if the customer has paid previously or not
We may not show the Payment Element if they're using their existing default payment method
I would expect applying a promo code to an incomplete subscription to also update the draft invoice & payment intent, I guess
That is still an Update API call, not a Create call
You can’t apply a promotion code with amount restrictions on the Customer object or on a subscription update API call
From the docs
I'm not sure what you mean?
For example, I have a 50% off forever promo code
To render the checkout page, I need to create an incomplete subscription and retrieve the invoice's payment intent to render the PaymentElement
but how do I let the user apply the promo code in that process?
In that case you would need to present that input prior and apply the code on the create call:
https://stripe.com/docs/billing/subscriptions/coupons/codes#applying-promotion-codes
So there's no way to create the same experience as Stripe Checkout where everything is handled on one page?
You could probably do it with a lot of work on your back-end/front-end. Create a sub without one to render the elements, if the user enters a promo-code create a new sub, return the last_invoice.payment_intent.client_secret to the front-end, re-render the payment elements.