Chargebee

Chargebee supports subscriptions, a hosted customer portal, and invoice previews. Use this page when you are already operating in the Chargebee ecosystem.

Configuration

<?php

return [
  'bnomei.klub.provider.handler' => \Bnomei\Klub\Provider\ChargebeeProvider::class,
  'bnomei.klub.providers.chargebee' => [
    'api_key' => fn() => env('CHARGEBEE_API_KEY'),
    'site' => fn() => env('CHARGEBEE_SITE'),
    'webhook_auth' => fn() => env('CHARGEBEE_WEBHOOK_AUTH'),
    'webhook_secret' => fn() => env('CHARGEBEE_WEBHOOK_SECRET'),
    'field' => 'chargebee',
  ],
];

Environment variables:

  • CHARGEBEE_API_KEY
  • CHARGEBEE_SITE
  • CHARGEBEE_WEBHOOK_AUTH or CHARGEBEE_WEBHOOK_SECRET

Optional provider keys:

  • checkout for hosted page payload overrides
  • plans for local plan definitions
  • field to override the provider user-data field name

Webhooks

Configure Chargebee webhooks to POST /klub/webhooks/chargebee and secure them with HTTP Basic auth.

Chargebee uses the Authorization header. Set CHARGEBEE_WEBHOOK_AUTH (or CHARGEBEE_WEBHOOK_SECRET) to the expected Basic credentials.

Webhook auth verification is enforced when one of those options is set.

Portal and invoices

  • Portal: supported via Chargebee portal sessions.
  • Invoice preview: supported via Chargebee invoices.

Plan data (local)

Chargebee uses local plans (providers.chargebee.plans or site plans YAML):

  • id should be your Chargebee item price ID.
  • unit_amount and currency are recommended for consistent local catalog output.
  • type should match your use case (recurring or one_time).

Gotchas

  • Chargebee requires both CHARGEBEE_SITE and CHARGEBEE_API_KEY.
  • Webhooks are authenticated via HTTP Basic; configure webhook_auth or webhook_secret.
  • Portal sessions require a stored Chargebee customer ID.

See Purchases for flow details.

Kirby Klub is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2026 Bruno Meilick All rights reserved.