- Available Features: This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers:
- Orders Controller: Orders API v2
- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2
- Vault Controller: Payment Method Tokens API v3 Available in the US only.
Run the following command from your project directory to install the package from npm:
npm install @paypal/[email protected]
For additional package details, see the Npm page for the @paypal/[email protected] npm.
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
Parameter | Type | Description |
---|---|---|
environment | Environment |
The API environment. Default: Environment.Sandbox |
timeout | number |
Timeout for API calls. Default: 0 |
httpClientOptions | Partial<HttpClientOptions> |
Stable configurable http client options. |
unstableHttpClientOptions | any |
Unstable configurable http client options. |
logging | PartialLoggingOptions |
Logging Configuration to enable logging |
clientCredentialsAuthCredentials | ClientCredentialsAuthCredentials |
The credential object for clientCredentialsAuth |
The API client can be initialized as follows:
const client = new Client({
clientCredentialsAuthCredentials: {
oAuthClientId: 'OAuthClientId',
oAuthClientSecret: 'OAuthClientSecret'
},
timeout: 0,
environment: Environment.Sandbox,
logging: {
logLevel: LogLevel.Info,
logRequest: {
logBody: true
},
logResponse: {
logHeaders: true
}
},
});
The SDK can be configured to use a different environment for making API calls. Available environments are:
Name | Description |
---|---|
Production | PayPal Live Environment |
Sandbox | Default PayPal Sandbox Environment |
This API uses the following authentication schemes.