Important: You need a PayPal Business account to:
- Go live with integrations.
- Test integrations outside of the US.
1. Get your client ID and client secret
PayPal integrations use a client ID and client secret to authenticate API calls:- A client ID identifies an app. You need a client ID to get a PayPal payment button and standard credit and debit card fields.
- A client secret authenticates a client ID. To call PayPal APIs, you exchange your client ID and client secret for an access token. Keep your client secret safe.
- Select Log in to Dashboard and log in to your account or sign up for a new account.
- Select Apps & Credentials.
- New accounts come with a default application in the REST API apps section. To create a new project, select Create App.
- Copy the client ID and client secret for your app.
2. Get an access token
You exchange your client ID and client secret for an access token, which you use for authentication when calling PayPal REST APIs. You can call the PayPal OAuth API in any language. The following examples show you how to get your access token using cURL or Postman.- cURL
- Postman
Sample response
PayPal returns an access token and the number of seconds for which the access token is valid, as shown in the following example.Make API calls
When you make API calls, replaceACCESS-TOKEN
with your access token in the authorization header: -H Authorization: Bearer ACCESS-TOKEN
. When your access token expires, call /v1/oauth2/token
again to request a new access token.
3. Get sandbox account credentials
The PayPal sandbox is a test environment that mirrors real-world transactions. By default, PayPal developer accounts have 2 sandbox accounts: a personal account for buying and a business account for selling. You’ll get the login information for both accounts. Watch sandbox money move between accounts to test API calls. Take the following steps to get sandbox login information for business and personal accounts:- Log into the Developer Dashboard.
- Select Testing Tools > Sandbox Accounts. To create more sandbox accounts, you can select Create account.
- Locate the account for which you want to get credentials, and select
⋮
. - To see mock information, such as the account email address and a system-generated password, select View/Edit Account.
- Go to
sandbox.paypal.com/signin/
, and sign in with the personal sandbox credentials. In a separate browser, sign in with the business sandbox credentials. - Make API calls with your app’s access token to see sandbox money move between the personal and business accounts.