Download the PHP package chargebee/chargebee-php without Composer

On this page you can find all versions of the php package chargebee/chargebee-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chargebee-php

Chargebee PHP Client Library - API V2

Packagist Packagist Packagist Packagist

[!NOTE] Join Discord

We are trialing a Discord server for developers building with Chargebee. Limited spots are open on a first-come basis. Join here if interested.

This is the official PHP library for integrating with Chargebee.

Note: Chargebee now supports two API versions - V1 and V2, of which V2 is the latest release and all future developments will happen in V2. This library is for API version V2. If you’re looking for V1, head to chargebee-v1 branch.

Requirements

PHP 8.1 or later

Installation

Composer

is available on Packagist and can be installed using Composer

composer require chargebee/chargebee-php

To use the bindings,

require_once('vendor/autoload.php');

Usage

To create a new subscription:

Create an idempotent request

Idempotency keys are passed along with request headers to allow a safe retry of POST requests.

isIdempotencyReplayed() method can be accessed to differentiate between original and replayed requests.

Retry Handling

Chargebee's SDK includes built-in retry logic to handle temporary network issues and server-side errors. This feature is disabled by default but can be enabled when needed.

Key features include:

Example: Customizing Retry Logic

You can enable and configure the retry logic by passing a retryConfig object when initializing the Chargebee environment:

Example: Rate Limit retry logic

You can enable and configure the retry logic for rate-limit by passing a retryConfig object when initializing the Chargebee environment:

Telemetry (OpenTelemetry)

Optional. Pass a telemetryAdapter when you want Chargebee API calls traced in your observability stack (Datadog, Splunk, Honeycomb, Jaeger, etc.). OpenTelemetry is not bundled with chargebee/chargebee-php β€” install and configure it in your app, implement TelemetryAdapter, and wire it on the client.

The SDK builds standardized span attributes (startAttributes, endAttributes) following the stable OpenTelemetry HTTP semantic conventions (url.full, http.request.method, http.response.status_code, server.address, error.type) plus Chargebee-specific chargebee.* attributes β€” use them as-is so spans render correctly in your APM and stay consistent across SDKs.

Note: url.full intentionally omits the query string (it carries only scheme, host, and path) to avoid leaking potentially sensitive query parameters into traces. This is a deliberate, cross-SDK PII-safety choice.

Spans are named chargebee.{resource}.{operation} (e.g. chargebee.subscription.create).

When no adapter is configured, the SDK skips all telemetry work β€” zero overhead for existing integrations.

Trace shape

The SDK emits one CLIENT span per API call, covering the full lifecycle. Retries reuse the same span β€” onRequestStart runs once before the retry loop and onRequestEnd runs once after the final outcome.

If you separately enable HTTP auto-instrumentation (e.g. an OpenTelemetry PHP agent on Guzzle), it will create an additional transport-level HTTP span as a sibling of the Chargebee span. For the cleanest trace where chargebee.{resource}.{operation} is the single propagating span, leave HTTP auto-instrumentation off for Chargebee calls.

OpenTelemetry setup

OpenTelemetry is not bundled β€” install it in your app:

Configure OpenTelemetry at app startup (tracer provider, exporter, propagator), then pass your adapter:

RequestTelemetryResult also exposes durationMs if you want to record request duration on the span (e.g. $span->setAttribute('chargebee.request.duration_ms', $result->durationMs)).

To add custom span attributes (tenant ID, correlation ID, etc.), set them in your adapter's onRequestStart / onRequestEnd β€” use your own namespace (e.g. app.tenant_id), not chargebee.*.

Spans are exported by your own OpenTelemetry setup, so they flow to whatever backend you've configured. The Chargebee config above stays the same regardless of backend.

License

See the LICENSE file.


All versions of chargebee-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.0
guzzlehttp/guzzle Version >=7
php-http/discovery Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chargebee/chargebee-php contains the following files

Loading the files please wait ...