# Get Started (/limited-release/commerce-platform/v2/get-started)



Get started integrating the PayPal Commerce Platform by getting your API credentials and sandbox account information.

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

Your API credentials are a client ID and secret, which authenticate API requests from your account. While you're developing code, use these credentials when you test API calls in our sandbox (test) environment. You get these credentials from a REST API app in the Developer Dashboard.

To get these credentials:

1. with your PayPal account.
2. Under the **DASHBOARD** menu, select **My Apps & Credentials**.
3. Make sure you're on the Sandbox tab to get the API credentials you'll use while you're developing code. After you test and before you go live, switch to the Live tab to get live credentials.

> **Note:** **Note:** Live credentials are only available to approved marketplaces and platforms. If you are interested in becoming an approved marketplace or platform, fill out the [PayPal Marketplaces and Platforms form](https://www.paypal.com/us/webapps/mpp/partner-program/contact-us). Without this approval, calling the PayPal Commerce Platform for Marketplaces and Platforms APIs with your live credentials results in the HTTP status code of `401 Unauthorized`. Calling the PayPal Commerce Platform for Marketplaces and Platforms APIs with your sandbox credentials does not require approval.

1. Select **Create App**.
2. Under App Type select &#x2A;*Platform - Move payments to sellers as a platform (marketplace, crowdfunding, or e-commerce platform)**.
3. Select **Create App**.

### Step result [#step-result]

The page displays your API credentials, including your client ID and secret.

### 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 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.

> **Note:** **Note:** Platform App Type is only available in the United States, United Kingdom, Spain, Italy, France, Canada, and Australia. For other countries, first [create a REST app](/api/rest/). Then, [contact PayPal for approval](https://www.paypal.com/us/business/platforms-and-marketplaces) to access sandbox and go live.

#### cURL [#curl]

Copy the following code and modify it.

<div className="pl-[1.625rem]" />

```bash lineNumbers
curl -v POST https://api-m.sandbox.paypal.com/v1/oauth2/token \
  -H "Accept: application/json" \
  -H "Accept-Language: en_US" \
  -u "CLIENT_ID:SECRET" \
  -d "grant_type=client_credentials"
```

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

#### Postman [#postman]

In the Postman app, complete the following:

1. Set the verb to **POST**.
2. Enter `https://api-m.sandbox.paypal.com/v1/oauth2/token` as the request URL.
3. Select the **Authorization** tab.
4. From the **TYPE** list, select **Basic Auth**.
5. In the **Username** field, enter your client ID.
6. In the **Password** field, enter your secret.
7. Select the **Body** tab.
8. Select the **x-www-form-urlencoded** option.
9. In the KEY field, enter `grant_type`.
10. In the VALUE field, enter `client_credentials`.
11. Select **Send**.

#### Step result [#step-result-1]

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]

<div className="pl-[1.625rem]" />

```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"
}
```

## Get sandbox account information [#get-sandbox-account-information]

Use your sandbox accounts to test purchases without affecting real money. For example, when you initiate a purchase through a sandbox account, PayPal creates a test purchase that simulates a purchase in the live environment.

To test purchases, you need login information for your personal and business sandbox accounts. To get that account information:

1. with your PayPal account.
2. In the Developer Dashboard, under **SANDBOX**, select **Accounts**.
3. Under **Account Name**, find your personal sandbox account.
4. Under **Manage Accounts*&#x2A;, select the &#x2A;*(...)** button for your personal account.
5. Select **View/Edit Account** to display your email ID and a system-generated password.
6. Repeat these steps for the **business** account.

Once you have your sandbox login information, use your sandbox to test the result of API calls while you're developing. With your login, you can:

* [Log into the sandbox](https://sandbox.paypal.com) with your personal sandbox login information to simulate a buyer making a payment.
* [Log into the sandbox](https://sandbox.paypal.com) with your business sandbox login information to simulate the merchant receiving the payment.

## Code and credential reference [#code-and-credential-reference]

Here are the codes and credentials you use when integrating and testing your integration:

| Item                  | Description                                                                                                                                                                                                                                                                                                                    | How to find                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Client ID (sandbox)` | Used to generate the access token required to make PayPal API calls in sandbox.                                                                                                                                                                                                                                                | with your PayPal account.<br />Under the **DASHBOARD** menu, select **My Apps & Credentials**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Client ID (live)`    | Used to generate the access token required to make PayPal API calls in production.                                                                                                                                                                                                                                             | with your PayPal account.<br />Under the **DASHBOARD** menu, select **My Apps & Credentials**.<br />Select the **Live** tab.                  > **Note:** &#x2A;*Note:** Live credentials are only available to approved marketplaces and platforms. If you are interested in becoming an approved marketplace or platform, fill out the [PayPal Marketplaces and Platforms form](https://www.paypal.com/us/webapps/mpp/partner-program/contact-us). Without this approval, calling the PayPal Commerce Platform for Marketplaces and Platforms APIs with your live credentials results in the HTTP status code of `401 Unauthorized`. Calling the PayPal Commerce Platform for Marketplaces and Platforms APIs with your sandbox credentials does not require approval.<br /> |
| `BN Code`             | Used in your API requests to identify the caller as a PayPal partner. Required for PayPal reporting. See [PayPal-Partner-Attribution-Id](/api/rest/requests/#paypal-partner-attribution-id) for more information.                                                                                                              | with your PayPal account.<br />Under the **DASHBOARD** menu, select **My Apps & Credentials**.<br />Select your app.<br />Under **APP SETTINGS**, view BN code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `partner-merchant-id` | The partner merchant id or payer ID is a unique identifier assigned to every PayPal account. This value does not change over the life of the PayPal account. You need a PayPal account for yourself (which has one payer ID), and each of your sellers need their own PayPal accounts (which have their own unique payer IDs). | with your PayPal account.<br />In the Developer Dashboard, under **SANDBOX**, select **Accounts**.<br />Under **Account Name**, find your sandbox account.<br />Under **Manage Accounts*&#x2A;, select the &#x2A;*(...)** button for your account.<br />Select **View/Edit Account** to display your account ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `seller-merchant-id`  | The seller's payer ID associated with their merchant PayPal account. You find this value the same way you find the `partner-merchant-id`.                                                                                                                                                                                      | with your PayPal account.<br />In the Developer Dashboard, under **SANDBOX**, select **Accounts**.<br />Under **Account Name**, find your sandbox account.<br />Under **Manage Accounts*&#x2A;, select the &#x2A;*(...)** button for your account.<br />Select **View/Edit Account** to display your account ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

## Next steps [#next-steps]

You can now use your API credentials and sandbox account information to start your integration.

> **Note:** **Note:** For partners, please fill out [this form](https://www.paypal.com/us/webapps/mpp/partner-program/contact-us) to gain access to live API credentials and a representative will be in touch shortly to assist you.

## See also [#see-also]

* [REST API URLs](/api/rest/requests/)  —           Learn more about the sandbox and production URLs of our REST API
* [PayPal sandbox](/sandbox-testing/overview)  —           Learn more about using the PayPal sandbox to test API calls and money movement while you're developing.
