Overview
Once Commercetools is connected, the Dema Agent can query orders, products, customers, inventory, and categories from your Commercetools project. Useful for bringing composable commerce data into a Dema analysis.Prerequisites
- A Commercetools project you have admin access to.
- Permission to create API Clients in the Commercetools Merchant Center.
- Your project’s region (for example
europe-west1.gcporus-central1.gcp).
Commercetools uses long-lived API credentials rather than an interactive login. You create an API Client in Merchant Center and paste its credentials into Dema.
Connect Commercetools
Create an API Client in Merchant Center
- Open Merchant Center and go to Settings → Developer settings → API clients.
- Click Create new API client.
- Give it a recognizable name such as
Dema Agent. - Under Scopes, select the scopes listed under Scopes Dema requests below. You can scope access to specific stores if you only want Dema to see part of the project.
- Click Create API client.
Copy the credentials
Merchant Center shows the credentials only once. Copy the following values:
- Client ID
- Secret
- Auth URL (for example
https://auth.europe-west1.gcp.commercetools.com/oauth/token). This is the value you paste into Dema as the Token URL.
Paste the credentials into Dema
In Dema, go to Agents → Settings → Integrations, find Commercetools, and click Connect. Enter:
- Client ID
- Client secret
- Token URL (the auth URL from the previous step)
You do not need to enter a project key. Dema reads the project key from the scopes you granted the API Client (for example
view_orders:my-project-key) during the first token exchange.Scopes Dema requests
Dema honors whichever scopes you assign to the API Client. For typical agent use, grant at least:| Scope pattern | What it allows |
|---|---|
view_orders:{projectKey} | Read order history |
view_products:{projectKey} | Read products and catalog |
view_customers:{projectKey} | Read customer records |
view_categories:{projectKey} | Read category tree |
manage_customers:{projectKey} | Update customer records and groups (optional, only if you want write access) |
{projectKey} with your real project key. Merchant Center will substitute it automatically when you pick scopes from the dropdown.
Troubleshooting
- Dema says the token URL is invalid. The auth URL must be HTTPS and must end with
.commercetools.com. Use the URL shown in Merchant Center for your region, not a hand-written value. - Dema cannot authenticate. Double-check the client secret. Merchant Center only shows it once, so if you lost it, create a new API Client and paste the new credentials.
- Missing scopes. If the agent reports it cannot see a resource, add the matching scope to the API Client in Merchant Center and reconnect in Dema.

