#eli_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1469069897387610254
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello ๐
Have you tried specifying the ID of the Promotion Code in the discounts.promotion_code parameter?
We have a landing page where a promo code is "auto-set" into our payment options, however for subscription, we call our API and it returns a checkout URL. The customer/frontend only has the Promotional Code.
We want to avoid hard coding the ID associated with the promotional code
Like if possible, if we could somehow add the promo code to the returned URL to tell the portal to prefill a promo code. That is also a viable solution
Hi there, taking over for @native cargo as they had to step away
Looking into this now - can you share a request ID so I can look at the details of your integration?
I don't really know what that is. I'm in the process of implementation and was wondering what the best practice is. It feels very odd that to create a session with a discount pre-applied, I can't use a customer-facing promo code ฦor the API
that's why I asked my question
Got it. Is there a particular guide you are following that you can share?
sure. The docs are here regarding creating a session with a discount:
https://docs.stripe.com/api/checkout/sessions/create?lang=dotnet#create_checkout_session-discounts
And this is the only thing regarding "Applying a coupon" but it does not apply to arbitary coupons. And for promo codes, it doesnt' even acknowledge that we may want to pre-fill for users.
https://docs.stripe.com/billing/subscriptions/coupons#using-coupons-in-checkout
Our app has two ways to apply promo codes. For one time payments (top-ups), which works flawlessly, and then subscriptions, which currently requires telling the user to manually enter the code on the stripe portal that will open up. This is a subpar experience compared to ideal.
Right, so far I only see the options you mentioned - you can either specify the discounts.coupon ID, the discounts.promotion_code ID, or allow_promotion_codes (where the user enters it themselves). Looking some more
Sorry, still looking into this. I think there may be a workaround that might accomplish what you want, need to test it out
Okay, verified with my team that prefilling the promotion code field isn't a feature that exists with Checkout unfortunately.
One possible workaround is to make a Coupon and specify its id to be the public facing name you want:
https://docs.stripe.com/api/coupons/create#create_coupon-id
That way when you create the checkout session, you can pass that name for discounts.coupon
Not sure if that fullfills your exact use case, but it's a possible workaround