- Use the Payouts SDK if you want a streamlined integration with built-in authentication, error handling, and support for Java or Python.
- Use the Payouts APIs directly if:
- You want more control over the API calls.
- You need to customize your integration.
- You use a language not supported by the SDK.
Use the Payouts SDK
You can use the PayPal Payouts SDK for Java or Python to work with the Payouts REST API. The SDK helps keep your integration up to date with API changes and is intended for server-side use only. With the SDK, you can:- Handle OAuth 2.0 authentication automatically.
- Call Payouts APIs with less code.
- Manage API responses and errors.
Install the SDK
Install the Payouts SDK for your language:Set up your environment and credentials
- Create a new file in your preferred language in the directory where you installed the SDK.
- Copy the following code sample for your language to initialize the SDK and configure your environment.
- Update the code with your PayPal client ID and secret.
- Set the environment to
SandboxEnvironment
for testing orLiveEnvironment
for production.
Note: For more information on finding your REST API credentials for both sandbox and live environments, see Sandbox accounts.
Create a payout batch
Use the following code samples to create a payout batch.Track status
Use the payout batch ID to retrieve the payout batch details.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:- Generate access token:
POST /v1/oauth2/token
- Create payout batch:
POST /v1/payments/payouts
- Track status:
GET /v1/payments/payouts/{id}