#xcalaba_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/1262860802248151111
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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
yeah, trouble is there is way to increment a promo code via the API
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.
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
The other option could be that you update the metadata on the promotion code and track the redemption count there?
https://docs.stripe.com/api/promotion_codes/update
you mean something like this?
"metadata": {
"times_redeemed": "1"
},
Correct
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
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
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
NP! ๐ happy to help
I think you can ask the chat bot or just file an email ticket
ok