Setup Guide
This guide walks you through configuring your SAP Commerce Cloud instance and obtaining the OAuth 2.0 credentials required to use the connector.
Prerequisites
- An active SAP Commerce Cloud instance (on-premise or cloud-hosted). If you do not have one, contact your SAP administrator or request a trial.
- Administrator access to the SAP Commerce Administration Console (HAC) or Backoffice.
Step 1: Enable the OCC v2 API
-
Log in to the SAP Commerce Administration Console (HAC).
-
Verify that the commercewebservices extension is included in your
localextensions.xml. -
Confirm the OCC v2 endpoint is accessible at:
https://<your-commerce-host>/occ/v2 -
If the endpoint is not available, rebuild and restart your SAP Commerce instance after adding the extension.
On SAP Commerce Cloud (CCv2), the OCC API is enabled by default. These steps apply primarily to on-premise installations.
Step 2: Register an OAuth client
- Open the Backoffice Administration Cockpit and navigate to System > OAuth > OAuth Clients.
- Select Create to register a new OAuth client.
- Fill in the following fields:
- Client ID: Enter a unique identifier (e.g.,
ballerina_connector). - Client Secret: Enter a strong secret value.
- Authorities: Add
ROLE_TRUSTED_CLIENT(andROLE_CUSTOMERMANAGERGROUPif managing customers). - Authorized Grant Types: Select
client_credentials(for server-to-server) and/orpassword(for user-context flows). - Scopes: Add
basicandextended(or the scopes required for your use case).
- Client ID: Enter a unique identifier (e.g.,
- Save the OAuth client configuration.
Store the Client ID and Client Secret securely. Use Ballerina's configurable feature and a Config.toml file to supply them at runtime.
Step 3: Obtain the token URL
The token URL for SAP Commerce Cloud follows this pattern:
https://<your-commerce-host>/authorizationserver/oauth/token
For the OCC v2 context, some deployments use:
https://<your-commerce-host>/occ/v2/authorizationserver/oauth/token
Verify which URL is active by testing a token request with your client credentials.
Step 4: Identify your base site ID
- In Backoffice, navigate to WCMS > Website or Base Commerce > Base Sites.
- Note the Site ID for the storefront you want to integrate with (e.g.,
electronics,powertools,apparel-uk). - This value is passed as
baseSiteIdin most API calls.
You can also retrieve available base sites programmatically using the getBaseSites operation.
What's next
- Action reference: Available operations