#nina_api
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/1416137257726906492
đ 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.
- nina_api, 19 hours ago, 5 messages
Hello
The AI is unfortunately incorrect
PaymentIntents API does not support promotion codes/coupons
hi Hanzo, how can we use the promo code then in this scenario?
With PaymentIntents, you'd need to add your own fields for coupons, calculate the discount, update the PaymentIntent amount and then use something like fetchUpdates() to update your Elements object with the latest details.
https://docs.stripe.com/js/elements_object/fetch_updates
You can use this API endpoint to update the PaymentIntent amount - https://docs.stripe.com/api/payment_intents/update#update_payment_intent-amount
oh so we need to do the calculation ourself?
That's correct. The PaymentIntents API is bare metal.
If you use Stripe Checkout API then we calculate discounts for coupons/promo codes but with PaymentIntents, the merchants/developers have the full control
then how we get reports on how many times a code had been used or things like that
I mean if we are not passing the promo code to Strip at the time of check out how we get the analytics at it
You'd need to track it manually (in your own database) when you do the calculation
oh so we have to implement the whole logic on our end?
With PaymentIntents API, unfortunately - yes
got it...also could you plz elaborate more on why we should do fetch_update on element object? as its not holding any payment info?
It's because when you update the PaymentIntent's amount server-side, you'd also need to update it client-side so that the customer sees the right amount for let's say Apple Pay or Google Pay modal
one last question for u Hanzo, can we use ur coupon and promo code APIs along with payment Intent endpoint
to like update the info on stripe end abt the usages of promocodes and things like that
or validating the code as well
It is not something the API supports today.
You could validate the coupon/promotion code by retrieving it but since you'll need to track the redemption in your own Database anyway, it'd be better to just validate on your end as well (without using Stripe's APIs)
got it thanks
could u also verify if each coupon is only associated to only "ONE" promo code?
is each promo code is associated to one coupon I better ask
Coupons can have multiple promotion codes but a promocode can only be associated with one coupon