{"id":20581843,"url":"https://github.com/paddlehq/paddle-php-sdk","last_synced_at":"2025-04-07T15:05:42.306Z","repository":{"id":216642524,"uuid":"741863688","full_name":"PaddleHQ/paddle-php-sdk","owner":"PaddleHQ","description":"PHP SDK for working with the Paddle API in server-side apps.","archived":false,"fork":false,"pushed_at":"2024-10-21T11:08:39.000Z","size":569,"stargazers_count":28,"open_issues_count":4,"forks_count":5,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-10-21T16:13:01.599Z","etag":null,"topics":["api","paddle","php","sdk"],"latest_commit_sha":null,"homepage":"https://developer.paddle.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaddleHQ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-11T09:15:28.000Z","updated_at":"2024-10-21T11:08:42.000Z","dependencies_parsed_at":"2024-03-20T13:43:55.143Z","dependency_job_id":"441dcc21-726e-40ce-a9a7-1af6d185cb62","html_url":"https://github.com/PaddleHQ/paddle-php-sdk","commit_stats":null,"previous_names":["paddlehq/paddle-php-sdk"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaddleHQ","download_url":"https://codeload.github.com/PaddleHQ/paddle-php-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675597,"owners_count":20977376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","paddle","php","sdk"],"created_at":"2024-11-16T06:31:36.427Z","updated_at":"2025-04-07T15:05:42.286Z","avatar_url":"https://github.com/PaddleHQ.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Paddle PHP SDK\n\n[![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)\n[![Latest Stable Version](https://poser.pugx.org/paddlehq/paddle-php-sdk/v)](https://packagist.org/packages/paddlehq/paddle-php-sdk)\n[![Total Downloads](https://poser.pugx.org/paddlehq/paddle-php-sdk/downloads)](https://packagist.org/packages/paddlehq/paddle-php-sdk)\n[![License](https://poser.pugx.org/paddlehq/paddle-php-sdk/license)](https://packagist.org/packages/paddlehq/paddle-php-sdk)\n\n[Paddle Billing](https://www.paddle.com/billing?utm_source=dx\u0026utm_medium=paddle-php-sdk) is a complete digital product sales and subscription management platform, designed for modern software businesses. It helps you increase your revenue, retain customers, and scale your operations.\n\nThis is a [PHP](https://www.php.net/) SDK that you can use to integrate Paddle Billing with applications written in PHP.\n\nFor working with Paddle in your frontend, use [Paddle.js](https://developer.paddle.com/paddlejs/overview?utm_source=dx\u0026utm_medium=paddle-php-sdk). You can open checkouts, securely collect payment information, build pricing pages, and integrate with Paddle Retain.\n\n\u003e **Important:** This package works with Paddle Billing. It does not support Paddle Classic. To work with Paddle Classic, see: [Paddle Classic API reference](https://developer.paddle.com/classic/api-reference/1384a288aca7a-api-reference?utm_source=dx\u0026utm_medium=paddle-php-sdk)\n\n## Requirements\n\nPHP 8.1 and later.\n\n## Composer\n\nYou can install the bindings via [Composer](http://getcomposer.org/). Run the following command:\n\n```bash\ncomposer require paddlehq/paddle-php-sdk\n```\n\nTo use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):\n\n```php\nrequire_once 'vendor/autoload.php';\n```\n\n## Usage\n\nTo authenticate, you'll need an API key. You can create and manage API keys in **Paddle \u003e Developer tools \u003e Authentication**.\n\nPass your API key while initializing a new Paddle client.\n\n``` php\nuse Paddle\\SDK\\Client;\n\n$paddle = new Client('API_KEY');\n```\n\nYou can also pass an environment to work with the sandbox:\n\n``` php\nuse Paddle\\SDK\\Client;\nuse Paddle\\SDK\\Environment;\nuse Paddle\\SDK\\Options;\n\n$paddle = new Client(\n    apiKey: 'API_KEY',\n    options: new Options(Environment::SANDBOX),\n);\n```\n\nKeep in mind that API keys are separate for your sandbox and live accounts, so you'll need to generate keys for each environment.\n\n## Examples\n\n### List entities\n\nYou can list supported entities with the `list` function in the resource. It returns an iterator to help when working with multiple pages.\n\n``` php\nuse Paddle\\SDK\\Client;\n\n$paddle = new Client('API_KEY');\n\n$products = $paddle-\u003eproducts-\u003elist();\n\n// List returns an iterable, so pagination is handled automatically.\nforeach ($products as $product) {\n    echo $product-\u003eid;\n}\n```\n\n### Create an entity\n\nYou 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.\n\n``` php\nuse Paddle\\SDK\\Client;\nuse Paddle\\SDK\\Entities\\Shared\\TaxCategory;\nuse Paddle\\SDK\\Resources\\Products\\Operations\\CreateProduct;\n\n$paddle = new Client('API_KEY');\n\n$product = $paddle-\u003eproducts-\u003ecreate(\n    new CreateProduct(\n        name: 'ChatApp Education',\n        taxCategory: TaxCategory::Standard(),\n    ),\n);\n```\n\n### Update an entity\n\nYou 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.\n\n``` php\nuse Paddle\\SDK\\Client;\nuse Paddle\\SDK\\Resources\\Products\\Operations\\UpdateProduct;\n\n$paddle = new Client('API_KEY');\n\n$operation = new UpdateProduct(\n    name: 'ChatApp Professional'\n);\n\n$product = $paddle-\u003eproducts-\u003eupdate('id', $operation);\n```\n\nWhere 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`:\n\n``` php\n$address = $paddle-\u003eaddresses-\u003eupdate(\n    'customer_id',\n    'address_id',\n    $operation,\n);\n```\n\n### Get an entity\n\nYou can get an entity with the `get` function in the resource. It accepts the `id` of the entity to get. The entity is returned.\n\n``` php\nuse Paddle\\SDK\\Client;\n\n$paddle = new Client('API_KEY');\n\n$product = $paddle-\u003eproducts-\u003eget('id');\n```\n\n## Resources\n\n### Webhook signature verification\n\nThe SDK includes a helper class to verify webhook signatures sent by Notifications from Paddle.\n\n``` php\nuse Paddle\\SDK\\Notifications\\Secret;\nuse Paddle\\SDK\\Notifications\\Verifier;\n\n(new Verifier())-\u003everify(\n    $request,\n    new Secret('WEBHOOK_SECRET_KEY')\n);\n```\n\n## Learn more\n\n- [Paddle API reference](https://developer.paddle.com/api-reference/overview?utm_source=dx\u0026utm_medium=paddle-php-sdk)\n- [Sign up for Paddle Billing](https://login.paddle.com/signup?utm_source=dx\u0026utm_medium=paddle-php-sdk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaddlehq%2Fpaddle-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaddlehq%2Fpaddle-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaddlehq%2Fpaddle-php-sdk/lists"}