Using the Channels and Policies API
Base URL
Use the following base URL for all Channels and Policies API requests.
https://na1-sandbox.api.commerce.adobe.com/<tenantId>/admin/graphql
For sample requests and examples using the API, see the API Reference and the tutorial.
The URL structure is:
https://<region>-<environment>.api.commerce.adobe.com/<tenantId>
region
is the cloud region where your instance is deployed.environment-type
is included only for non-production URLs (sandbox
).tenantId
is the unique identifier for your organization's specific instance within the Adobe Experience Cloud.
Get your tenant ID
Find your tenant ID in the access URLs for your Commerce Optimizer project in Cloud Manager.
Log in to your Adobe Experience Cloud account.
Under Quick access, click Commerce to open the Commerce Cloud Manager.
The Commerce Cloud Manager displays a list of instances that are available in your Adobe IMS organization.
To view the access URLs including the base URL for the REST and GraphQL APIs, click the information icon next to the instance name.
If you don't have access to the Commerce Cloud Manager, contact your system administrator.
Authentication
Every API request must include a bearer token in the request header:
Authorization: Bearer {access token}
The bearer token is generated using the credentials from the Adobe developer project for the API integration. The token is valid for 24 hours. When it expires, use the Adobe developer project credentials to generate a new one.
Get credentials and bearer access tokens
To get API authentication credentials and tokens, create an Adobe developer project to enable communication between your Commerce project and Merchandising Services APIs.
To create Projects for enterprise organizations, you must have a system administrator or developer role. For information on managing developers from the admin console, see Managing developers in the Adobe Enterprise & Teams Administration Guide.
Log in to the Adobe Developer Console.
Select the Experience Cloud Organization for the integration.
Create an API project.
Add the Adobe I/O Events for Adobe Commerce API to your project. Then, click Next.
Configure the Client ID and Client Secret credentials by selecting the OAUTH Server to Server Authentication option.
Click Save configured API.
In the Connected Credentials section, view API configuration details by selecting OAUTH Server-to-Server.
Copy the Client ID and the Client Secret values to a secure location.
Use the Client ID and Client Secret to refresh expired bearer tokens [using curl].
Include the Client ID in the
x-api-key
header to authenticate API requests.
Get the bearer access token.
Select Generate Access Token.
Save the bearer token to a secure location.
The bearer token is valid for 24 hours. You can use the same bearer token for all API requests until it expires.
Generate a new access token
To get API authentication credentials and tokens, create an Adobe developer project to enable communication between your Commerce project and Merchandising Services APIs.
To create Projects for enterprise organizations, you must have a system administrator or developer role. For information on managing developers from the admin console, see Managing developers in the Adobe Enterprise & Teams Administration Guide.
Log in to the Adobe Developer Console.
Select the Experience Cloud Organization for the integration.
Create an API project.
Add the Adobe I/O Events for Adobe Commerce API to your project. Then, click Next.
Configure the Client ID and Client Secret credentials by selecting the OAUTH Server to Server Authentication option.
Click Save configured API.
In the Connected Credentials section, view API configuration details by selecting OAUTH Server-to-Server.
Copy the Client ID and the Client Secret values to a secure location.
Use the Client ID and Client Secret to refresh expired bearer tokens [using curl].
Include the Client ID in the
x-api-key
header to authenticate API requests.
Get the bearer access token.
Select Generate Access Token.
Save the bearer token to a secure location.
The bearer token is valid for 24 hours. You can use the same bearer token for all API requests until it expires.
Headers
Include the following headers in GraphQL requests.
Header Name | Required | Description |
---|---|---|
Content-Type | Yes | Specifies the media type of the resource. Accepted value: application/json . |
Authorization: Bearer {access token} | Yes | Bearer token generated from IMS credentials. See Authentication. |
Request template
Use the following template to submit requests using curl, replacing the placeholders as required.
Copied to your clipboardcurl --request POST \--url https://na1-sandbox.api.commerce.adobe.com/<tenantId>/admin/graphql \--header "Content-Type: application/json" \--header "Authorization: Bearer {access token}" \--data "{apiPayload}"
For sample requests, see the tutorial.