Skip to content

Chargebee

Integrate GoPayLocal with Chargebee for PPP discount coupons.

Chargebee is an enterprise subscription billing platform. GoPayLocal creates coupons in Chargebee for PPP discounts.

  1. 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.

  2. 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., yoursite from yoursite.chargebee.com)

    Click Test after connecting to verify your credentials.

  3. Create a campaign

    Select Chargebee as the payment provider in your campaign settings.

GoPayLocal creates coupons in Chargebee:

POST https://{site}.chargebee.com/api/v2/coupons
Authorization: Basic {api_key}:
coupon[id]=PPP-INDIA-30
coupon[name]=PPP India 30%
coupon[discount_type]=percentage
coupon[discount_percentage]=30
coupon[duration_type]=one_time
coupon[apply_on]=invoice_amount

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.

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());
},
});

Webhook handling for Chargebee is planned. Currently, discount code creation and checkout integration work fully. Redemption tracking via webhooks is on the roadmap.

  • 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)