#blede_subscription-lifetime
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/1298744549144920146
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
https://docs.stripe.com/api/invoices/create_preview
This is the documentation I've used so far.
Hmm I don't think you can use both parameters at the same time
Have you tried using upcoming invoice API instead to see if that works?
https://docs.stripe.com/api/invoices/upcoming
did that work?
Nope
same issue
I think my only choice is to preview the invoices with the customer details without providing a customer_id
mm I see.
taking a step back, what are you trying to do with preview?
Are you trying to show what the proration would look like?
- if they use a promotion code later on
I know proration wouldn't work because the recurring vs single charge logic doesn't work like that.
But I also rely on the preview endpoint to check how taxes apply for a customer
blede_subscription-lifetime
Would you switch them immediately to lifetime? If so you could switch to a "free Price" like a monthly Price first with an extra InvoiceItem for the one-time lifetime fee
So you mean in the preview request, preview them going to a free price id, with the added one time fee?
Wouldn't that throw the same error that an invoice_item cannot be used at the same time as the subscription_details?
You wouldn't cancel for real since you're switching them to a say $0/month Price. That would immediately prorate + charge the extra fee. And you can cancel after that.
A bit of a hack but I think it could work
But that would mean I have to create 2 different invoices right?
You would have a first Invoice switching them to the lifetime Price (one-off InvoiceItem) + a fake $0/month fee + proration for the current Price.
And then you cancel which doesn't need an Invoice since there's nothing to pay at that point
Right, I was able to get what I wanted just using the customer_details instead of the customer_id.
I'll try this approach If I get more time at work!
Thanks for the help and sorry for the trouble!