Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(integrations): added provider support for commercetools #3347

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions docs-v2/integrations/all/commercetools.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Commercetools
sidebarTitle: Commercetools
provider: commercetools
---

import Overview from "/snippets/overview.mdx";
import PreBuiltTooling from "/snippets/generated/commercetools/PreBuiltTooling.mdx";
import PreBuiltUseCases from "/snippets/generated/commercetools/PreBuiltUseCases.mdx";

<Overview />
<PreBuiltTooling />
<PreBuiltUseCases />

## Access requirements
| Pre-Requisites | Status | Comment|
| - | - | - |
| Paid dev account | ✅ | Required for API access |
| Paid test account | ✅ | Recommended for testing |
| Partnership | ❌ | Not required |
| App review | ❌ | Not required |
| Security audit | ❌ | Not required |

## Setup guide

To integrate with Commercetools, follow these steps:

1. **Create a Project**: Log in to your Commercetools account and create a new project. Note down the **Project Key**.
2. **Generate API Credentials**: Navigate to the **API Clients** section in your project settings and create a new API client. Save the **Client ID** and **Client Secret**.
3. **Configure Nango**: Use the **Client ID**, **Client Secret**, and **Project Key** to set up the Commercetools integration in Nango.
4. **Set Region**: Specify the region (e.g., `us`, `eu`, `au`) where your Commercetools project is hosted.

<Tip>Need help getting started? Get help in the [community](https://nango.dev/slack).</Tip>

<Note>Contribute improvements to the setup guide by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/commercetools.mdx)</Note>

## Useful links

