PHPackages                             paddlehq/paddle-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. paddlehq/paddle-php-sdk

ActiveLibrary[API Development](/categories/api)

paddlehq/paddle-php-sdk
=======================

Paddle's PHP SDK for Paddle Billing.

v1.17.1(1mo ago)56330.7k↓16.2%11[4 issues](https://github.com/PaddleHQ/paddle-php-sdk/issues)[2 PRs](https://github.com/PaddleHQ/paddle-php-sdk/pulls)1Apache-2.0PHPPHP ^8.1CI passing

Since Jan 11Pushed 1mo ago12 watchersCompare

[ Source](https://github.com/PaddleHQ/paddle-php-sdk)[ Packagist](https://packagist.org/packages/paddlehq/paddle-php-sdk)[ Docs](https://developer.paddle.com/api-reference/overview)[ RSS](/packages/paddlehq-paddle-php-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (44)Versions (46)Used By (1)

Paddle PHP SDK
==============

[](#paddle-php-sdk)

[![Build Status](https://github.com/PaddleHQ/paddle-php-sdk/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/PaddleHQ/paddle-php-sdk/actions/?query=branch%3Amain)[![Latest Stable Version](https://camo.githubusercontent.com/4b4bcd6462832cc943f67c82962227ee2acde844b2f70da8613d486ab8cb70b6/68747470733a2f2f706f7365722e707567782e6f72672f706164646c6568712f706164646c652d7068702d73646b2f76)](https://packagist.org/packages/paddlehq/paddle-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/d81439e696aebf9ad0b8a6412c7b3ad93b8f5224a510d3ebc43acbf283ecfd8a/68747470733a2f2f706f7365722e707567782e6f72672f706164646c6568712f706164646c652d7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/paddlehq/paddle-php-sdk)[![License](https://camo.githubusercontent.com/6c38b91da6c82ab742db8e1c8323c5ce937283372b7c53684c7172099cee269e/68747470733a2f2f706f7365722e707567782e6f72672f706164646c6568712f706164646c652d7068702d73646b2f6c6963656e7365)](https://packagist.org/packages/paddlehq/paddle-php-sdk)

[Paddle Billing](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-php-sdk) is the developer-first merchant of record, designed for modern SaaS, AI, mobile app, and digital product businesses. We take care of payments, tax, subscriptions, and metrics with one unified API that does it all.

This is a [PHP](https://www.php.net/) SDK that you can use to integrate Paddle Billing with applications written in PHP.

For working with Paddle in your frontend, use [Paddle.js](https://developer.paddle.com/paddlejs/overview?utm_source=dx&utm_medium=paddle-php-sdk). You can open checkouts, securely collect payment information, build pricing pages, and integrate with Paddle Retain.

> **Important:** This package works with Paddle Billing. It does not support Paddle Classic. To work with Paddle Classic, see: [Paddle Classic dev docs](https://classic.paddle.com/?utm_source=dx&utm_medium=paddle-php-sdk)

Requirements
------------

[](#requirements)

PHP 8.1 and later.

Composer
--------

[](#composer)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require paddlehq/paddle-php-sdk
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once 'vendor/autoload.php';
```

Usage
-----

[](#usage)

To authenticate, you'll need an API key. You can create and manage API keys in **Paddle &gt; Developer tools &gt; Authentication**.

Pass your API key while initializing a new Paddle client.

```
use Paddle\SDK\Client;

$paddle = new Client('API_KEY');
```

You can also pass an environment to work with the sandbox:

```
use Paddle\SDK\Client;
use Paddle\SDK\Environment;
use Paddle\SDK\Options;

$paddle = new Client(
    apiKey: 'API_KEY',
    options: new Options(Environment::SANDBOX),
);
```

Keep in mind that API keys are separate for your sandbox and live accounts, so you'll need to generate keys for each environment.

Examples
--------

[](#examples)

### List entities

[](#list-entities)

You can list supported entities with the `list` function in the resource. It returns an iterator to help when working with multiple pages.

```
use Paddle\SDK\Client;

$paddle = new Client('API_KEY');

$products = $paddle->products->list();

// List returns an iterable, so pagination is handled automatically.
foreach ($products as $product) {
    echo $product->id;
}
```

### Create an entity

[](#create-an-entity)

You can create a supported entity with the `create` function in the resource. It accepts the resource's corresponding `Create` operation e.g. `CreateProduct`. The created entity is returned.

```
use Paddle\SDK\Client;
use Paddle\SDK\Entities\Shared\TaxCategory;
use Paddle\SDK\Resources\Products\Operations\CreateProduct;

$paddle = new Client('API_KEY');

$product = $paddle->products->create(
    new CreateProduct(
        name: 'ChatApp Education',
        taxCategory: TaxCategory::Standard(),
    ),
);
```

### Update an entity

[](#update-an-entity)

You can update a supported entity with the `update` function in the resource. It accepts the `id` of the entity to update and the corresponding `Update` operation e.g. `UpdateProduct`. The updated entity is returned.

```
use Paddle\SDK\Client;
use Paddle\SDK\Resources\Products\Operations\UpdateProduct;

$paddle = new Client('API_KEY');

$operation = new UpdateProduct(
    name: 'ChatApp Professional'
);

$product = $paddle->products->update('id', $operation);
```

Where operations require more than one `id`, the `update` function accepts multiple arguments. For example, to update an address for a customer, pass the `customerId` and the `addressId`:

```
$address = $paddle->addresses->update(
    'customer_id',
    'address_id',
    $operation,
);
```

### Get an entity

[](#get-an-entity)

You can get an entity with the `get` function in the resource. It accepts the `id` of the entity to get. The entity is returned.

```
use Paddle\SDK\Client;

$paddle = new Client('API_KEY');

$product = $paddle->products->get('id');
```

### Error Handling

[](#error-handling)

If a request fails, Paddle throws an `ApiError` exception that contains the same information as [errors returned by the API](https://developer.paddle.com/api-reference/about/errors?utm_source=dx&utm_medium=paddle-php-sdk). You can use the `errorCode` attribute to search an error in [the error reference](https://developer.paddle.com/errors/overview?utm_source=dx&utm_medium=paddle-php-sdk) and to handle the error in your app. Validation errors also return an array of `errors` that tell you which fields failed validation. The `retryAfter` property will be set for `too_many_requests` errors.

This example shows how to handle an error with the code `conflict`:

```
use Paddle\SDK\Exceptions\ApiError;

try {
    // Call functions from the SDK
} catch (ApiError $e) {
    // $e->errorCode will always follow the error code defined in our documentation
    if ($e->errorCode === 'conflict') {
        // Handle Conflict error
    }
}
```

Resources
---------

[](#resources)

### Webhook signature verification

[](#webhook-signature-verification)

The SDK includes a helper class to verify webhook signatures sent by Notifications from Paddle.

```
use Paddle\SDK\Notifications\Secret;
use Paddle\SDK\Notifications\Verifier;

(new Verifier())->verify(
    $request,
    new Secret('WEBHOOK_SECRET_KEY')
);
```

Learn more
----------

[](#learn-more)

- [Paddle API reference](https://developer.paddle.com/api-reference/overview?utm_source=dx&utm_medium=paddle-php-sdk)
- [Sign up for Paddle Billing](https://login.paddle.com/signup?utm_source=dx&utm_medium=paddle-php-sdk)

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity49

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~42 days

Total

33

Last Release

40d ago

Major Versions

0.3.0 → v1.0.02024-02-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/7043ccbfe9de8c76b2e70256dedb21c68508cd5440098feaa9bef4a6bfe5e442?d=identicon)[Paddle](/maintainers/Paddle)

---

Top Contributors

[![davidgrayston-paddle](https://avatars.githubusercontent.com/u/169155061?v=4)](https://github.com/davidgrayston-paddle "davidgrayston-paddle (57 commits)")[![mikeymike](https://avatars.githubusercontent.com/u/2174476?v=4)](https://github.com/mikeymike "mikeymike (27 commits)")[![vifer](https://avatars.githubusercontent.com/u/17689985?v=4)](https://github.com/vifer "vifer (25 commits)")[![Invincibear](https://avatars.githubusercontent.com/u/6895337?v=4)](https://github.com/Invincibear "Invincibear (5 commits)")[![N-M](https://avatars.githubusercontent.com/u/781417?v=4)](https://github.com/N-M "N-M (2 commits)")[![dutypro](https://avatars.githubusercontent.com/u/38077637?v=4)](https://github.com/dutypro "dutypro (2 commits)")[![Hakadel](https://avatars.githubusercontent.com/u/1576847?v=4)](https://github.com/Hakadel "Hakadel (1 commits)")[![heymcgovern](https://avatars.githubusercontent.com/u/25659933?v=4)](https://github.com/heymcgovern "heymcgovern (1 commits)")[![stepsecurity-app[bot]](https://avatars.githubusercontent.com/in/1053343?v=4)](https://github.com/stepsecurity-app[bot] "stepsecurity-app[bot] (1 commits)")[![tpetry](https://avatars.githubusercontent.com/u/315686?v=4)](https://github.com/tpetry "tpetry (1 commits)")[![alecsammon](https://avatars.githubusercontent.com/u/304636?v=4)](https://github.com/alecsammon "alecsammon (1 commits)")

---

Tags

apipaddlephpsdkphpsdkpaddle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/paddlehq-paddle-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/paddlehq-paddle-php-sdk/health.svg)](https://phpackages.com/packages/paddlehq-paddle-php-sdk)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28146.3k](/packages/phpro-http-tools)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M710](/packages/sylius-sylius)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1237.8M117](/packages/web-auth-webauthn-lib)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
