#nina_api

1 messages ¡ Page 1 of 1 (latest)

feral widgetBOT
#

👋 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.

manic fractal
#

Hello
The AI is unfortunately incorrect

PaymentIntents API does not support promotion codes/coupons

latent galleon
#

hi Hanzo, how can we use the promo code then in this scenario?

manic fractal
latent galleon
#

oh so we need to do the calculation ourself?

manic fractal
#

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

latent galleon
#

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

manic fractal
#

You'd need to track it manually (in your own database) when you do the calculation

latent galleon
#

oh so we have to implement the whole logic on our end?

manic fractal
#

With PaymentIntents API, unfortunately - yes

latent galleon
#

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?

manic fractal
#

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

latent galleon
#

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

manic fractal
#

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)

latent galleon
#

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

manic fractal
#

Coupons can have multiple promotion codes but a promocode can only be associated with one coupon

latent galleon
#

got it thanks you

#

sorry, by any chance do u know if there is a way to update the "times_redeemed" for the coupon object? like if the coupon update endpoint is letting us do that

#

the doc is not clear abt what we can update using that endpoint