Setup steps

  1. In Chargebee, open Settings → Configure Chargebee → API Keys and create a read-only key.
  2. In ProductLense, open Settings → Billing connections → Chargebee and paste the site name and key.
  3. In Chargebee → Settings → Webhooks, add a webhook endpoint with the URL ProductLense shows after you save the connection (pattern https://api.productlense.app/api/webhooks/{provider}/{connection_id}).
  4. Turn on basic authentication with a username and password and enter the same pair in ProductLense.
  5. ProductLense backfills 12 months of transactions and credit notes.

Credentials and permissions

Credentials ProductLense asks for
FieldSecretWhere to find it
Site nameNoThe subdomain of your Chargebee site: {site}.chargebee.com.
API keyYes, encrypted at restA read-only full-access key from Settings → Configure Chargebee → API Keys.
Webhook usernameNoThe basic-auth username you set on the webhook in Chargebee.
Webhook passwordYes, encrypted at restThe basic-auth password you set on the webhook.

Webhook

URL pattern, shown with your connection id after you save:

text
https://api.productlense.app/api/webhooks/chargebee/{connection_id}

Events: payment_succeeded, payment_refunded, subscription_* (created, changed, cancelled and the rest), customer_* (created, changed)

Verification: Basic auth on the webhook URL, compared in constant time.

What ProductLense reads

Customers
Customers with email.
Subscriptions
Subscriptions on Product Catalog 1.0 and 2.0.
Payments
Payment transactions.
Refunds
Refund transactions and offline credit-note refunds.
Fees
Not available: gateway fees are not stored in Chargebee, so they are recorded as 0.

What ProductLense never touches

  • Never creates, changes, refunds or cancels anything: read-only API calls and incoming webhooks only.
  • Never moves money, issues payouts, or reads bank account details.
  • Never sees full card numbers; providers do not expose them.
  • Never sends your customer data to the AI model: Ask and the daily insight see aggregates only.

Match payments to your users

Set metadata or a custom field cf_pl_user_id on the customer to match by id.

Chargebee does not hold gateway fees. Connect either Chargebee or its gateway for a given payment, not both, so a payment is not counted twice.

Chargebee API: create the customer
curl https://YOUR_SITE.chargebee.com/api/v2/customers \
  -u CHARGEBEE_API_KEY: \
  -d email="[email protected]" \
  -d meta_data='{"pl_user_id":"user_123"}'

Chargebee and ProductLense: questions

Does ProductLense work with Chargebee?
Yes. ProductLense connects to Chargebee with site name, aPI key, webhook username, webhook password, backfills 12 months of history, and stays current through signed webhooks plus a nightly reconcile. One connection is included on Starter; Growth and Scale allow every provider at once on the same site.
What data does ProductLense read from Chargebee?
Customers, subscriptions, payments, refunds and fees, read-only. Payments: payment transactions. Refunds: refund transactions and offline credit-note refunds. Fees: not available: gateway fees are not stored in Chargebee, so they are recorded as 0.
Can ProductLense change anything in my Chargebee account?
No. ProductLense only makes read calls and receives webhooks. It never creates, changes, refunds or cancels anything, never moves money, and never sees card numbers. Credentials are encrypted at rest, and the AI features only ever see aggregated numbers, never your customers’ data.
How does ProductLense match Chargebee payments to visitors?
Set metadata or a custom field cf_pl_user_id on the customer to match by id. Your site calls identify with the same user id after signup, and ProductLense follows the payment to that visitor’s first touch: source, medium, campaign and landing page.
Are Chargebee fees subtracted from revenue?
Not available: gateway fees are not stored in Chargebee, so they are recorded as 0. Net revenue is the charge minus the fee; refunds subtract the refunded amount and its fee. Profit per channel then subtracts ad spend.

Connect Chargebee and see revenue by channel today.

Add the script, connect Stripe or any of 14 other billing providers, and see revenue by channel the same day.