Commercetools - How do I link my account?
Overview
To authenticate with Commercetools, you will need:
- Client ID - The unique identifier for your API client, used to authenticate API requests.
- Client Secret - A secure key linked to your API client, required for authentication.
- Project Key - The unique identifier for your Commercetools project.
- Region - The full region identifier for your Commercetools project (e.g.,
europe-west1
for GCP oreu-central-1
for AWS). - Cloud Provider - The cloud provider hosting your Commercetools project (e.g.,
gcp
oraws
).
This guide will walk you through creating an API client and retrieving the necessary credentials to connect to Commercetools.
Prerequisites:
- You must have a registered account with Commercetools.
- You need administrative access to your Commercetools project to create an API client.
Instructions:
Step 1: Create an API Client
-
Log in to your Commercetools account and navigate to the Merchant Center.
-
Go to Settings > Developer settings.
-
On the API clients tab, click Create new API client.
-
On the New API client page:
- Enter a name for your API client. The name does not affect how the API functions.
- Select the scopes for your API client. To provide complete access, select Admin client. For security best practices, limit the scopes to the minimum required for your use case.
- Click Create API client.
-
After creation, your API client information will be displayed in the Client credential flow section. This includes:
- Project Key
- Client ID
- Client Secret
- Scope
- API URL
- Auth URL
Important: This information is only displayed once. Save it securely before leaving or closing the page.
Step 2: Save the API Environment Variables
- After creating the API client, you can save the credentials in an environment variables file for easy integration.
- From the drop-down menu, select Environment Variables (.env) and click the download icon.
- The file will be downloaded with a placeholder name based on your Project Key and the name of your API client (e.g.,
project-key_API-client-name.env
). - Rename the downloaded file to
.env
and open it with a text or code editor to view the credentials.
Step 3: Identify Your Region and Cloud Provider
You can identify your region and cloud provider in one of two ways:
Option 1: From the Browser URL
- Log in to your Commercetools account and look at the URL in your browser. For example: https://ak.europe-west1.gcp.commercetools.com/nango-test/welcome
- Region:
europe-west1
(the part afterak.
and before.gcp
or.aws
). - Cloud Provider:
gcp
(the part after the region and before.commercetools.com
).
Option 2: From the API URL in the API Client Information
- After creating the API client, the API URL will be displayed in the Client credential flow section. For example: https://api.europe-west1.gcp.commercetools.com
- Region:
europe-west1
(the part afterapi.
and before.gcp
or.aws
). - Cloud Provider:
gcp
(the part after the region and before.commercetools.com
).
Step 4: Enter Credentials in the Connect UI
Once you have the Client ID, Client Secret, Project Key, Region, and Cloud Provider:
- Open the form where you need to authenticate with Commercetools.
- Enter the Client ID, Client Secret, Project Key, Region, and Cloud Provider in their respective fields.
- Submit the form, and you should be successfully authenticated.
You are now connected to Commercetools.
Was this page helpful?