Skip to main content

Payouts SDK and APIs reference

You can add PayPal Payouts to your application in two ways:

Payouts SDK

Payouts SDK lets you add PayPal Payouts to your server app with less code. It handles authentication, API calls, and errors for you. The SDK is available for PHP, Java, .NET, and Python.

With the SDK, you can:

  • Call Payouts APIs
  • Manage authentication
  • Handle API responses

Note: The SDK is for server-side use only.

To get started:

  1. Install the SDK for your language
  2. Configure your PayPal credentials
  3. Send and manage payouts

Install the SDK

Install the Payouts SDK for your language:

composer require paypal/paypal-payouts-sdk ~1.0.0

Configure your PayPal credentials

Set up your PayPal client ID and secret for authentication:

use PayPal\Core\PayPalHttpClient;
use PayPal\Core\SandboxEnvironment;

class PayPalClient {
public static function client() {
return new PayPalHttpClient(self::environment());
}
public static function environment() {
$clientId = getenv("CLIENT_ID") ?: "PAYPAL-CLIENT-ID";
$clientSecret = getenv("CLIENT_SECRET") ?: "PAYPAL-CLIENT-SECRET";
return new SandboxEnvironment($clientId, $clientSecret);
}
}

Note: Use SandboxEnvironment for testing and LiveEnvironment for production. Learn how to get your REST API credentials for sandbox and live environments in the Developer Dashboard.

Send and manage payouts

Send a payout

Use the SDK to create a payout batch:

use PayPal\Payouts\PayoutsPostRequest;

$request = new PayoutsPostRequest();
$request->body = [
"sender_batch_header" => [
"sender_batch_id" => "batch_001",
"email_subject" => "You have a payout!"
],
"items" => [
[
"recipient_type" => "EMAIL",
"amount" => [
"value" => "10.00",
"currency" => "USD"
],
"receiver" => "[email protected]",
"note" => "Thanks for your service!",
"sender_item_id" => "item_001"
]
]
];

$response = $client->execute($request);

Check payout status

To check the status of a payout, use the payout batch ID:

use PayPal\Payouts\PayoutsGetRequest;

$request = new PayoutsGetRequest("batch_001");

$response = $client->execute($request);
$status = $response->result->batch_header->batch_status;
echo $status;

Use Payouts APIs

You can also use the Payouts APIs directly. This method gives you control over HTTP requests, authentication, and error handling. Use this approach if you need advanced or custom integration.

The following APIs are available for Payouts integration:

For more information and detailed steps, see [Use Payouts APIs]/docs/send-payouts/send-money/use-payouts-apis).

See also