Launch and scale your affiliate program with AFFY. Track referrals, automate payouts, and manage partners with our intuitive affiliate management software.

Chargebee
Active Integration

Chargebee Affiliate Tracking — Automated with AFFY

Chargebee has no affiliate tracking built in. AFFY connects via webhooks and a custom checkout field to automatically attribute every subscription, renewal, and refund to the right affiliate — no manual reconciliation, no spreadsheets.

Without AFFY

Chargebee tracks billing — not your affiliates

  • Manually cross-reference every payment with the affiliate who referred it
  • Subscription renewals require a separate spreadsheet to track recurring commissions
  • No attribution if the customer changes email between click and checkout
  • Refunds require manual corrections to commissions already calculated
  • No affiliate portal — affiliates email you for payment status

With AFFY + Chargebee

Every Chargebee event tracked and attributed automatically

  • Click ID stored on the subscription — attribution survives email changes
  • subscription_renewed fires on each billing cycle, commission created instantly
  • Three-tier attribution: click ID → affiliate ref → email fallback
  • payment_refunded reverses commissions automatically, full or proportional
  • Branded affiliate portal with real-time stats and earnings history
Setup

Live in under 15 minutes

Three steps — including the custom field that makes attribution reliable.

1

Add the tracking script

Paste one script tag into your site's <head>. AFFY stores a 30-day attribution cookie when a visitor clicks an affiliate link.

2

Configure the webhook

Copy your AFFY webhook URL, register it in Chargebee with Basic Auth credentials, enter the same credentials in AFFY, and save your API Key and Site Name.

3

Set up the cf_click_id field

Create the custom field in Chargebee's checkout settings and use the AFFY checkout API to pass the click ID at checkout. This is the key step for reliable attribution.

Step 2 in detail — Chargebee Dashboard

a

In AFFY → Settings → Integration, copy the Chargebee Webhook URL and note your API Key and Site Name fields.

b

In Chargebee → Settings → API Keys & Webhooks → Webhooks, add a new webhook. Paste the AFFY URL, enable Basic Auth with a username and password of your choice, and select events: payment_succeeded, subscription_created, subscription_renewed, subscription_cancelled, payment_refunded.

c

Back in AFFY, enter the same Basic Auth username and password, your Chargebee API Key, and your Site Name (e.g. your-site.chargebee.com). Click Save Settings.

Step 3 in detail — cf_click_id custom field

This field stores the affiliate click ID on the Chargebee subscription. It's what makes attribution reliable when customers change emails between click and checkout.

a

In Chargebee → Configure Chargebee → Checkout & Self-Serve Portal → Fields tab, click Add/Manage Custom Fields under "Custom fields for subscription".

b

Select the Subscriptions tab and add a new field: Type = Single line text, Label = Affiliate Click ID, API Name = cf_click_id (must be exactly this).

c

Return to the Fields tab, find Affiliate Click ID, click Edit, set In checkout to "Use as hidden parameter" and In portal to "Hide". Click Apply, then Publish.

Chargebee v4 limitation: Passing subscription[cf_click_id] directly in the hosted page URL is silently dropped by Chargebee v4. Use the AFFY checkout API (see below) to set it server-side instead.
AFFY checkout API — replaces a direct Chargebee hosted page URL
// 1. Read the AFFY click ID from the tracking script
const clickId = typeof AffyJS !== 'undefined' && AffyJS.getReferralId
  ? AffyJS.getReferralId()
  : null;

// 2. Call the AFFY checkout API — it creates the Chargebee
//    hosted page server-side with cf_click_id correctly set
const res = await fetch(
  'https://affy.pro/api/v1/public/chargebee/YOUR_PUBLIC_ID/create-checkout',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      planId: 'your-chargebee-item-price-id',
      email: customerEmail,
      clickId: clickId,   // null is fine — AFFY handles it gracefully
    }),
  }
);

