#kev-coupons-promo-codes
1 messages ยท Page 1 of 1 (latest)
Hi ๐
So let's back up a moment.
Sure
Can you lay out the specific scenario here? From what I gather you are providing a UI where your customers can retrieve information about a specific coupon or promo code?
Of course yes
I am doing exactly this - and then I'm also using that same form to apply the coupon code to a payment
So basically they enter the promo code, then click apply, and we return information about how much they will save, and then they fill out the stripe elements form and we apply the coupon code to the payment.
The problem is that we were using coupon codes IDs via retrieve (by the code's name) to do this - but it doesn't pick up promotion codes of course
So I am wondering , should I be switching us over to using promotion codes - and if so, is the process the following: if I use the promotion code one I have to retrieve the entire list, filter out the one I'm looking for, find the associated coupon, and do another call to retrieve it's information
Thanks for clarifying!
So yes, since the promo code is the customer facing ID, that is indeed what you should have them enter (not the coupon ID). You can receive the full coupon info by listing using the code itself: https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code
You don't need to actually list and filter
When you list by code that will return the specific promo code which will contain the coupon hash with all the info: https://stripe.com/docs/api/promotion_codes/object#promotion_code_object-coupon
Ok thank you
I've been using the API for too long, idk when you all introduced Promotion Codes vs. coupon codes haha
didn't use to exist
Yeah it wasn't super recent at this point, but you are correct that it used to just be coupons.
Haha I believe you - this was probably ... 2018 or so
Alright - well I can make that change - I just didn't realize I had to LOL - appreciate it!
Hi ๐ I'm jumping in so my teammate can take a break, feel free to let me know if anything else comes up while you're working on that.