Overview
Connect Chargebee to automatically track subscription payments and manage recurring commissions for your partners.Features
- Subscription tracking - Full subscription lifecycle support
- Recurring commissions - Automatic commission on renewals
- Invoice tracking - Track all invoice payments
- Refund handling - Automatic commission adjustments
Setup
Step 1: Get API Credentials
- Log in to your Chargebee dashboard
- Go to Settings → Configure Chargebee → API Keys
- Create a Full Access API key (or Read Only for tracking only)
Step 2: Configure in Partnero
- Go to Program Settings → Integrations
- Select Chargebee
- Enter your Site name and API key
Step 3: Set Up Webhook
Configure webhook in Chargebee:- Go to Settings → Configure Chargebee → Webhooks
- Add webhook URL:
https://api.partnero.com/v1/integrations/chargebee/{your_program_id}/webhook - Select events:
- Invoice Created
- Invoice Updated
- Payment Succeeded
- Payment Refunded
- Subscription Created
- Subscription Renewed
- Subscription Cancelled
Step 4: Configure Webhook Security
Set up webhook verification:- Copy your webhook username and password from Chargebee
- Enter credentials in Partnero integration settings
How It Works
Payment Flow
Customer Attribution
Customers are linked via:- Customer ID matching - Chargebee customer ID synced to Partnero
- Email matching - Customer email used for attribution
- Metadata - Partner info in Chargebee metadata
Passing Partner Data
Include partner attribution in Chargebee:Subscription Lifecycle
New Subscriptions
When a subscription is created:- First invoice payment creates transaction
- Commission calculated for partner
- Subscription linked for future tracking
Renewals
On each subscription renewal:- New transaction created automatically
- Commission calculated (if recurring enabled)
- Partner continues earning
Upgrades/Downgrades
Plan changes are tracked:- Prorated amounts handled correctly
- Commission adjusted based on new amount
Cancellations
When subscription is cancelled:- Future renewals stop
- No new commissions generated
- Historical data preserved
Refund Handling
Chargebee refunds are processed automatically:- Credit note or refund issued in Chargebee
- Webhook notification sent
- Transaction marked as refunded
- Commission reversed
Custom Fields
Create custom fields in Chargebee to store partner data:- Go to Settings → Configure Chargebee → Custom Fields
- Add field
cf_partnero_partnerto Customer - Pass partner code when creating customers
Testing
Test Site
Use Chargebee’s test site:- Create test site in Chargebee
- Configure webhook for test site
- Use test card numbers
Test Cards
| Card | Result |
|---|---|
4111111111111111 | Success |
4000000000000002 | Declined |
Troubleshooting
Webhooks not received
Webhooks not received
- Check webhook URL in Chargebee settings
- Verify webhook is enabled
- Check Chargebee webhook logs
Authentication failed
Authentication failed
- Verify API key is correct
- Ensure site name matches exactly
- Check API key permissions
Partner attribution missing
Partner attribution missing
- Ensure custom field is passed correctly
- Check customer has referral cookie
- Verify email matching is working
