#eli_api

1 messages ยท Page 1 of 1 (latest)

crisp prairieBOT
#

๐Ÿ‘‹ 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.

native cargo
#

Hello ๐Ÿ‘‹

Have you tried specifying the ID of the Promotion Code in the discounts.promotion_code parameter?

crisp prairieBOT
turbid oyster
#

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

hazy jacinth
#

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?

turbid oyster
#

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

hazy jacinth
#

Got it. Is there a particular guide you are following that you can share?

turbid oyster
#

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.

hazy jacinth
#

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

hazy jacinth
#

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