PHPackages                             paypal/paypal-payouts-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. [HTTP &amp; Networking](/categories/http)
4. /
5. paypal/paypal-payouts-sdk

Abandoned → [paypal/paypal-server-sdk](/?search=paypal%2Fpaypal-server-sdk)Library[HTTP &amp; Networking](/categories/http)

paypal/paypal-payouts-sdk
=========================

PayPal's PHP SDK for Payouts REST APIs

1.0.1(4y ago)521.2M↓46.1%34[7 issues](https://github.com/paypal/Payouts-PHP-SDK/issues)[3 PRs](https://github.com/paypal/Payouts-PHP-SDK/pulls)1MITPHPCI failing

Since Feb 7Pushed 1y ago16 watchersCompare

[ Source](https://github.com/paypal/Payouts-PHP-SDK)[ Packagist](https://packagist.org/packages/paypal/paypal-payouts-sdk)[ Docs](http://github.com/paypal/PAYOUTS-PHP-SDK/)[ RSS](/packages/paypal-paypal-payouts-sdk/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (1)

PayPal Payouts PHP SDK v2
=========================

[](#paypal-payouts-php-sdk-v2)

[![Home Image](homepage.jpg)](homepage.jpg)

**Welcome to PayPal Payouts**. This repository contains PayPal's PHP SDK for Payouts and samples for [v1/payments/payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/) APIs.

This is a part of the next major PayPal SDK. It includes a simplified interface to only provide simple model objects and blueprints for HTTP calls. This repo currently contains functionality for PayPal Payouts APIs which includes [Payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/).

Please refer to the [PayPal Payouts Integration Guide](https://developer.paypal.com/docs/payouts/) for more information. Also refer to [Setup your SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk) for additional information about setting up the SDK's.

Prerequisites
-------------

[](#prerequisites)

PHP 5.6 and above

An environment which supports TLS 1.2 (see the TLS-update site for more information)

Usage
-----

[](#usage)

### Binaries

[](#binaries)

It is not necessary to fork this repository for using the PayPal SDK. Please take a look at [PayPal Payouts Server SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk/#install-the-sdk) for configuring and working with SDK without forking this code.

For contributing to this repository or using the samples you can fork this repository.

### Setting up credentials

[](#setting-up-credentials)

Get client ID and client secret by going to  and generating a REST API app. Get **Client ID** and **Secret** from there.

```
require __DIR__ . '/vendor/autoload.php';
use PaypalPayoutsSDK\Core\PayPalHttpClient;
use PaypalPayoutsSDK\Core\SandboxEnvironment;
// Creating an environment
$clientId = "";
$clientSecret = "";

$environment = new SandboxEnvironment($clientId, $clientSecret);
$client = new PayPalHttpClient($environment);
```

Examples
--------

[](#examples)

### Creating a Payout

[](#creating-a-payout)

This will create a Payout and print batch id for the created Payouts

```
use PaypalPayoutsSDK\Payouts\PayoutsPostRequest;
$request = new PayoutsPostRequest();
$body= json_decode(
            '{
                "sender_batch_header":
                {
                  "email_subject": "SDK payouts test txn"
                },
                "items": [
                {
                  "recipient_type": "EMAIL",
                  "receiver": "payouts2342@paypal.com",
                  "note": "Your 1$ payout",
                  "sender_item_id": "Test_txn_12",
                  "amount":
                  {
                    "currency": "USD",
                    "value": "1.00"
                  }
                }]
              }',
            true);
$request->body = $body;
$client = PayPalClient::client();
$response = $client->execute($request);
print "Status Code: {$response->statusCode}\n";
print "Status: {$response->result->batch_header->batch_status}\n";
print "Batch ID: {$response->result->batch_header->payout_batch_id}\n";
print "Links:\n";
foreach($response->result->links as $link)
 {
   print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n";
 }
echo json_encode($response->result, JSON_PRETTY_PRINT), "\n";

```

### Retrieve a Payouts Batch

[](#retrieve-a-payouts-batch)

This will retrieve a payouts batch

```
 $request = new PayoutsGetRequest($batchId);
 $response = $client->execute($request);
 echo json_encode($response->result, JSON_PRETTY_PRINT), "\n";
```

### Parsing Failure Response

[](#parsing-failure-response)

This will execute a Get request to simulate a failure

```
 try{
    $request = new PayoutsGetRequest(null);
    $response = $client->execute($request);
    echo json_encode($response->result, JSON_PRETTY_PRINT), "\n";
  } catch(HttpException $e){
    echo $e->getMessage()
    var_dump(json_decode($e->getMessage()));

  }
```

Running tests
-------------

[](#running-tests)

To run integration tests using your client id and secret, clone this repository and run the following command:

```
$ composer install
$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer unit
```

You may use the client id and secret above for demonstration purposes.

Samples
-------

[](#samples)

You can start off by trying out [Samples](/samples).

Note: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable while executing the samples.

License
-------

[](#license)

Code released under [SDK LICENSE](LICENSE)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance24

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~599 days

Total

2

Last Release

1741d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dcc8e719eed09b6c6b9c4763a8410175af723aa2049a3e65d8015e200649b571?d=identicon)[paypal](/maintainers/paypal)

---

Top Contributors

[![srswaminathan-hw-dev](https://avatars.githubusercontent.com/u/81268996?v=4)](https://github.com/srswaminathan-hw-dev "srswaminathan-hw-dev (1 commits)")

---

Tags

sdkrestpaypalpayouts

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paypal-paypal-payouts-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/paypal-paypal-payouts-sdk/health.svg)](https://phpackages.com/packages/paypal-paypal-payouts-sdk)
```

PHPackages © 2026

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