> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connector reference

> Connect Alumio to commercetools: HTTP client, subscriber, and publisher.

## Extra information

System documentation: [https://docs.commercetools.com/api/](https://docs.commercetools.com/api/)

## Connector package documentation

### Table of Contents

* **1.** Setting up HTTP Client Commercetools
  * **1.1** Steps
* **2.** Subscribing to entities from Commercetools
  * **2.1** Steps
  * **2.2** General concept
* **3.** Publishing entity to Commercetools
  * **3.1** Steps
  * **3.2** General concept

### Setting up HTTP Client Commercetools

**Steps**

1. In the Alumio Dashboard, go to Connections -> HTTP (API). Create a new HTTP Client and select Commercetools HTTP Client as the prototype of the HTTP Client.
2. Fill in the Region Auth URL, Region API URL, Project Key, Username/Client ID, Password/Client Secret, and Scopes.
   For more information, see [Commercetools General Concepts](https://docs.commercetools.com/api/general-concepts)
3. You can optionally enable logging of request to get the log of the authentication.
4. Click “Grant Access to Commercetools” and the key will be filled.
5. Save the HTTP Client for use.

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/commercetools-reference-01.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=f9feb154902a3029767b32d3396c123a" alt="commercetools connector screenshot 1" width="690" height="489" data-path="images/connectors/commercetools-reference-01.png" />

### Subscribing to Entities from Commercetools

**Steps**

1. Go to Integrations -> Incoming and create a new incoming configuration and select Commercetools Subscriber as the subscriber (use the latest version **2025-02**).
2. Select the Commercetools HTTP Client to use.
3. Select the Entity you want to subscribe to from Commercetools.
4. Add any request parameters needed to subscribe to the entity.
5. You can optionally add a transformer to modify the request parameters into something you will request from Commercetools.
6. You can also optionally enable pagination to allow Alumio to fetch paginated entities.

**General Concept**
We follow Commercetools documentation on building this connector, so you can easily use the connector based on [Commercetools API Reference](https://docs.commercetools.com/api/).

**HTTP Client**
The HTTP Client configuration you will use to access Commercetools.

**Method**
Currently we support Get (HTTP Get method),and Head(HTTP HEAD method) for publishing data to Commercetools.

**Entity**
The entity you want to subscribe to from Commercetools.
Please refer to the entity from the [Commercetools API Reference](https://docs.commercetools.com/api/) page.

**Request Parameters**
These are the parameters you can provide to get the needed entity based on Commercetools API Reference. Please look at the example below on how to fill Request Parameters field when subscribing Single Request entity

For example, we try subscribing to "Get Order by ID".

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/commercetools-reference-02.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=106dc82ebbcc5efb826cc2dc2e80714d" alt="commercetools connector screenshot 2" width="452" height="124" data-path="images/connectors/commercetools-reference-02.png" />

We can see in the documentation that there is a projectKey and ID present in the path URL. Alumio will fill in the project key from the HTTP Client, and you can fill in the ID as follows:

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/commercetools-reference-03.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=11f70e91bbb8df62ffedf05e7c8d11d8" alt="commercetools connector screenshot 3" width="354" height="134" data-path="images/connectors/commercetools-reference-03.png" />

* "Path" is the path parameter of the url. For example the \{id}.
* "Query" is a defined set of parameters attached to the end of a url.\
  Example: [www.url.com?type=true\&start=0](http://www.url.com?type=true\&start=0)

Alumio will then send this to the Commercetools as /orders/cb4c3632-f8e5-4283-af8b-39e1d45e44b1

**Input Transformer**

Any transformers set here will be executed before the Request Parameters are loaded. So, you can add any transformer to provide and manipulate the request parameters into anything you need, either as path parameters and/or as query parameters of an entity.

### Publishing Entity to Commercetools

**Steps**

1. Go to Integrations -> Outgoing, create a new outgoing configuration and select Commercetools Publisher as the publisher.
2. Select the HTTP Client to use (use the latest version **2025-02**).
3. Select the Method that you want the publisher to perform with the data.
4. Select the Commercetools entity you want the data to be published to.
5. (Optional) Add any path data to the request on the key path.
6. (Optional) Add any query data to the request on the key query.
7. (Optional) Add any payload data to the request on the key payload.

**3.2 General Concept**

Like the subscriber, the publisher has similar methods on how to use it. The difference is the payload that will be submitted by the publisher originating from the data (from routes, from transformers in outgoing configuration), though you can also add or modify the data using transformers.

**HTTP Client**

The HTTP Client configuration you will use to access Commercetools.

**Method**
Currently we support Create (HTTP POST method), and Delete (HTTP DELETE method) for publishing data to Commercetools.

**Entity**

We support publishing to most Commercetools endpoints.
Please refer to [Commercetools API Reference](https://docs.commercetools.com/api/) page.
Based on the documentation, some endpoints may need one or more path parameters.

And below are example data for when we want to use "Update Category by ID" :

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/commercetools-reference-04.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=1e063c703ac5796cdc1c84bd756d8c94" alt="commercetools connector screenshot 4" width="389" height="500" data-path="images/connectors/commercetools-reference-04.png" />

We can see in the documentation there is a project key and ID in the path URL. Alumio will fill in the project key from the HTTP Client. So, we still need to fill in the ID example of the data which looks like this:

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/commercetools-reference-05.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=78577e24e8bd8f3848a5d9a9735f2c9d" alt="commercetools connector screenshot 5" width="519" height="316" data-path="images/connectors/commercetools-reference-05.png" />

Alumio will then send this to the Commercetools as /categories/cd4c3632-e8e5-4283-af8b-39e1d45e44b1

* "Path" is the path parameter of the url. For example the \{id}.
* "Query" is defined set of parameters attached to the end of a url.\
  Example: [www.url.com?type=true\&start=0](http://www.url.com?type=true\&start=0)
* "Payload" is the data contained within a request.
