#xcalaba_api

1 messages ยท Page 1 of 1 (latest)

oblique jacinthBOT
#

๐Ÿ‘‹ 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/1262860802248151111

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tulip mica
#

Hello
PaymentIntents API does not support promo codes or discounts.

#

That endpoint only expects an amount to be passed in.. So your application can track any discounts/promocodes on your app side and then pass in the appropriate amount to the API

#

Ah which is what you're doing already

#

my bad, I read really quickly and missed that you mentioned that

steady raft
#

yeah, trouble is there is way to increment a promo code via the API

tulip mica
#

Hmm yeah. I don't think there's a way to increment the redemption on Stripe using the API.

An alternative could be that you maintain the redemptions done using PaymentIntents API on your database separately.

steady raft
#

I'm surpised that there is no better way

#

I will need to build an entire promo code remeption and creation module for my backend

tulip mica
steady raft
#

you mean something like this?

"metadata": {
"times_redeemed": "1"
},

tulip mica
#

Correct

steady raft
#

the issue is that sometimes we allow uses to enter the promo code directly into checkout

#

if they are a guest

#

any way to request an update to the post API?

#

to allow for
times_redeemed=+1

or

times_redeemed=-1

etc

tulip mica
#

I assume you're listening to checkout.sessions.completed event as well, in which case you can check what promo code was used for the checkout if any and update the metadata to stay consistent..

any way to request an update to the post API?
you can file a feature request via https://support.stripe.com/?contact=true

steady raft
#

I am very surpised this isnt a common issue for dev's

#

ok, I guess we will need a table to track the remptions and then to invalidate a promo code should it reach its max-redemptions

#

not idea but thanks for the idea

tulip mica
#

NP! ๐Ÿ™‚ happy to help

steady raft
#

i dont see feature request

#

am I meant to ask to chat bot?

tulip mica
#

I think you can ask the chat bot or just file an email ticket

steady raft
#

ok