Quick question about changing subscriptions, proration and customer balance.
I have subscriptions with various prices and intervals (let's say, 10$/month, 20$/3 month, 50$/6 month, 100$/year, etc).
When a customer changes price and/or interval, I want to show them the proration that will be applied, how much they will be charged now et what their customer balance will be, so I'm using upcoming invoices as described in https://stripe.com/docs/billing/subscriptions/prorations
There seems to be an issue with the ending_balance in there. Let's say for req_Mn5cf1S42X54Xf,
This is the relevant part of the response I get :
{
"object": "invoice",
"amount_due": 439,
"amount_paid": 0,
"amount_remaining": 439,
"billing_reason": "upcoming",
"charge": null,
"collection_method": "charge_automatically",
"created": 1691684608,
"ending_balance": 0,
"livemode": false,
"next_payment_attempt": 1691688208,
"period_end": 1691684608,
"period_start": 1689006208,
"starting_balance": -1910,
"subscription": "sub_1NRiMOJhU1jdykbLQ1fxgt85",
"subscription_proration_date": 1689347421,
"subtotal": 2349,
"subtotal_excluding_tax": 2349,
"total": 2349,
}
If amount_due is 439, and the starting_balance is -1910, the ending_balance can't be 0. Shouldn't it be -1910 + 439 = -1471 ?
If I apply the modification to the subscription, the new balance is indeed -14.71$