#marcelar
1 messages · Page 1 of 1 (latest)
Hi, retrieve an upcoming invoice API, https://stripe.com/docs/api/invoices/upcoming would show you what an upcoming invoice would look like. Can you share what you mean by current billing cycle?
So if I created a monthly subscription on November 1st, and want to preview adding a seat (which we allow immediately and add to the current subscription cycle), I'd be doing that in the November cycle. But the upcoming invoice endpoint always returns the value as if I was making the change to the upcoming (December) cycle.
Are you adding this proration behavior, https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_proration_behavior?
So when I have a subscription that has a scheduled change to change to a yearly subscription in December, or downgrade etc., the preview cost will be *inaccurate
I have tried adding subscription_proration_date: current_period_start but that results in three line items - a prorated refund, a prorated charge for the current cycle with the original details, and a new charge for the seat as if it was in the upcoming cycle
I'll see if I can put up an example - and note that I'm mostly asking out of curiosity, I sent a support email asking about this and they said it wasn't possible just with stripe API but might be with custom code and referred me to discord
That is correct, when prorations is added, you would see line items that calculates these. You can learn more about it here: https://stripe.com/docs/billing/subscriptions/prorations.
Hmm - it just seems like there's no way to override Stripe's assumption that the upcoming invoice will include the scheduled changes at the end of the period, even if I set an earlier proration date
For instance, if I try to preview the invoice with a scheduled cancel it fails with "no upcoming invoice"
Can you share an example where this, https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_proration_date was not honered?
That is expected as if you cancel a subscription at the end of the current period, there is no longer an upcoming invoice
We allow users to add seats even while their subscription is scheduled to cancel or has a scheduled downgrade. So it seems like you're confirming there's no way/workaround to preview the immediate cost of adding a seat in that state?
Maybe what I'm looking for is a way to pass a custom subscription schedule config here that can override the current one, or some option to ignore existing upcoming changes, but it doesn't look like either is possible currently. I've tried just not providing sub/sub item ids (to try to simulate creating a new subscription) but get an error saying I can't have multiple subscriptions with the same price
So maybe this isn't possible currently - I'll do some last testing to see if I can hack a solution together with the line items, and can comment if I have any success. Thanks for taking a look!
What you're describing to me should work. I'd be happy to look further is you could share an example of two.