# Configure your sandbox and live accounts (/platforms/create-account)



Use a sandbox account to test purchases before going live in your live account. For example, when you initiate a purchase through a sandbox account, PayPal creates a test purchase that simulates a purchase in the live environment.

> **Info:** **Note:** [Fill out this form](/platforms/get-started) to be an approved partner. You need to be an approved partner to go live. Calls to the PayPal Complete Payments Platform APIs without approval will return a 401 Unauthorized HTTP status code. You can call and test the PayPal Complete Payments Platform APIs with your sandbox credentials before you are approved.

## Create your sandbox API caller account [#create-your-sandbox-api-caller-account]

Log in to your [developer dashboard](/dashboard/) to create your platform REST app. A sandbox account is generated after you create your app. You can use an existing PayPal account or create a new PayPal account specifically for this PayPal Complete Payments Platform integration. Use your personal sandbox account to simulate a buyer making a payment and use your business sandbox account to simulate a seller receiving payment.

## Create a platform REST app in your sandbox account [#create-a-platform-rest-app-in-your-sandbox-account]

1. From your developer dashboard, select **Apps & Credentials**.
2. Select **Create App**.
3. Under **Type**, select **Platform**. A sandbox account named Platform Partner App is automatically created with the recommended platform settings.

   > **Note:** **Note**: For Embedded integration, select **Merchant**. This allows you to choose your API caller account during setup.

After the app is created, you can select which features you'd like to have enabled for testing under Sandbox App Settings. Some settings are automatically selected, but you can turn on other options for your use case.

## Get your sandbox API credentials [#get-your-sandbox-api-credentials]

1. From your developer dashboard, select **Testing Tools** > **Sandbox Accounts**.
2. Under **Account Name**, find the personal or business sandbox account you want to test with.
3. Select the &#x2A;*(…)** button on the side > **View/Edit Account** > **API Credentials**.
4. Under **REST API apps**, select the name of the app you are using.
5. The client ID and client secret is at the top.

> **Note:** **Note**: After retrieving your sandbox Client ID, share it with your PayPal
> account manager to configure your sandbox environment and enable testing.

## Log in to your sandbox account [#log-in-to-your-sandbox-account]

Log in to your sandbox to test the result of API calls. To get an email ID and password for a sandbox account:

