Commerce API Configuration Values

The Salesforce API and SDK require configuration parameters. Some parameters are common B2C Commerce values, and some are specific to the Salesforce Commerce API.

B2C Commerce Values

Realm ID

The realm ID is a four-character ID for your B2C Commerce environment. For information about realms, see Concepts and Terminology in the user documentation.

Instance ID

The instance ID is a three-character value that describes the B2C environment in your realm:

  • For production, staging, or development instances, the instance IDs are prd, stg, or dev, respectively.
  • For on-demand sandboxes, the instance ID is a three-digit number derived from the instance of the sandbox. For example, if the sandbox is zxyp-005, the instance ID is 005.
  • For POD sandboxes, the format of the instance ID is sXX, where XX is a number between from 01 to 99. You can determine the instance ID for a POD sandbox from the organization ID described later on this page.

API Site ID

The API site ID is the name of the site for which you want to access data, for example RefArch or SiteGenesis. To see a list of sites in Business Manager, go to Administration > Sites > Manage Sites. For information about site names, see Create a Site in Business Manager in the user documentation.

API Client ID

The API client ID is created in Account Manager. It’s a UUID value in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. For information about API client IDs, see Add an API Client in the user documentation. For information about how to configure the API client ID with the appropriate permissions, see Commerce API Authentication.

Salesforce Commerce API Values

Short Code

The short code is an eight-character value assigned to a realm for routing purposes. The short code applies to your entire realm environment, across all instances. The short code is concatenated with api.commercecloud.salesforce.com to create the API host name for your API calls.
For example: u8ak193h.api.commercecloud.salesforce.com

Base URL

To form the base URL for an endpoint, replace {{short_code}} in the following string with the actual short code: https://{{short_code}}.api.commercecloud.salesforce.com.

Organization ID

The organization ID is based on the realm and instance that you want to access with the Commerce API. The organization ID is different for each instance: production, staging, development, and sandbox.

To form the organization ID, concatenate the realm ID and instance ID as follows: f_ecom_{{realm_id}}_{{instance_id}}. For example, for realm axgy and sandbox s05, the organization ID is f_ecom_axgy_s05.

If you have the Business Manager Administrator role, you can see both the short code and organization ID in Business Manager. Go to Administration > Site Development > Salesforce Commerce API Settings. If you’ve never used the Commerce API in your realm, click Request Short Code to assign a short code for your realm.

image.png

It can take up to 24 hours for the short code to propagate through all CDN and routing systems in your configuration.

image.png

Scopes

We use scopes to secure all calls to the Salesfor Commerce API:

  • AM-OAuth2: Used by data management apps, to manage product or customer data.
  • JWT (Shopper JWT): Used by shopping apps to authenticate the client app, and “register“ guest shopper-users and registered shopper-users.

For permission information, see the Client Permissions for API Endpoints.

For a list of current scopes, see the AuthZ Scope Catalog.

Session Secret

The session secret is a unique ID for session management that’s specific to the Commerce API SDK. The session secret identifies sessions with the SDK for each customer or shopper. The secret is an arbitrary value that you create yourself. Make sure that each session with the SDK has its own session secret. If the value is not unique for a customer application, session information can be unintentionally shared between ecommerce sites.

Omnichannel Inventory API Values

Organization ID

Omnichannel Inventory uses the Tenant Group ID in place of the Organization ID. Append the Tenant Group ID (not the Organization ID) to all calls to the Salesforcd Commerce API related to Omnichannel Inventory. For example:

To find your Tenant Group ID, from Salesforce Setup enter Omnichannel Inventory in the Quick Find box.