- [Commercetools API Documentation](https://docs.commercetools.com/api)
- [OAuth 2.0 Authentication Guide](https://docs.commercetools.com/api/authorization)
- [Commercetools SDKs](https://docs.commercetools.com/sdk)
- [Commercetools Getting Started Guide](https://docs.commercetools.com/getting-started)

<Note>Contribute useful links by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/commercetools.mdx)</Note>

## API gotchas

- **Scopes**: Ensure you specify the correct scope (e.g., `manage_project:your-project-key`) when generating the OAuth token. Without the correct scope, API requests will fail.
- **Token Expiry**: Access tokens expire after 2 days (172800 seconds). Make sure to refresh the token before it expires.
- **Region-Specific Endpoints**: Use the correct region-specific endpoint (e.g., `auth.us.commercetools.com` for the US region) when making API requests.

<Note>Contribute API gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/commercetools.mdx)</Note>

<Card title="Connect to Commercetools" icon="link" href="/integrations/all/commercetools/connect" horizontal>
Guide to connect to Commercetools using Nango Connect.
</Card>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions docs-v2/integrations/all/commercetools/connect.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: Commercetools - How do I link my account?
sidebarTitle: Commercetools
---

# Overview

To authenticate with Commercetools, you will need:
1. **Client ID** - The unique identifier for your API client, used to authenticate API requests.
2. **Client Secret** - A secure key linked to your API client, required for authentication.
3. **Project Key** - The unique identifier for your Commercetools project.
4. **Region** - The full region identifier for your Commercetools project (e.g., `europe-west1` for GCP or `eu-central-1` for AWS).
5. **Cloud Provider** - The cloud provider hosting your Commercetools project (e.g., `gcp` or `aws`).

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
1. Log in to your Commercetools account and navigate to the **Merchant Center**.
2. Go to **Settings** > **Developer settings**.
3. On the **API clients** tab, click **Create new API client**.
4. 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**.
5. 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.

<img src="/integrations/all/commercetools/api_client_creation.png" />

#### Step 2: Save the API Environment Variables
1. After creating the API client, you can save the credentials in an environment variables file for easy integration.
2. From the drop-down menu, select **Environment Variables (.env)** and click the download icon.
3. 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`).
4. Rename the downloaded file to `.env` and open it with a text or code editor to view the credentials.

<img src="/integrations/all/commercetools/env_variables.png" />

#### 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
1. 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 after `ak.` 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
1. 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 after `api.` 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**:
1. Open the form where you need to authenticate with Commercetools.
2. Enter the **Client ID**, **Client Secret**, **Project Key**, **Region**, and **Cloud Provider** in their respective fields.
3. Submit the form, and you should be successfully authenticated.


You are now connected to Commercetools.

<Tip>Need help getting started? Get help in the [community](https://nango.dev/slack).</Tip>

<Note>Contribute improvements to this guide by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/commercetools.mdx).</Note>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs-v2/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
"integrations/all/cloudentity",
"integrations/all/codeclimate",
"integrations/all/coda",
"integrations/all/commercetools",
"integrations/all/connectwise-psa",
"integrations/all/confluence",
"integrations/all/contentful",
Expand Down
41 changes: 41 additions & 0 deletions docs-v2/snippets/generated/commercetools/PreBuiltTooling.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Pre-built tooling
<AccordionGroup>
<Accordion title="✅ Authorization">
| Tools | Status |
| - | - |
| Pre-built authorization (OAuth) | ✅ |
| Credentials auto-refresh | ✅ |
| Pre-built authorization UI | ✅ |
| Custom authorization UI | ✅ |
| End-user authorization guide | ✅ |
| Expired credentials detection | ✅ |
</Accordion>
<Accordion title="✅ Read & write data">
| Tools | Status |
| - | - |
| Pre-built integrations | 🚫 (time to contribute: &lt;48h) |
| API unification | ✅ |
| 2-way sync | ✅ |
| Webhooks from Nango on data modifications | ✅ |
| Real-time webhooks from 3rd-party API | 🚫 (time to contribute: &lt;48h) |
| Proxy requests | ✅ |
</Accordion>
<Accordion title="✅ Observability & data quality">
| Tools | Status |
| - | - |
| HTTP request logging | ✅ |
| End-to-type type safety | ✅ |
| Data runtime validation | ✅ |
| OpenTelemetry export | ✅ |
| Slack alerts on errors | ✅ |
| Integration status API | ✅ |
</Accordion>
<Accordion title="✅ Customization">
| Tools | Status |
| - | - |
| Create or customize use-cases | ✅ |
| Pre-configured pagination | 🚫 (time to contribute: &lt;48h) |
| Pre-configured rate-limit handling | 🚫 (time to contribute: &lt;48h) |
| Per-customer configurations | ✅ |
</Accordion>
</AccordionGroup>
5 changes: 5 additions & 0 deletions docs-v2/snippets/generated/commercetools/PreBuiltUseCases.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Pre-built integrations

_No pre-built integration yet (time to contribute: &lt;48h)_

<Tip>Not seeing the integration you need? [Build your own](https://docs.nango.dev/guides/custom-integrations/overview) independently.</Tip>
39 changes: 39 additions & 0 deletions packages/providers/providers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,45 @@ codeclimate:
title: API Key
description: The API key for your Code Climate account

commercetools:
display_name: Commercetools
categories:
- e-commerce
auth_mode: OAUTH2_CC
token_url: https://auth.${connectionConfig.region}.${connectionConfig.cloudProvider}.commercetools.com/oauth/token
token_request_auth_method: basic
scope_separator: ' '
token_params:
grant_type: client_credentials
proxy:
base_url: https://api.${connectionConfig.region}.${connectionConfig.cloudProvider}.commercetools.com/${connectionConfig.projectKey}
headers:
authorization: Bearer ${accessToken}
docs: https://docs.nango.dev/integrations/all/commercetools
docs_connect: https://docs.nango.dev/integrations/all/commercetools/connect
connection_config:
region:
type: string
title: Region
description: The region of your Commercetools account. Use the full region identifier (e.g., 'us-central1' for GCP or 'us-east-2' for AWS).
example: us-central1
pattern: '^[a-z]+-[a-z0-9-]+$'
doc_section: '#step-3-identify-your-region-and-cloud-provider'
projectKey:
type: string
title: Project Key
description: The project key of your Commercetools account
example: demo-project-slug
pattern: '^[a-zA-Z0-9-_]+$'
doc_section: '#step-2-save-the-api-environment-variables'
cloudProvider:
type: string
title: Cloud Provider
description: Cloud provider used to host your Commercetools project (e.g., 'gcp' or 'aws')
example: gcp
pattern: '^(gcp|aws)$'
doc_section: '#step-3-identify-your-region-and-cloud-provider'

copper:
display_name: Copper
categories:
Expand Down
AndrewKaranja marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading