#davi_d
1 messages · Page 1 of 1 (latest)
I see that it's possible to do for payment links, and i just naively tried appending the query param of prefilled_promo_code to the checkout session URL but that seemed to break it lol
You can, but you'd need to look up the promo code id first:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts-promotion_code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You can lookup the object & get the ID from the code using the list endpoint: https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that seems pretty inefficient tho
if there's some unknown amount of promo codes
is that the only way we could do it?
Well the code is unique so it should only return 0 or 1 results