Recover: failed-payment recovery

Brightdesk finds past-due accounts, sees why each payment failed, and recovers the revenue with retries, card-update requests and offline payments.

Open Recover →

Recover's revenue at risk screen: MRR at risk and past-due accounts grouped by days since the first failed payment

The story

Brightdesk is a fictional help-desk SaaS that bills on Maxio Advanced Billing. Recover is its collections cockpit. It shows every past-due account grouped by how long it has been overdue, why each card payment failed, and each invoice's full history. From there the team can retry a card, ask for a new one, record a payment made by check, or pause a subscription.

At a glance
Use caseDunning, failed payments, accounts receivable
SDK operations15
Live appmxo-recover.pages.dev

Screens

ScreenWhat you see and doSDK calls
Revenue at riskMRR at risk as a share of total MRR. Past-due accounts by days overdue (1–3, 4–7, 8–14, 15+) with the decline reason and card on file. A recovery funnelsubscriptions.listSubscriptions, invoices.listInvoices, invoices.listInvoiceEvents, insights.readMrr
Account recoveryThe card on file (flagged if expired) and a timeline of every invoice event. Retry the card, request a card update, record an offline payment, pause, resume or stop dunningsubscriptions.readSubscription, invoices.readInvoice, paymentProfiles.listPaymentProfiles, subscriptionStatus.retrySubscription, paymentProfiles.sendRequestUpdatePaymentEmail, invoices.recordPaymentForInvoice, subscriptionStatus.pauseSubscription, subscriptionStatus.resumeSubscription, subscriptionStatus.cancelDunning
InvoicesAccounts receivable aging (0–30, 31–60, 61–90, 90+ days). Record one payment across several invoices, or void an invoice with a reasoninvoices.listInvoices, invoices.recordPaymentForMultipleInvoices, invoices.voidInvoice
PlaybookThe dunning timeline: what Maxio does automatically and what the team does, with today's past-due accounts on their stepReuses the overview data

SDK operations

OperationSDK methodUsed for
List subscriptionssubscriptions.listSubscriptionsPast-due accounts
Read subscriptionsubscriptions.readSubscriptionOne account
List invoicesinvoices.listInvoicesOpen and past-due invoices
Read invoiceinvoices.readInvoiceThe amount due before a payment
List invoice eventsinvoices.listInvoiceEventsDeclines, payments and voids on the timeline
Record payment for an invoiceinvoices.recordPaymentForInvoiceA check or wire payment
Record payment for multiple invoicesinvoices.recordPaymentForMultipleInvoicesOne check across several invoices
Void invoiceinvoices.voidInvoiceWrite off with a reason
List payment profilespaymentProfiles.listPaymentProfilesThe card on file
Send request update payment emailpaymentProfiles.sendRequestUpdatePaymentEmailAsk for a new card
Retry subscriptionsubscriptionStatus.retrySubscriptionRetry the card now
Pause subscriptionsubscriptionStatus.pauseSubscriptionPut an account on hold
Resume subscriptionsubscriptionStatus.resumeSubscriptionTake it off hold
Cancel dunningsubscriptionStatus.cancelDunningStop automatic dunning
Read MRRinsights.readMrrTotal MRR for the at-risk share

Code: retry a card and handle Maxio's answer

import { SubscriptionStatus } from "maxio-advanced-billing";

try {
  const { subscription } = await client.subscriptionStatus.retrySubscription({ subscriptionId });
  const recovered = subscription?.state !== "past_due";
} catch (err) {
  // A subscription that is not past due answers 422; narrow on this operation's own error type
  if (err instanceof SubscriptionStatus.RetrySubscriptionError && err.payload.kind === "errorListResponse1") {
    showMessage(err.payload.body.errors.join("; "));
  } else throw err;
}

Errors shown on purpose

  • Maxio 422s: retrying a subscription that is not past due, voiding an invoice that is already void, pausing a canceled subscription, and resuming one that is not on hold.
  • App rules: an offline payment larger than the amount due (the invoice is re-read first), and a void without a reason, are blocked before Maxio sees them.

On this page