Chargebee MRR, invoices and refunds next to your traffic
Give Sumly a read-only Chargebee API key and it reads every subscription, paid invoice and refunded credit note: MRR from the subscription's own items, revenue without tax, and the visit a subscriber came from.
Connected in three steps
A read-only key, pasted once. Sumly does the rest.
-
1
In Chargebee: Settings → Configure Chargebee → API Keys and Webhooks → API Keys → Add API Key, and pick Read-Only Key → Read-only: All. Name it Sumly.
-
2
Paste the key and your site's name, the part before .chargebee.com (acme for acme.chargebee.com). A test site has its own keys.
-
3
To trace subscriptions to visits, add a custom field cf_sumly_visitor_id to subscriptions and fill it at checkout, or set meta_data
sumly_visitor_idon the subscription.
Or let your coding assistant do it
Paste this into Claude Code, Cursor or Codex in your project. It fits the code to how your project is built, asks you for the dashboard steps and leaves the keys to you.
See what it says
Set up Chargebee for Sumly in this project.
Sumly (https://sumly.dev) shows revenue next to the visits and app users it came from. The full guide is https://sumly.dev/integrations/chargebee; read it if anything below is unclear.
Steps:
1. In Chargebee: Settings → Configure Chargebee → API Keys and Webhooks → API Keys → Add API Key, and pick Read-Only Key → Read-only: All. Name it Sumly.
2. Paste the key and your site's name, the part before .chargebee.com (acme for acme.chargebee.com). A test site has its own keys.
3. To trace subscriptions to visits, add a custom field cf_sumly_visitor_id to subscriptions and fill it at checkout, or set meta_data `sumly_visitor_id` on the subscription.
So each payment shows which visit it came from: Chargebee's hosted checkout keeps pass_thru_content on the hosted page, not on the subscription, so Sumly cannot read it back. Instead, add a custom field named cf_sumly_visitor_id to subscriptions (Settings → Configure Chargebee → Custom Fields), and fill it with sumly.visitorId when you open checkout, or set meta_data {"sumly_visitor_id": …} on the subscription from your server after it is created. Each invoice of that subscription then counts for the visit that started it.
Keep in mind: Built from Chargebee's API v2 documentation and tested against responses shaped like it; it has not yet been tried on a live site. Tell us if a number looks off. Chargebee's API carries no gateway fee, so payments show without one; the fee stays at your payment gateway. Coupons are not taken off MRR: a subscription counts at its items' price. Use a Read-only: All key. A restricted read-only key may not reach credit notes.
How to work:
- Look at how this project is built first, and fit the code to its framework and its way of doing things; the examples above are a starting point, not something to paste as is.
- Steps that happen in a dashboard (Sumly, or Chargebee's own) are mine: tell me exactly what to click, then wait for me.
- The Chargebee key goes into Sumly (Projects and payments), not into this project: Sumly reads Chargebee itself. Your part in the code is only carrying the visitor into checkout, as above.
- Keys the code needs belong in environment variables, never in the code or the repository. Never ask me to paste a secret key into this chat; tell me which variable to set.
- Change only what this needs, show me the changes before you commit, and tell me how to check that it works.
What you see after connecting
Chargebee next to every other project and provider, on the same pages.
Overview
MRR, ARR, revenue per customer, paying customers, trials and the MRR set to cancel.
Refunds
Paid invoices without tax, with the buyer's name and country, and refunds from credit notes.
Metrics over time, plans by item price, customers, the outlook and a CSV export.
With the visitor on the subscription
Revenue by source, campaign and country, and ROI for each cost.
Which visit paid
Chargebee's hosted checkout keeps pass_thru_content on the hosted page, not on the subscription, so Sumly cannot read it back. Instead, add a custom field named cf_sumly_visitor_id to subscriptions (Settings → Configure Chargebee → Custom Fields), and fill it with sumly.visitorId when you open checkout, or set meta_data {"sumly_visitor_id": …} on the subscription from your server after it is created. Each invoice of that subscription then counts for the visit that started it.
How attribution works →Counts toward your plan
Nothing: payments, customers and refunds never count toward your plan. Only the page views and app screens Sumly keeps do. Plans →
The details
What Sumly reads
- Subscriptions with their plans and addons, trials, pauses and scheduled cancellations
- Paid invoices, without tax, with the buyer's name and country
- Credit notes that gave money back, full or partial
- The custom field cf_sumly_visitor_id or meta_data sumly_visitor_id, where you set one
When Sumly reads Chargebee
- Every 15 minutes. The first read takes three years of paid invoices.
- Invoices are read by the time they last changed, so one paid days after it was raised is still picked up.
- Credit notes are read 120 days further back, since a refund often comes weeks after the payment.
- Subscriptions are read whole each time.
- With the optional webhook, Sumly reads at once when anything changes.
How Chargebee money is counted
- Monthly value
- Each plan and addon item's amount, spread over its billing period: a yearly item counts a twelfth each month. One-time charges are left out. Chargebee's own mrr field is not used, as its docs warn it may be off.
- Trials
- A subscription in trial counts from its trial end.
- Cancellations
- Non-renewing leaves MRR the moment the cancellation was scheduled. Cancelled and transferred ones have ended.
- Paused
- It stops counting from its pause date.
- Payments
- Paid invoices, the total less tax, on the day they were paid. Credits applied are already in the total.
- Refunds
- Refundable credit notes, by the amount actually refunded, without its share of tax. Adjustment notes only lower what is owed and move no money.
- Currency
- Each invoice in its own currency, turned into euros at the European Central Bank's rate of the day.
Good to know
- Built from Chargebee's API v2 documentation and tested against responses shaped like it; it has not yet been tried on a live site. Tell us if a number looks off.
- Chargebee's API carries no gateway fee, so payments show without one; the fee stays at your payment gateway.
- Coupons are not taken off MRR: a subscription counts at its items' price.
- Use a Read-only: All key. A restricted read-only key may not reach credit notes.
Chargebee questions
Can Sumly change anything in Chargebee?
No. A read-only key cannot create, change or cancel anything.
Why no fees?
Chargebee bills through your payment gateway and its API keeps no gateway fee. Net revenue equals revenue without tax.
Does it work with Product Catalog 1.0?
Yes. A site still on the older catalog has a plan on each subscription instead of items, and that plan's amount is used.
Does the webhook need a password?
No. Chargebee does not sign webhooks; the address Sumly gives you carries a secret, and the call only tells Sumly to read now with your key.
Is this tested on a real site?
Not yet. It follows Chargebee's API documentation and is tested against responses shaped like it. If a number does not match, tell us.
Other integrations
Try it with your own projects
Sign in with Google or a code by e-mail and connect your first project. Free for one project, and 14 days of a paid plan with no card.
Start freeOr look around first: open the live demo.