#dineshkumar_docs
1 messages ¡ Page 1 of 1 (latest)
đ 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.
hi! can you say more about what you're trying to do/ what you understand "validate" to mean?
promo code availability it's valid one or not..
i need to check through API promo code availability / validity
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?
i want use for subscription
this is screenshot for promo code apply
we want check promo code is valid or not valid, before subscription create..
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.
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?
no
we can check promo code availability/validity from promo list api https://docs.stripe.com/api/promotion_codes/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
ok
but below steps i think work,
1.Get the list of promo codes form api https://docs.stripe.com/api/promotion_codes/list
2.and check thew 2 values our backend C# 1."code": "A1H1Q1MG" and 2. "valid": true .
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.