Predict credits using the preview invoice API with a terminated_at datetime
Sabrina Bourouis
Before terminating a subscription, I'd like to show the customer what their last invoice would look like with what they still have to pay. As the subscription is pro-rated, we need to deduct the credits from that amount. Unfortunately, the API doesn't return the credits amount when previewing the invoice with a terminated date.