Chargebee
Integrate GoPayLocal with Chargebee for PPP discount coupons.
Chargebee is an enterprise subscription billing platform. GoPayLocal creates coupons in Chargebee for PPP discounts.
-
Get your Chargebee API key
Go to your Chargebee dashboard > Settings > Configure Chargebee > API Keys. Create a Full Access API key.
Chargebee uses Basic Auth with your API key as the username and an empty password.
-
Connect in GoPayLocal
Go to your GoPayLocal dashboard > Settings > Integrations > Chargebee and click Connect. Enter:
- API Key — Your Full Access API key
- Account / Store ID — Your Chargebee subdomain (e.g.,
yoursitefromyoursite.chargebee.com)
Click Test after connecting to verify your credentials.
-
Create a campaign
Select Chargebee as the payment provider in your campaign settings.
How Discounts Work
Section titled “How Discounts Work”GoPayLocal creates coupons in Chargebee:
POST https://{site}.chargebee.com/api/v2/couponsAuthorization: Basic {api_key}:
coupon[id]=PPP-INDIA-30coupon[name]=PPP India 30%coupon[discount_type]=percentagecoupon[discount_percentage]=30coupon[duration_type]=one_timecoupon[apply_on]=invoice_amountTest Mode
Section titled “Test Mode”Chargebee provides a test site:
- Your test site URL is
{site}-test.chargebee.com - Use test site API keys for development
- Test payments with Chargebee’s test gateway
Set the site name to your test site in the GoPayLocal integration settings.
Auto-Apply
Section titled “Auto-Apply”Chargebee does not support auto-applying coupons via URL parameters in their hosted checkout. Visitors must enter the coupon code manually.
For Chargebee.js (embedded checkout), you can pass the coupon:
cbInstance.openCheckout({ hostedPage: () => { return fetch('/api/create-checkout', { method: 'POST', body: JSON.stringify({ coupon: 'PPP-INDIA-30' }), }).then(res => res.json()); },});Webhooks
Section titled “Webhooks”Webhook handling for Chargebee is planned. Currently, discount code creation and checkout integration work fully. Redemption tracking via webhooks is on the roadmap.
Limitations
Section titled “Limitations”- No auto-apply via hosted checkout URL
- Coupon IDs are limited to 50 characters
- Basic Auth only (no OAuth)
- Coupons cannot be scoped to specific plans via GoPayLocal (manual setup required)