1. From your developer dashboard, select **Testing Tools** > **Sandbox Accounts**.
2. Under **Account Name**, find the personal or business sandbox account you want to test with.
3. Select the &#x2A;*(…)** button on the side > **View/Edit Account**. Make note of your email ID and a system-generated password.
4. [Log in to your sandbox](https://www.sandbox.paypal.com/signin) with this email ID and password.

## Create your live API caller account [#create-your-live-api-caller-account]

Use the live account when you are done testing on sandbox and want to go live with your integration. You must be an approved partner to go live. [Fill out this form](/platforms/get-started) to be an approved partner and a PayPal representative will contact you for your approval. When you are ready to go live, you'll need to reach out to your representative and configure the live account together.

## Know before you set up your live account [#know-before-you-set-up-your-live-account]

* You'll need a PayPal business account. If you have a personal account, contact a PayPal representative to upgrade your account to a business account when you go live.
* How the money is settled will change when the live account is configured. The live account will no longer contain a PayPal balance. We recommend using a new account that is not being used for any other transactions.
* If you want to take a platform fee from your sellers, link and confirm your bank account to your PayPal account in the [**Money, banks, and cards**](https://www.paypal.com/businessmanage/account/money) page.
* If you use the platform fee feature, your live account can only be used to transact the fee to your linked bank account from sellers. The balance of your partner account should remain empty. If you plan to transact with this account as a seller or collect payments directly from buyers, make another account to avoid having the payment automatically transferred to your linked bank account.

## Create a live account [#create-a-live-account]

1. If not done already, get a PayPal business account. For more information about business accounts, see [**Open a business account online**](https://www.paypal.com/us/business/open-business-account).
2. When you have created your account, go to your inbox and look for our email to confirm your email address.

> **Note:** **Note**: After retrieving your live Client ID (from **Apps & Credentials**), share it with your PayPal account manager to configure your production environment and enable live transactions.

## Exchange your API credentials for an access token [#exchange-your-api-credentials-for-an-access-token]

Your access token authorizes you to use the PayPal REST API server. To call a REST API in your integration, exchange your client ID and client secret for an access token. You can make the API call in any programming language.

The following sections explain how to get your access token using cURL or Postman.

> **Info:** **Note:** If you're using the platform fee feature, you'll need to pass the permissions scope as part of the Partner Referral API when your sellers onboard to avoid your sellers having to onboard again. Our team will also need to configure this feature on your account.

## cURL [#curl]

Copy the following code and modify it:

1. Change `CLIENT_ID` to your client ID.
2. Change `CLIENT_SECRET` to your client secret.

```bash lineNumbers
curl -v POST https://api-m.sandbox.paypal.com/v1/oauth2/token  -u "CLIENT_ID:CLIENT_SECRET"  -H "Content-Type: application/x-www-form-urlencoded"  -d "grant_type=client_credentials"
```

To import the cURL command above to Postman:

1. Open Postman and go to **Import** > **Raw text**.
2. Paste the cURL command into the text field.
   * Change `CLIENT_ID` to your client ID.
   * Change `CLIENT_SECRET` to your client secret.
3. Select **Continue** > **Import** > **Send**.

## Step result [#step-result]

PayPal returns an access token and the number of seconds the access token is valid. When you make calls to a REST API, include the access token in the Authorization header with the designation as `Bearer`. Reuse the access token until it expires.

When your token expires, call the `v1/oauth2/token` method again to request a new token.

### Sample response [#sample-response]

```json lineNumbers
{
    "scope": "https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/payments/payment/authcapture openid https://uri.paypal.com/services/disputes/read-seller https://uri.paypal.com/services/payments/refund https://api-m.paypal.com/v1/vault/credit-card https://api-m.paypal.com/v1/payments/.* https://uri.paypal.com/payments/payouts https://api-m.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks",
    "access_token": "A21AAFEpH4PsADK7qSS7pSRsgzfENtu-Q1ysgEDVDESseMHBYXVJYE8ovjj68elIDy8nF26AwPhfXTIeWAZHSLIsQkSYz9ifg",
    "token_type": "Bearer",
    "app_id": "APP-80W284485P519543T",
    "expires_in": 31668,
    "nonce": "2020-04-03T15:35:36ZaYZlGvEkV4yVSz8g6bAKFoGSEzuy3CQcz3ljhibkOHg"
}
```

## Credential reference [#credential-reference]

The following credentials are used in integrating and testing REST APIs. The steps are the same for both sandbox and live. Make sure to toggle to the right environment that you are working in.

## Client ID (sandbox and live) [#client-id-sandbox-and-live]

Used to generate the access token required to make PayPal API calls in sandbox and live.

To find it:

1. From your developer dashboard, select **Apps & Credentials**.
2. Select the app you are using. Your client ID is at the top.

## BN code [#bn-code]

Identifies the caller as a PayPal partner. To receive revenue attribution, specify a unique build notation (BN) code. BN codes provide tracking on all transactions that originate or are associated with a particular partner. Required for PayPal reporting. See [PayPal-Partner-Attribution-Id](/api/rest/requests/#paypal-partner-attribution-id) for more information.

To find it:

1. From your developer dashboard, select **Apps & Credentials**.
2. Select the app you are using.
3. Under **App Settings**, scroll down to **Reports**. Your BN code is on the last line of Reports.

## Partner-merchant-id [#partner-merchant-id]

The partner merchant ID, or payer ID, is the account ID assigned to every PayPal account. The account ID is a unique identifier and doesn't change over the life of the PayPal account. Partners and sellers need their own PayPal accounts, and every account has its own account ID.

To find it:

1. From your developer dashboard, select **Testing Tools** > **Sandbox Accounts**.
2. Under **Account Name**, find your account.
3. Click on the account name and scroll down to **Account Info** to see the account ID.

## Next steps [#next-steps]

Add more payment methods

> **Info:** Accept Payments
>
> Choose your payment method.
