---
schema_version: "1"
id: f10eee0210838ade9d4317da0893fb7f9da195dc53c3b4e30de636335d6a629c
title: Setting Up OAuth with Point of Sale APIs
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/retail-cloud/guides/setting-up-oauth-with-retail-cloud-apis.md
canonical_url: https://developer.salesforce.com/docs/commerce/retail-cloud/guide/setting-up-oauth-with-retail-cloud-apis.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5744d779f0404ed3fd71f1975a20f9990ade5928a0413ce91a2f63193e21345e
products:
  - Point of Sale for Developers
  - Salesforce APIs
---
# Setting Up OAuth with Point of Sale APIs

Point of Sale supports OAuth for secure authentication with [APIs and SPIs](https://developer.salesforce.com/docs/commerce/retail-cloud/guide/retail-cloud-api-spi-webhook-specs.html). Configure the OAUTH-OAuth SPI by entering the required URL, client secret, and headers. This setup allows the system to obtain an authentication token before making any other SPI calls.

## CMS Configuration and Setup

To configure OAuth authentication for Point of Sale APIs, set up the OAUTH-OAuth SPI connector in CMS and then configure your individual SPIs to use the generated authentication tokens. The process involves two main steps: first establishing the OAuth connection, then applying it to your specific API integrations.

### Configuring OAUTH-OAuth SPI

1. In CMS, go to Integrations > Custom Connectors.
2. Click **Create**.
3. For Connector Type, select **SPI**.
4. For Endpoint Name, select **OAUTH-OAuth**.
5. Update the API Endpoint to add `grant_type=client_credentials`. For example, `https://interdev.my.sf.com/services/oauth2/token?grant_type=client_credentials`.
6. Set the Integration Type to `HTTP_POST`.
7. Specify the authorization key using the JSON Headers.
   1. Retrieve the Client ID and Client Secret from the external API.
   2. Generate a Base64 concatenated Client ID and Client Secret, with a colon (:) and a single space.
   3. Add this string to the JSON Headers.

```json
{
  "Content-Type": "application/x-www-form-urlencoded",
  "Authorization": "Basic M01WRzlGSU5PMW5zeFJ1QVRUODVIOEVzMVZ5eUhWemNFd1BmQ0dkZnNSQlhVQUJlSjJ2YXFDSE00cG9vd2k2c2tZQnZiN2xqLkl0ZnQ0ZTVacXNQbTogQjg1MjFBNEFFMjZBMzJERDQwOTZDMzlCODJCN0UyQjhEQjRBNUIxMjU3MUEwQUYwQjlBREM3Qjg5OTEyQTBEQQ=="
}
```

**note:** - Include a space after the word `Basic` (don't include a colon).
- Generate the basic token by concatenating the Client ID and Client Secret with a colon and space. For example, `client_id: client_secret`.

![mceclip0.png](https://developer.salesforce.com/docs/media/retail-cloud/mceclip0-icon.png)

#### Example SPI Response

```json
{
  "token_type": "Bearer",
  "expires_in": 3600, //Optional field - Number of seconds this key will be present in cache for subsequent SPI calls
  "access_token": "*****" // Token sent as part of the header in other SPI requests.
}
```

### Configuring SPIs with OAuth

1. In CMS, go to **Integrations > Custom Connectors**.
2. Click **Create** in the upper right.
3. For Connector Type, select **SPI**.
4. For Endpoint Name, select an SPI. For example, **SHIPPING_METHOD**.
5. Navigate to the OAuth Config settings.
6. Set the OAuth Header to the header of your choice.
7. Set the OAuth API Key to either `OAuth` or `OAUTH`.
8. Configure the rest of the required fields.
9. Save your changes.

![mceclip3.png](https://developer.salesforce.com/docs/media/retail-cloud/mceclip3.png)

#### Example SPI Request with Headers

```json
{
  "httpHeaders": {
    "Authorization": "Bearer *****",
    "Content-Type": "application/json"
  }
}
```
