Chargebee

Connect Chargebee so its subscriptions grant and end CashSDK entitlements and its payments, renewals and refunds land in one revenue view.

Chargebee handles subscription billing, dunning, and revenue operations at scale, with quoting, proration, and tax integrations for teams with complex pricing. Connect it to CashSDK and RevOps keeps its billing engine while your app reads one entitlement model, and Chargebee's payments land in a single revenue view.

How it works#

1
Connect your Chargebee site

Connect Chargebee from your app's Marketplace page with an API key, your site name and a webhook username and password.

2
Map item prices to entitlements

Each Chargebee item price (or plan) ID matches a CashSDK product and the entitlement it unlocks.

3
Receive webhooks

Successful payments and renewals become revenue, a refunded payment comes off by its amount, and subscription events grant and end access.

Connect Chargebee#

1
Create an API key

In Chargebee, go to Settings → Configure Chargebee → API Keys and create a read-only key. Copy it.

2
Add it to CashSDK

In the dashboard, open your app's Marketplace page, choose Chargebee and select Connect. Pick Sandbox for a test site or Production for your live site. Enter the key, your site name (acme-test), and a username and password for the webhook's Basic authentication. Credentials are stored encrypted at rest.

3
Register the webhook

Copy the connection's webhook URL from the Connected list and add it in Chargebee under Settings → Configure Chargebee → Webhooks with the same Basic authentication username and password. Send payment_succeeded, payment_refunded and the subscription events: subscription_created, subscription_activated, subscription_changed, subscription_renewed, subscription_cancelled, subscription_reactivated, subscription_paused and subscription_resumed.

4
Activate

Back in CashSDK, select Activate on the connection.

Map your catalog#

Payments for prices your app does not sell are skipped, so for each Chargebee item price create a product in CashSDK whose identifier is the item price ID (or the plan ID on Chargebee's older catalog) and attach the entitlement it unlocks. To point an ID at an existing product instead, map it with map_marketplace_catalog (prompt setup).

  • A subscription grants access while Chargebee reports it active, in_trial or non_renewing. A non_renewing subscription keeps access until its term ends. Any other status ends it.
  • A refunded payment comes off your revenue, a partial refund only by its amount. A refund of the whole payment also ends the access that payment gave.

Who gets access#

Set cashsdk_user_id in the subscription's meta_data, or in a custom field named cf_cashsdk_user_id. CashSDK reads it from the subscription events and remembers it for that subscription. Without it, the Chargebee customer ID stands in for the user. Link it to the right user with the link_marketplace_user tool on the MCP server.

Test and go live#

1
Test on a test site

With a Sandbox connection to your Chargebee test site, create a test subscription. Confirm the payment appears under Transactions and the entitlement is granted to your test user.

2
Switch to production

Add a Production connection with your live site's key, its own webhook and credentials. Your CashSDK publishable key does not change.

Next steps#