Skip to main content

Authorization

Follow this guide to create a new Salesforce B2C Commerce Cloud credential that will allow Nexla to authenticate to and exchange data with your Salesforce B2C Commerce Cloud account.
sfcc_api_b2c_auth.png

Salesforce B2C Commerce Cloud

Prerequisites

Before creating a Salesforce B2C Commerce Cloud credential, you need to obtain your OAuth2 Client ID, Client Secret, and other required configuration parameters from your Salesforce B2C Commerce Cloud account. Salesforce B2C Commerce Cloud uses OAuth2 2-legged authentication (Client Credentials flow), which allows Nexla to access your account using client credentials without user interaction.

To obtain your Salesforce B2C Commerce Cloud OAuth2 credentials, follow these steps:

  1. Sign in to your Salesforce B2C Commerce Cloud account using your administrator credentials.

  2. Navigate to your account settings or API management section in the Salesforce B2C Commerce Cloud interface.

  3. Look for the API or OAuth2 Applications section in your account settings, or navigate to Settings > API or Developers > OAuth2 Applications.

  4. If you don't have an OAuth2 application yet, look for the option to create or register your OAuth2 application.

  5. Click Create OAuth2 Application or Register OAuth2 Application to create a new OAuth2 application.

  6. Configure your OAuth2 application settings:

    • Enter a name for the application (e.g., "Nexla Integration")
    • Review and select the permissions or scopes for the application (if applicable)
    • Select Client Credentials or 2-legged OAuth as the grant type
  7. Click Create or Register to create the OAuth2 application.

  8. Your Client ID will be displayed immediately after creation. Copy the Client ID.

  9. Your Client Secret will be displayed immediately after creation. Copy the Client Secret immediately, as it may not be accessible again after you navigate away from the page.

  10. Navigate to your Salesforce B2C Commerce Cloud account settings to find your Organization ID, Realm ID, Instance ID, Short Code, and other required parameters. These can typically be found in your account settings or API configuration page.

  11. Store all credentials securely, as you will need them to configure your Nexla credential. The Client ID, Client Secret, and other configuration parameters are sensitive information and should be kept confidential.

The Client ID and Client Secret are used to authenticate with the Salesforce B2C Commerce Cloud API authentication endpoint (/dwsso/oauth2/access_token) to obtain an access token. The access token is then sent in the Authorization header with the Bearer prefix for all subsequent API requests to the Salesforce B2C Commerce Cloud API. The access token is automatically obtained and refreshed by Nexla as needed. If your credentials are compromised, you should immediately revoke them in your Salesforce B2C Commerce Cloud account settings and generate new ones. For detailed information about Salesforce B2C Commerce Cloud OAuth2 authentication, API access, and available endpoints, refer to the Salesforce B2C Commerce Cloud API documentation.

Create a Salesforce B2C Commerce Cloud Credential

  • To create a new Salesforce B2C Commerce Cloud credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – Salesforce B2C Commerce Cloud

SalesforceB2CCCCred.png

Credential Name & Description

  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

    Resource descriptions are recommended but are not required. They should be used provide information about the resource purpose, data freshness, etc. that can help the owner and other users efficiently understand and utilize the resource.

OAuth2 2-Legged Authentication

Salesforce B2C Commerce Cloud uses OAuth2 2-legged authentication for all API requests. Your Client ID and Client Secret are used to authenticate with the Salesforce B2C Commerce Cloud API authentication endpoint to obtain an access token, which is then used for all subsequent API requests.

  1. Enter your Salesforce B2C Commerce Cloud Client ID in the Client ID field. This is the Client ID you obtained from your Salesforce B2C Commerce Cloud account settings (Settings > API or Developers > OAuth2 Applications). The Client ID is used along with the Client Secret to authenticate with the Salesforce B2C Commerce Cloud API authentication endpoint and obtain an access token.

  2. Enter your Salesforce B2C Commerce Cloud Client Secret in the Client Secret field. This is the Client Secret you obtained from your Salesforce B2C Commerce Cloud account settings. The Client Secret is used along with the Client ID to authenticate with the Salesforce B2C Commerce Cloud API authentication endpoint and obtain an access token. The Client Secret is sensitive information and must be kept confidential.

  3. Enter the scope parameter in the Scope Parameter field (optional). This should be a space-separated list of requested scopes. The scope parameter determines which resources and operations your application can access. Leave this field empty if you want to use the default scope.

  4. Enter your Organization ID in the Organization ID field. This is a short string that identifies your B2C Commerce instance. The Organization ID is part of your B2C Commerce instance identifier and is required for API requests.

  5. Enter your Realm ID in the Realm ID field. This is a four-character string that is part of the organization ID following the second underscore (_) character. The Realm ID is required for constructing the OAuth2 scope.

  6. Enter your Instance ID in the Instance ID field. This is a three-character string that is part of the organization ID following the third underscore (_) character. The Instance ID is required for constructing the OAuth2 scope.

  7. Enter your Short Code in the Short Code field. This is an eight-character string that is assigned to your entire realm, across all instances. The Short Code is used in the API base URL.

  8. Enter the API version in the Version field. This should be the API version you want to use (default: v1). The version determines which API version will be used for all API requests.

    Your Salesforce B2C Commerce Cloud OAuth2 credentials can be found in your Salesforce B2C Commerce Cloud account settings under Settings > API or Developers > OAuth2 Applications. The Client ID and Client Secret are used to authenticate with the Salesforce B2C Commerce Cloud API authentication endpoint (/dwsso/oauth2/access_token) to obtain an access token. The access token is then automatically sent in the Authorization: Bearer {token} header for all subsequent API requests to the Salesforce B2C Commerce Cloud API.

    The access token is automatically obtained and refreshed by Nexla as needed. If your credentials are compromised, you should immediately revoke them in your Salesforce B2C Commerce Cloud account settings and generate new ones. The Client ID, Client Secret, and other configuration parameters provide access to your Salesforce B2C Commerce Cloud account data and should be treated as sensitive information. Keep your credentials secure and do not share them publicly.

    For detailed information about Salesforce B2C Commerce Cloud OAuth2 authentication, API access, and available endpoints, see the Salesforce B2C Commerce Cloud API documentation.

Save the Credential

  1. Once all of the relevant steps in the above sections have been completed, click the Save button at the bottom of the overlay to save the configured credential.

  2. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation and can be selected for use with a new data source or destination.