#eirik-checkout-discount
1 messages · Page 1 of 1 (latest)
eirik-checkout-discount
Hey @drowsy gorge you want https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts-promotion_code
Hmm, that's what I thought. For some reason I get a "No such promotion code" error when I do this.
you need to pass the promo_123 not the customer-facing code
Ah, so how do I get from the customer-facing code to the ID, then?
Is a separate API call needed?
in theory you have it in your own database really
Where do you get that code value from exactly?
From a form field in my checkout page.
Well, the page before the Stripe Checkout screen
The page where the user picks quantities and tiers etc.
Gotcha. It's quite uncommon to rebuild your own "enter this code you could enter on Checkout" usually you do that on Checkout, or you don't use PromotionCodes and you have your own coupon code logic
but otherwise you can use https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code
OK, uncommon in the sense that it has potential security issues, or just uncommon because developers typically defer this to the Stripe Checkout page?
the latter