RecipeUnpaid invoices, risk-ranked
Versionv1.0
PublishedJune 2026
StatusLive
Tools usedlist_invoices
Query typeCollections / AR
Collections recipe

Surface every unpaid invoice with Chargebee MCP,  
risk-ranked for collections

Ask your billing data one question. Get a ranked outreach list in minutes, with every account scored by recovery likelihood, not invoice size.

THE COLLECTIONS DASHBOARD ARTIFACT

The recipe returns one explorable dashboard: a KPI strip and monthly volume up top, a risk-mix and aging breakdown in the middle, and a ranked Top 50 outreach table you can search and filter by risk signal, with direct links into each record.

// Anonymized sample shown. Company names, IDs, and emails are illustrative.

01 What Chargebee MCP changes

Collections triage stops being a sort-by-amount spreadsheet.

The old way is manual: export the unpaid invoices, build a pivot table, sort by amount, and work down from the top. That largest-first ranking quietly misses the accounts that matter most: the one where every automated retry has run dry, the customer who stopped generating invoices six weeks ago, and the enterprise contract on net-90 terms that has not failed yet but will.

The ranking built here weights dollar risk by the square root of the amount, not the raw figure, then layers on failure history, dunning exhaustion, invoice aging, and a silent-churn signal. So a $240K account that has gone 47 days silent with dunning already exhausted outranks several larger but healthier invoices.

Every account arrives already classified by what its billing history shows, and each classification points to a specific next action, so the right intervention reaches the right account first.

silent churn
3+ unpaid, newest >30 days, no new billing

The customer may have moved on or is in distress. Right first step: a customer success call to confirm account status, not another automated retry.

active failing
3+ unpaid, at least one raised in last 30 days

The subscription is live, the payment method is failing. Right step: a card-update request or a direct call to fix payment details.

AR follow-up
single large invoice on net terms, not yet failed

A scheduled payment, not a broken one. Right step: a finance-team follow-up, not an automated dunning sequence.

routine
small balances, recent, no failure history

Standard dunning handles these. No manual intervention needed.

03 The exact prompt

Paste this into any MCP-connected AI client to run the recipe on your own data. It stays collapsed by default, so business readers can skip the technical detail.

Show the full prompt+
Customize this step

The risk weights and the four classification thresholds are where you adapt the recipe. Adjust the failure, dunning, aging, and churn multipliers, or the unpaid-count and age cutoffs, to match how your team prioritizes recovery.

Build me an unpaid-invoices collections dashboard from Chargebee for the current year YTD.

Data pull (via Chargebee MCP):
. Use list_invoices filtered to payment_due, not_paid, and posted status,
  dated from January 1 of this year. Sort by date descending.
. Paginate fully, keep going until next_offset returns null.
. Keep linked_payments, dunning_attempts, dunning_status, net_term_days,
  and billing_address on each record. These drive the risk model.
. Skip per-customer history pulls. The unpaid invoice list carries all
  the signal needed.

Risk score per customer (dollar-weighted):
  risk_score = sqrt(amount_usd)
             x failure_multiplier   (1 + min(failed_payments / 30, 0.5))
             x dunning_multiplier   (1 + min(dunning_exhausted x 0.1, 0.3))
             x age_multiplier       (1.0 to 1.55 stepped at 30 / 60 / 90 / 120 days)
             x churn_multiplier     (1.3 if silent_churn_risk, else 1.0)

Use sqrt(amount) not log(amount) for the dollar weight. Log compresses too
aggressively and lets a $500 account with 30 failed payments outrank a $500K
AR invoice, which is the wrong call for collections triage.

Classify each customer as:
. silent_churn_risk      3+ unpaid invoices AND newest is >30 days old
. active_billing_failing 3+ unpaid invoices AND newest within last 30 days
. ar_follow_up           single invoice with net_term_days >=30 OR amount >=$50K
. routine                everything else

Deliver:
1. XLSX workbook with four sheets: Summary, Top 50 Priority (color-coded by
   risk signal, hyperlinked to Chargebee), All Customers, Invoice Detail.
2. Single-file HTML dashboard: KPI strip, monthly volume chart, risk-mix
   donut, aging buckets, country exposure, Top 50 table with search and
   filter pills.
04 Try it yourself

Requirements
A Chargebee account, and an AI client that supports MCP (Claude, ChatGPT, Cursor, and others) with Chargebee connected.
Setup
Connect Chargebee to your AI client using OAuth. No API keys or technical setup required.
What to expect
On large invoice volumes, your AI client makes several calls to retrieve the full dataset before scoring begins. The process runs automatically, and you receive both files when it is done.
What you get
A prioritized Excel workbook segmented by risk type, and a self-contained HTML dashboard. Both link directly to each customer and invoice inside Chargebee.
More recipes