#dineshkumar_docs

1 messages ¡ Page 1 of 1 (latest)

kind gateBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1252202416267591732

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

hollow nymph
#

hi! can you say more about what you're trying to do/ what you understand "validate" to mean?

thin cliff
#

promo code availability it's valid one or not..

#

i need to check through API promo code availability / validity

hollow nymph
#

as in, you have accepted user input from the customer that is a possible promo code code value, and you want to use it on a payment?

thin cliff
#

i want use for subscription

thin cliff
#

this is screenshot for promo code apply

#

we want check promo code is valid or not valid, before subscription create..

hollow nymph
#

you can pass the code to the Subscription Create API and it throws an error you can catch if it's invalid. Check the docs linked above.

thin cliff
#

understood..

#

but our flow is before stripe creation we need to validate promo code is valid one or not..

#

any option in stripe for above flow?

hollow nymph
#

no

thin cliff
hollow nymph
#

no

#

you check validity of a PromoCode by attempting to apply it to a Subscription and catching the error, that's the only solution offered at the moment

thin cliff
#

ok

hollow nymph
#

what if you have 100s of promo codes to look at that way?

#

also, that doesn't tell you if the promo code is actually valid and applicable. It just tells you a PromoCode exists. For example maybe you used applies_to or the 'first time customer' restriction on the Coupon/PromoCode. To check if those restrictions work, you need to actually try to use the PromoCode.

thin cliff
#

ok i will check with my team and come back

#

thanks.