# 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="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2F252KkmMwRpIkFskPZeCr%2Fcommercetools%20sends%20order.png?alt=media&#x26;token=7d47914f-3a7d-4a31-8127-a7706afa13f8" 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="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2FXGAoXMRnGsRRSb7n2deT%2Ffulfillmenttools%20sends%20fulfillment%20status.png?alt=media&#x26;token=3f960098-ea20-4253-b2f2-18160ea4c4d5" alt=""><figcaption></figcaption></figure>

## Events for the commercetools order

The following [fulfillmenttools events](https://docs.fulfillmenttools.com/documentation/getting-started/eventing/available-events) 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`                                         |
