### Install the SDK Source: https://developer.paddle.com/get-started/quickstart/python.md Install `paddle-python-sdk` using pip, poetry, or uv. ```sh pip install paddle-python-sdk ``` ```sh poetry add paddle-python-sdk ``` ```sh uv add paddle-python-sdk ``` -------------------------------- ### Install the SDK Source: https://developer.paddle.com/get-started/quickstart/go.md Add the SDK to your Go module. ```sh go get github.com/PaddleHQ/paddle-go-sdk/v5 ``` -------------------------------- ### Install the SDK Source: https://developer.paddle.com/get-started/quickstart/php.md Install the Paddle PHP SDK using Composer. ```sh composer require paddlehq/paddle-php-sdk ``` -------------------------------- ### Install the SDK Source: https://developer.paddle.com/get-started/quickstart/node.md Install the Paddle Node.js SDK using your preferred package manager. ```npm npm install @paddle/paddle-node-sdk ``` ```pnpm pnpm add @paddle/paddle-node-sdk ``` ```yarn yarn add @paddle/paddle-node-sdk ``` ```bun bun add @paddle/paddle-node-sdk ``` -------------------------------- ### Live Source: https://developer.paddle.com/api-reference/about.md Example curl command to make a request to the live environment. ```bash curl https://api.paddle.com/event-types \ -H "Authorization: Bearer pdl_live_apikey_01gtgztp8f4kek3yd4g1wrksa3_q6TGTJyvoIz7LDtXT65bX7_AQO" ``` -------------------------------- ### Sandbox Source: https://developer.paddle.com/api-reference/about.md Example curl command to make a request to the sandbox environment. ```bash curl https://sandbox-api.paddle.com/event-types \ -H "Authorization: Bearer pdl_sdbx_apikey_01gtgztp8f4kek3yd4g1wrksa3_q6TGTJyvoIz7LDtXT65bX7_AQO" ``` -------------------------------- ### Sandbox Source: https://developer.paddle.com/api-reference/about.md Example cURL request to create a customer in the Paddle sandbox environment. ```bash curl -X POST https://sandbox-api.paddle.com/customers \ -H "Authorization: Bearer pdl_sdbx_apikey_01gtgztp8f4kek3yd4g1wrksa3_q6TGTJyvoIz7LDtXT65bX7_AQO" \ -H "Content-Type: application/json" \ -d '{ "name": "Sam Miller", "email": "sam@example.com" }' ``` -------------------------------- ### Verify webhooks Source: https://developer.paddle.com/get-started/quickstart/python.md Use the SDK's Verifier to verify webhook signatures. This example uses Flask. ```python from os import getenv from flask import Flask, request from paddle_billing.Notifications import Secret, Verifier from paddle_billing.Entities.Notifications import NotificationEvent app = Flask(__name__) secret = Secret(getenv("PADDLE_WEBHOOK_SECRET")) @app.route("/webhooks", methods=["POST"]) def webhook(): if not Verifier().verify(request, secret): return "invalid signature", 400 notification = NotificationEvent.from_request(request) if notification.event_type == "transaction.completed": # Provision access, send a receipt, etc. pass elif notification.event_type == "subscription.updated": # Sync the subscription to your database. pass return "ok", 200 ``` -------------------------------- ### Verify webhooks Source: https://developer.paddle.com/get-started/quickstart/php.md Verify webhook signatures using the SDK's Verifier. This example uses Guzzle for PSR-7 RequestInterface. ```php use GuzzleHttp\Psr7\ServerRequest; use Paddle\SDK\Entities\Event; use Paddle\SDK\Notifications\Secret; use Paddle\SDK\Notifications\Verifier; $request = ServerRequest::fromGlobals(); $secret = new Secret(getenv('PADDLE_WEBHOOK_SECRET')); if (!(new Verifier())->verify($request, $secret)) { http_response_code(400); exit('invalid signature'); } $event = Event::fromRequest($request); switch ($event->eventType) { case 'transaction.completed': // Provision access, send a receipt, etc. break; case 'subscription.updated': // Sync the subscription to your database. break; } http_response_code(200); echo 'ok'; ``` -------------------------------- ### PHP SDK Example Source: https://developer.paddle.com/changelog/2024/php-nodejs-sdks.md This example shows initializing a new Paddle client with an API key and iterating through products using the PHP SDK. ```php use Paddle\SDK\Client; use Paddle\SDK\Environment; use Paddle\SDK\Options; $paddle = new Client('API_KEY'); $products = $paddle->products->list(); foreach ($products as $product) { echo $product->id; } ``` -------------------------------- ### Make your first request Source: https://developer.paddle.com/get-started/quickstart/go.md List products to confirm the client is wired up and iterate through the results. ```go package main import ( "context" "fmt" "log" "os" paddle "github.com/PaddleHQ/paddle-go-sdk/v5" ) func main() { client, err := paddle.NewSandbox(os.Getenv("PADDLE_API_KEY")) if err != nil { log.Fatal(err) } ctx := context.Background() products, err := client.ListProducts(ctx, &paddle.ListProductsRequest{ IncludePrices: true, }) if err != nil { log.Fatal(err) } err = products.Iter(ctx, func(p *paddle.Product) (bool, error) { fmt.Printf("%s %s\n", p.ID, p.Name) return true, nil }) if err != nil { log.Fatal(err) } } ``` -------------------------------- ### Response example Source: https://developer.paddle.com/api-reference/metrics/get-metrics-monthly-recurring-revenue-change.md Example of a successful response for the GET /metrics/monthly-recurring-revenue-change endpoint. ```json { "data": { "timeseries": [ { "timestamp": "2025-09-01T00:00:00Z", "amount": "125000" }, { "timestamp": "2025-09-02T00:00:00Z", "amount": "-75000" }, { "timestamp": "2025-09-03T00:00:00Z", "amount": "200000" }, { "timestamp": "2025-09-04T00:00:00Z", "amount": "50000" } ], "starts_at": "2025-09-01T00:00:00Z", "ends_at": "2025-09-05T00:00:00Z", "interval": "day", "currency_code": "USD", "updated_at": "2025-09-04T20:30:00Z" }, "meta": { "request_id": "b93d9c94-c28f-4e5d-af2e-044854d7afe8" } } ``` -------------------------------- ### Response Example Source: https://developer.paddle.com/api-reference/metrics/get-metrics-revenue.md Example of a successful response for the GET /metrics/revenue endpoint. ```json { "data": { "timeseries": [ { "timestamp": "2025-09-01T00:00:00Z", "amount": "1286023068", "count": 100 }, { "timestamp": "2025-09-02T00:00:00Z", "amount": "1345678901", "count": 100 }, { "timestamp": "2025-09-03T00:00:00Z", "amount": "1398765432", "count": 100 }, { "timestamp": "2025-09-04T00:00:00Z", "amount": "1420987654", "count": 100 } ], "starts_at": "2025-09-01T00:00:00Z", "ends_at": "2025-09-05T00:00:00Z", "interval": "day", "currency_code": "USD", "updated_at": "2025-09-04T20:30:00Z" }, "meta": { "request_id": "b93d9c94-c28f-4e5d-af2e-044854d7afe8" } } ``` -------------------------------- ### Node.js SDK Example Source: https://developer.paddle.com/changelog/2024/php-nodejs-sdks.md This example shows initializing a new Paddle client with an API key and iterating through products using the Node.js SDK. ```typescript import { Paddle } from '@paddle/paddle-node-sdk' const paddle = new Paddle('API_KEY') function getProducts() { return paddle.products.list() } try { const productCollection = getProducts() const firstPage = await productCollection.next() } catch (e) { // handle Network/API errors } ``` -------------------------------- ### Response Example Source: https://developer.paddle.com/api-reference/metrics/get-metrics-refunds.md Example JSON response for the GET /metrics/refunds endpoint. ```json { "data": { "timeseries": [ { "timestamp": "2025-09-01T00:00:00Z", "amount": "10000" }, { "timestamp": "2025-09-02T00:00:00Z", "amount": "0" }, { "timestamp": "2025-09-03T00:00:00Z", "amount": "0" }, { "timestamp": "2025-09-04T00:00:00Z", "amount": "0" } ], "starts_at": "2025-09-01T00:00:00Z", "ends_at": "2025-09-05T00:00:00Z", "interval": "day", "currency_code": "USD", "updated_at": "2025-09-04T20:30:00Z" }, "meta": { "request_id": "b93d9c94-c28f-4e5d-af2e-044854d7afe8" } } ``` -------------------------------- ### Success response Source: https://developer.paddle.com/api-reference/about.md Example of a successful response when creating an entity, including 'data' and 'meta' objects. ```json { "data": { "id": "ctm_01hv6y1jedq4p1n0yqn5ba3ky4", "status": "active", "custom_data": null, "name": "Sam Miller", "email": "sam@example.com", "marketing_consent": false, "locale": "en", "created_at": "2026-04-11T15:57:24.813Z", "updated_at": "2026-04-11T15:57:24.813Z", "import_meta": null }, "meta": { "request_id": "9bcdcc29-e180-4055-ad3d-d37e5dc5e56d" } } ``` -------------------------------- ### Response Example Source: https://developer.paddle.com/api-reference/ip-addresses/get-ip-addresses.md Example of a successful response from the GET /ips endpoint. ```json { "data": { "ipv4_cidrs": [ "34.194.127.46/32", "54.234.237.108/32", "3.208.120.145/32" ] }, "meta": { "request_id": "ceca4b2f-db0d-4b00-9228-35e0dec592b4" } } ``` -------------------------------- ### Initialize the client Source: https://developer.paddle.com/get-started/quickstart/go.md Initialize the Paddle Go SDK client for sandbox environment. ```go package main import ( "log" "os" paddle "github.com/PaddleHQ/paddle-go-sdk/v5" ) func main() { client, err := paddle.NewSandbox(os.Getenv("PADDLE_API_KEY")) if err != nil { log.Fatal(err) } _ = client } ``` -------------------------------- ### Response Example Source: https://developer.paddle.com/api-reference/metrics/get-metrics-checkout-conversion.md Example JSON response for the GET /metrics/checkout-conversion endpoint. ```json { "data": { "timeseries": [ { "timestamp": "2025-09-01T00:00:00Z", "count": 151, "completed_count": 5, "rate": "0.033113" }, { "timestamp": "2025-09-02T00:00:00Z", "count": 66, "completed_count": 11, "rate": "0.166667" }, { "timestamp": "2025-09-03T00:00:00Z", "count": 139, "completed_count": 12, "rate": "0.086331" }, { "timestamp": "2025-09-04T00:00:00Z", "count": 210, "completed_count": 28, "rate": "0.133333" } ], "starts_at": "2025-09-01T00:00:00Z", "ends_at": "2025-09-05T00:00:00Z", "interval": "day", "updated_at": "2025-09-04T20:30:00Z" }, "meta": { "request_id": "b93d9c94-c28f-4e5d-af2e-044854d7afe8" } } ``` -------------------------------- ### Initialize the client for production Source: https://developer.paddle.com/get-started/quickstart/go.md Initialize the Paddle Go SDK client for production environment. ```go client, err := paddle.New(os.Getenv("PADDLE_API_KEY")) ```