Configure Headless Commerce API Authentication via Account Manager

To authenticate with Account Manager, set up an API Client ID, then use it to obtain a token for making API calls.

  1. Log into Account Manager as an account administrator at https://account.demandware.com.
  2. Select the API Client tab.
  3. Select Add an API Client ID.
  4. Enter a unique Display Name and a strong password.
  5. Under Access Control, select Enabled.
  6. In the Organizations section, click Add.
  7. Select your org, and click Add.
  8. In the Roles section, take these steps:
    1. Click Add.
    2. Select Salesforce Commerce API, and click Add.
    3. Click the filter icon.
    4. In the Add Instance Filters tab, select your organization.
    5. Select your B2C Commerce instance, and click Add.
  9. In the Default Scopes field, add the desired scopes. For information about available scopes, see the AUTHZ Scope Catalog in the B2C Commerce API Guide.
  10. From the Token Endpoint Auth Method dropdown, select client_secret_post.
  11. From the Access Token Format dropdown, select JWT.

    To obtain an Account Manager token for calling the headless Commerce APIs, use your tenant ID, Client ID (not the display name), and Client ID password. For example:

    curl -k --data 'grant_type=client_credentials&scope=SALESFORCE_COMMERCE_API:tenant_ID' --user 'client_ID:password' -X POST 'https://{AccountManagerURL}/dwsso/oauth2/access_token'
    Note
    Note The tenant ID is part of your organization ID: f_ecom_tenant_id. For example, if your organization ID is f_ecom_zzzz_001, then the tenant ID is zzzz_001.

    When building URIs for your API calls, you need the short code for your B2C Commerce realm and your Salesforce Org’s tenant group ID. Use the short code in the base URL and the tenant group ID as the organization ID. For example:

    https://{ShortCode}.api.commercecloud.salesforce.com/inventory/availability/v1/​organizations/{TenantGroupId}/​availability-records/actions

    Get the tenant group ID and the base URL, which includes the short code, from the Omnichannel Inventory admin settings page. In your Salesforce org, from Setup, in the Quick Find box, enter Omnichannel Inventory, and then select Omnichannel Inventory.

    Important
    Important Use the tenant group ID as the Organization ID in resource URLs.
    Note
    Note For these inventory resources, the short code is a two-character country code in capital letters. Other resources use a different short code.