> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# PHP SDK

Install, authenticate, and make your first request with the official Paddle PHP SDK.

---

The Paddle PHP SDK integrates Paddle Billing with PHP applications. It exposes typed operation classes for creates and updates, iterator-based pagination, and a webhook signature verifier.

{% version-badge sdk="paddle-php" /%}

{% card-group cols=3 %}
{% card title="GitHub" icon="carbon:logo-github" url="https://github.com/PaddleHQ/paddle-php-sdk" %}
View source code and report issues on GitHub.
{% /card %}
{% card title="Packagist package" icon="composer" url="https://packagist.org/packages/paddlehq/paddle-php-sdk" %}
View and install on Packagist.
{% /card %}
{% card title="Changelog" icon="carbon:bullhorn" url="https://github.com/PaddleHQ/paddle-php-sdk/blob/main/CHANGELOG.md" %}
See recent releases and changes.
{% /card %}
{% /card-group %}

## Requirements

PHP 8.1 or later.

## Install

Install using [Composer](https://getcomposer.org/):

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

Then load Composer's autoloader in your application:

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

## Authenticate

Create an API key in **Paddle > Developer tools > Authentication**, then pass it when you construct the client.

API keys are environment-specific. Use a sandbox key for sandbox, a live key for production.

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

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

Omit the `options` argument, or use `Environment::PRODUCTION`, to use the live API.

## Make your first request

List the products in your catalog:

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

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

foreach ($paddle->products->list() as $product) {
    echo $product->id . ' ' . $product->name . PHP_EOL;
}
```

`$paddle->products->list()` returns an iterator. `foreach` walks every page automatically. The SDK fetches the next page when the current one is exhausted.

## Next steps

- Understand [shared patterns](https://developer.paddle.com/sdks/libraries.md) for pagination, idempotency, retries, and error handling across SDKs.
- Browse the [API reference](https://developer.paddle.com/api-reference/overview.md) for every resource and operation the SDK exposes.
- Work against [sandbox](https://developer.paddle.com/sdks/sandbox.md) while you build, then follow the [go-live checklist](https://developer.paddle.com/build/onboarding/go-live-checklist.md) to switch environments.