// 3. Redirect the customer to Chargebee checkout
const { checkoutUrl } = await res.json();
window.location.href = checkoutUrl;
YOUR_PUBLIC_ID is visible in AFFY → Settings → Integration → Chargebee webhook URL. Safe to use in frontend code.
Attribution

Three-tier attribution chain

AFFY tries the most reliable method first. Each fallback ensures no referral is lost.

Highest
1

Click ID (cf_click_id)

Stored on the Chargebee subscription at checkout via the AFFY API. Works even if the customer changes email.

High
2

Affiliate ref code

Passed via subscription metadata at checkout. Reliable when populated.

Medium
3

Customer email

Email from the Chargebee webhook matched against leads recorded by the tracking script. Fails if the customer uses a different email.

Features

Everything Chargebee affiliate tracking needs

Subscription renewals

Track every renewal via subscription_renewed. Configure first-payment-only or lifetime recurring commissions per flow — no extra code.

Plans & Items models

AFFY supports both Chargebee catalog models. Whether you use the legacy Plans model or the newer Items model, checkout creation works correctly.

Three-tier attribution

Click ID → affiliate ref → email fallback. AFFY tries the most reliable method first and falls back gracefully so no referral is lost.

Multi-currency

Chargebee handles global billing. AFFY auto-converts transaction amounts to your base currency at the time of the event.

Refund auto-handling

payment_refunded triggers automatic commission reversal — full or proportional. No manual corrections in your records.

Basic auth verification

Webhook requests are protected with HTTP Basic Auth credentials you control. Unauthenticated requests are rejected before touching commission data.

Supported Chargebee webhook events

Select all five events when creating the webhook in Chargebee.

Chargebee EventWhat AFFY does
payment_succeededCreates a commission for the referred affiliate.
subscription_createdRecords the new subscription; commission created on first payment.
subscription_renewedCreates a commission for the renewal payment.
subscription_cancelledNo commission action — cancellation logged for reporting.
payment_refundedMarks the related commission as Refunded and removes it from the payout queue.
Comparison

AFFY vs Tolt vs Rewardful

Neither Tolt nor Rewardful supports Chargebee. AFFY is the only affordable option.

FeatureAFFY
from €29/mo
Tolt
from $49/mo
Rewardful
from $49/mo
Starting price€29/mo$49+/mo$49/mo
Chargebee
Stripe
Paddle
Subscription renewals
Refund auto-handling
Plans & Items models
GDPR self-service
1099 tax generationPremium
Telegram approval bot

Among major affiliate tools, AFFY is the only one that supports Chargebee at a non-enterprise price point. Full comparison →

Chargebee + AFFY FAQ

No. Chargebee is a subscription billing platform. It doesn't track affiliate referrals or calculate commissions. AFFY connects to Chargebee via webhooks and custom fields to attribute every payment to the right affiliate automatically.

The cf_click_id field stores the AFFY affiliate click ID on the Chargebee subscription at checkout. This is the most reliable attribution method — it works even if the customer uses a different email at checkout than during browsing. Without it, AFFY falls back to email-based attribution, which is less reliable.

Yes. AFFY listens to subscription_renewed events. You can configure commission flows to pay on the first payment only, or on every renewal for lifetime recurring commissions.

Yes. AFFY supports both catalog models. The AFFY checkout API handles the correct format for each model automatically.

This is a known limitation in Chargebee's v4 checkout. Passing subscription[cf_click_id] as a hosted page URL parameter is silently ignored. The only reliable method is to create the checkout session via the AFFY API, which sets the field server-side before the customer reaches checkout.

When Chargebee sends a payment_refunded event, AFFY marks the related commission as Refunded. Full refunds reverse the entire commission; partial refunds reduce it proportionally.

Start tracking Chargebee affiliates today

2 months free on PRO. The only affordable tool with native Chargebee support.

No credit card  ·  Cancel anytime  ·  Also supports Stripe & Paddle