#arvindkgs
1 messages ยท Page 1 of 1 (latest)
๐ Looking into this now
Invoking GET /invoices. api for above invoice shows
"amount_due": 250000,
"amount_paid": 248000,
"amount_remaining": 2000,
amount_paid should have been 250000
Upon checking, $20 credited due to bank fee was the note added by your coworker: https://dashboard.stripe.com/invoices/in_1MA6kiBD6kZ350ZVHEF6tCkL
In https://dashboard.stripe.com/logs/req_zATouf7k2113TI, your coworker set forgive [0] parameter to true that any insufficient amount (in this case $20) will be treated as charge full amount.
[0] https://stripe.com/docs/api/invoices/pay#pay_invoice-forgive
This bank fee is not charged by Stripe, but a note that added by your coworker
You won't be able to find such bank fee in balance transactions
Understood thanks for the information. Now I display the billing info on my website and I listen to invoice.updated that says amount_remaining = $20 . But actually I want to say amount_remaining = $0. How do I reconcile amount remaining by considering this bank fee. Which api/event gives this info?
The last invoice.updated received - evt_1MK8gQBD6kZ350ZVs7lZywOy had
"amount_paid": 248000,
"amount_remaining": 2000,```
So I have no way to ascertain if bank fee was credited.
Since remaining amount is considered as bank fee on your side, Stripe won't be able to know that this is a bank fee. $20 credited due to bank fee is simply a note added on the invoice and Stripe doesn't have an API to retrieve invoice notes.
One way I can think of is to check the status of the invoice. If the invoice is paid and the amount_remaining is non-zero, it's likely a bank fee defined on your side unless you have other forgiven use cases
So are you telling me there are no scenarios where amount_remaining is non-zero, due to customer consciously paying lesser amount
If the customer pay lesser amount, then the status won't be paid and will still be left as open unless the invoice is fully paid
Only when the request is set to forgive, then the invoice will then be considered as paid
when can a invoice payment be flagged forgiven , after payment is made?
The invoice can be flagged as forgiven during /pay (when paying an invoice): https://stripe.com/docs/api/invoices/pay#pay_invoice-forgive
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But the source for the setting forgiven - https://dashboard.stripe.com/logs/req_zATouf7k2113TI is from dashboard not api
And I assume /pay is invoked when client is paying, not something my me or my coworker can control
In https://dashboard.stripe.com/logs/req_zATouf7k2113TI, this request was made by your coworker. You can see Source section with the Dashboard user (xxx@xxx.com) that invoked this request.
In the same page, Origin section also indicated that the request was made via Dashboard (not API)
Okay, so flow is -
- Invoice sent to customer
- Customer attempts payment from link in invoice
- Payment intent reported in Stripe dashboard
- I can go and set forgive for specific payment intent.
- Invoice set as paid
Correct?
@midnight seal
Just a minor correction at Step 4. The forgiven fund is on Invoice, not Payment Intent
No problem! Happy to help ๐ Unfortunately forgiven flag is not reflected in Invoice object