Get dunning totals
const url = 'http://localhost:8080/v1/dunning/stats';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/v1/dunning/stats \ --header 'Authorization: Bearer <token>'Counts of dunning runs by state, and the amount still due on active
and escalated runs. The amount covers only invoices in the tenant’s
default currency, named in currency.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Dunning totals.
object
Resolved runs, whatever closed them (a payment, a void or a write-off).
Resolved runs that a payment closed (resolution is payment_recovered and the invoice has amount_paid_cents above 0). A run closed by a credit note or customer credit that left nothing due is resolved, not recovered.
Amount due on active and escalated runs whose invoice is still open, in currency only. A voided or written-off invoice is not at risk.
The tenant’s default currency.
Amount due on active and escalated runs whose invoice is still
open, one entry per currency. currency comes first, then the
largest amount. Empty when no run is at risk.
object
Example generated
{ "active_count": 1, "escalated_count": 1, "resolved_count": 1, "recovered_count": 1, "at_risk_cents": 1, "currency": "example", "at_risk_by_currency": [ { "currency": "example", "amount_cents": 1 } ]}