#zaddler_api

1 messages ¡ Page 1 of 1 (latest)

hybrid remnantBOT
#

👋 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/1219288015386447933

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

midnight troutBOT
#

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.

quiet parrot
#

Hello

west kite
#

Hey there

quiet parrot
#

Can you help me?

west kite
#

Yep I'm taking a look

quiet parrot
#

Alright

west kite
#

Don't think this is possible to preview the Invoice for future cycles

#

But double checking

#

Only the upcoming billing cycle can be previewed afaik

#

So you would have to calculate this info yourself to display it if you want.

quiet parrot
#

How do you do this in Stripe UI?

quiet parrot
west kite
#

Not sure what you mean? That just summarizes when the Sub will cycle.

#

You would have to look at the Subscription Schedule that you create

quiet parrot
#

What happens is that when the user changes from a monthly to an annual plan, I create a schedule subscription, the problem is that the invoice preview only works in the next billing cycle, but not in schedule

west kite
#

You are saying that when you attach a Schedule and then preview the next Invoice it isn't respecting the schedule itself?

#

Or you are looking for a preview of a future Invoices (after the next Invoice)

#

?

quiet parrot
#

I see that there is a parameter called schedule in retrieve upcoming invoice, the problem is that you need to associate it first, and then obtain its ID, and I don't want to create it because the user may not decide to use that schedule

west kite
#

Ah okay so yeah you haven't actaully attached that schedule yet

quiet parrot
#

I want to create the schedule without attaching it to the subscription, and then show my next invoice

west kite
#

What happens if you do pass the schedule ID to that schedule param?

quiet parrot
west kite
#

I'm confused. Isn't that what you want?

quiet parrot
west kite
#

Have you tested passing the Sub Schedule via that param?

quiet parrot
#

Yes, but because I had already created a Schedule previously, if this Schedule does not exist, I cannot pass it, maybe I will get errors

west kite
#

Yeah okay I see what you mean. So the only way forward here is to create/attach the Schedule as you noted. Then you can show the preview. If the customer does not actually want that, you would then remove the Schedule from the Sub using https://docs.stripe.com/api/subscription_schedules/release

#

Otherwise you should just preview via using the subscription parameters within the Upcoming Invoice API

#

So basically just use those to replicate what the Subscription is going to do for the next phase

quiet parrot
west kite
#

Yes that is what I'm saying above. You either create it temporarily and delete (release) it. Or you just set the subscription_data params on the Upcoming Invoice preview like it is a normal Sub update request and those params should mirror the next phase of your Sub Schedule that you would then attach after the customer agrees.

quiet parrot
#

Okay, I think I'd rather create it temporarily and then delete it. I will try it, if not, I will show it manually on my frontend

west kite
#

Sounds like a plan

quiet parrot
#

Yep