About the CommerceTools category

Add topics about this connector package here.
Always check the ‘How to use the Alumio connector packages’ topic.

Extra information

System documentation: HTTP 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

1. Setting up HTTP Client Commercetools

1.1 Steps

  1. In the Alumio Dashboard, go to Clients → HTTP Clients. Create a new HTTP Client and select Commercetools 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
  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.

2. Subscribing to Entities from Commercetools

2.1 Steps

  1. Go to Connections → Incoming and create a new incoming configuration and select Commercetools as the subscriber.
  2. Select the Commercetools HTTP Client to use.
  3. Select the Module 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.

2.2 General Concept

We follow Commercetools documentation on building this connector, so you can easily use the connector based on Commercetools API Reference.

HTTP Client

The HTTP Client configuration you will use to access Commercetools.

Module

The module you want to subscribe to from Commercetools.
Please refer to the modules from the Commercetools API Reference page.

Request Parameters

These are the parameters you can provide to get the needed entity based on the Commercetools API Reference.

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

image

We can see in the documentation that there is a project key 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:

image

  • “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

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.

3. Publishing Entity to Commercetools

3.1 Steps

  1. Go to Connections → Outgoing, create a new outgoing configuration and select Commercetools Publisher as the publisher.
  2. Select the HTTP Client to use.
  3. Select the Action 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.

Action

Currently we support Create (HTTP POST method), Update (HTTP PUT 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 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” :

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:

image

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
  • “Payload” is the data contained within a request.