#tea-hanks_api

1 messages ยท Page 1 of 1 (latest)

midnight relicBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

crude crescent
#

hi there!

#

Preview change API accepts multiple discounts in discounts array
can you calrify what you mean by this? maybe share a link to a Stripe documentation that mention this?

thorn grail
#

Oh yes sure. Here https://docs.stripe.com/api/invoices/create_preview#create_invoice-discounts

What I meant was that before a user subscribes we allow them to view a preview invoice. For that we use this "Create a preview invoice" endpoint. In this endpoint we can specify the discounts param to indicate what discounts we will apply to the subscription. This discounts array accepts more than 1 entries

However, when we create a subscription this discounts param on the "Create a checkout session" params doesn't accept more than 1 entry. Here is the doc link
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-discounts

#

I would have expected the preview invoice API to fail too if you cannot specify more than one discounts when creating a subscription. But unfortunately it doesn't

crude crescent
#

thanks for the clarification!

#

yes that feature is available on the Invoice endpoint, but not on Checkout Session (at least for now).

thorn grail
#

๐Ÿ˜

That would mean we need to use the create subscription endpoint instead of checkout sessions just to support this?

#

And any timeline about this? When can we expect checkout sessions to support multiple discounts?

crude crescent
#

That would mean we need to use the create subscription endpoint instead of checkout sessions just to support this?
that's one option yes. or you could combine both discount into a single discount?

#

And any timeline about this? When can we expect checkout sessions to support multiple discounts?
no idea if/when that will be improved, sorry.

thorn grail
#

combine discounts? As in create a separate coupon that effectively gives the same discounts as the two or is there something else that I am not aware of?

crude crescent
#

As in create a separate coupon that effectively gives the same discounts as the two
yes that's what I had in mind

thorn grail
#

Interesting. Thanks for the help though. I will talk to the team how we wanna get around this