#ibgoldbergs
1 messages · Page 1 of 1 (latest)
Hi @delicate rune You can get the credit info from the post_payment_credit_notes_amount field of the upcoming invoice. https://stripe.com/docs/api/invoices/object#invoice_object-post_payment_credit_notes_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There's also a pre_payment_credit_notes_amount, so you can use both to calculate the difference
So in an upgrade scenario, should I always consider credit?
and in a downgrade scenario, I should show:
(post_payment_credit_notes_amount)
?
does that sound right?
Correction -> you should check pre_payment_credit_notes_amount because the upcoming invoice is not yet paid.
So in both scenarios we should show the final amount by
Total - pre_payment_credit_notes_amount?
You can just use amount_due
oh
so if somebody downgrades from Premium to Starter then amount due would likely just show $0?
given we use always_invoice
In most cases yes.
Thanks for the help, I think I get it