#mehdi_api

1 messages ยท Page 1 of 1 (latest)

leaden warrenBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

spare torrentBOT
open condor
#

Hi there ๐Ÿ‘‹ a couple options come to mind depending on how exactly you want to model it.

The first is to use two different prices with the same billing interval. You create the Subscription with the higher price, then as soon as the first payment is completed make a request to update the Subscription. In the update request you'll swap to the new Price and also set proration_behavior to none so the Custoemr isn't credited for the downgrade. Then when their next Invoice is generated it will use the lower Price.

Alternatively you can use a single recurring price, and also include an additional one-time price on the first Invoice. The possible drawback here is the Invoice will have two items on it, which may not be how you want to display it.

zenith radish
#

hmmmm yeah the second option doesn't appeal to me because the invoice will look a bit odd

#

the first one is also a bit scary because if our API doesn't update it correctly (or for instance, goes down), we would run into an issue later

#

am I able to do this with subscription schedules? maybe that's the best way

#

i can also preview both invoices at once right? like on the checkout screen i could then show what we would charge the user now ($10) and the renewal charge in a year ($5)?

open condor
#

It depends on what you're referring to when you say "checkout screen", can you tell me a bit more about that?

zenith radish
#

oh sure, so we use the invoices retrieve upcoming endpoint to make a checkout screen, where we should what we intend to charge

#

and then when the user clicks checkout, we actually create a subscription

#

i would like to do something similar here, to create a checkout screen where we show the user what we will charge today, and also what we will charge in a year

#

(we like to use the retrieve upcoming endpoint as it takes into account tax etc.)

open condor
#

Okay, gotcha, yeah that should work with Subscription Schedules. I just wanted to make sure you weren't talking about our prebuilt Checkout Sessions which wouldn't work with what you're describing.