# commercetools connect

The [fulfillmenttools connector app](https://marketplace.commercetools.com/integration/oc-fulfillment-gmbh) in the [commercetools marketplace](https://marketplace.commercetools.com/) is a certified integration connector that synchronizes information between your commercetools and your fulfillmenttools project. It's fully customizable and very easy to set up and deploy, so you can start fulfilling orders from your e-Commerce system without a complicated integration process.

[commercetools Connect](https://docs.commercetools.com/connect/) lets you add functionality to your project without buying and maintaining dedicated hosting or runtime environments.

Our fulfillmenttools connector app is published as open source under the MIT license. You can check it out from our [GitHub repository](https://github.com/fulfillmenttools/commercetools-connector).

## Receiving orders at fulfillmenttools

The fulfillmenttools connector app uses [commercetools subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to get notified once the [commercetools OrderState](https://docs.commercetools.com/api/projects/orders#orderstate) of an order is changed to `Confirmed`. With this status the commercetools order is ready and a new order is created in fulfillmenttools.

<figure><img src="/files/n2uqU6aLDVzy9hK4v6Bc" alt=""><figcaption></figcaption></figure>

Depending on the shipping method of the commercetools order, either a ship-from-store or a click-and-collect order is created in fulfillmenttools.

## Fulfillment status update at commercetools

As a result of the order routing process, a pick job will be created in fulfillmenttools. During the lifetime of the pick job (picking started, finished) and the corresponding handover job (created, handed over), fulfillmenttools sends out events with status updates. The fulfillmenttools connector app processes this information to update the custom fields and the [ShipmentState of the commercetools order](https://docs.commercetools.com/api/projects/orders#shipmentstate).

<figure><img src="/files/vUoMUVUgkLBL4A7AoIv6" alt=""><figcaption></figcaption></figure>

## Events for the commercetools order

The following [fulfillmenttools events](/documentation/getting-started/eventing/available-events.md) are used to update the commercetools order:

| Event                       | Action                                                                    |
| --------------------------- | ------------------------------------------------------------------------- |
| `ORDER_CREATED`             | Set custom field `fft_order_id`                                           |
| `PICK_JOB_CREATED`          | Set custom fields `fft_pickjob_id`, `fft_short_id`, and `fft_facility_id` |
| `PICK_JOB_PICKING_FINISHED` | Set custom field `fft_load_units_amount`                                  |
| `HANDOVERJOB_CREATED`       | Set custom field `fft_handoverjob_id`, update ShipmentState to `Ready`    |
| `HANDOVERJOB_HANDED_OVER`   | Update ShipmentState to `Shipped`                                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fulfillmenttools.com/documentation/integrations/commercetools-connect.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
