#zaddler_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/1219288015386447933
đ 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.
- zaddler_unexpected, 3 hours ago, 51 messages
- zaddler_code, 4 days ago, 26 messages
Hello
Hey there
Can you help me?
Yep I'm taking a look
Alright
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
Yeah, the only way to preview is via https://docs.stripe.com/api/invoices/upcoming and that does not work for future cycles of a Subscription (like if it has a Sub Schedule).
So you would have to calculate this info yourself to display it if you want.
How do you do this in Stripe UI?
How could I calculate that?
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
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
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)
?
"You are saying that when you attach a Schedule and then preview the next Invoice it isn't respecting the schedule itself?" Yes
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
Ah okay so yeah you haven't actaully attached that schedule yet
I want to create the schedule without attaching it to the subscription, and then show my next invoice
What happens if you do pass the schedule ID to that schedule param?
Correctly show my next invoice with the schedule
I'm confused. Isn't that what you want?
It's what I want, is it possible?
Have you tested passing the Sub Schedule via that param?
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
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
Sure, but you have to create it and then attach it, what happens is that my interface is to see what will happen in the future, I can't create it because I don't know if it will later agree or not, I would have to create it temporarily for like 5 seconds and then I delete it, I think
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.
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
Sounds like a plan
Yep