Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The official fulfillmenttools integration apps for commercetools Connect

License

NotificationsYou must be signed in to change notification settings

fulfillmenttools/commercetools-connector

Repository files navigation

fulfillmenttools logo

ReleaseCISonarLicenseContributor CovenantPRs WelcomeTypeScript

🤖 Introduction

This repository contains the source code and configuration ofthecommercetools Connect applications built byfufillmenttools.These areConnect applications built in TypeScript using thecommercetools Connect Application Kit.

🔁 Functionality

The fulfillmenttools Connect app is a certified integration connector that can be used to exchange information between yourcommercetools project and yourfulfillmenttools project. While fully customizable it is very easy to setup and deploy so you can start fulfilling orders from you e-commerce system without a complicated integration process. It is available in the commercetools ConnectMarketplace.

🛒 Orders

The connector makes use of commercetoolssubscriptions to get notified once theOrderState of an Order is changed toConfirmed.At this state the order information is read and a new order iscreated in the fulfillmenttools platform.

ct order

Depending on the shipping method of the commercetools order, either a Ship-from-Store order or a Click&Collect order is created in fulfillmenttools.

The fulfillmenttools distributed order management system (DOMS) will process the new order and (based on its configuration) route the order to the best fulfillment location. Then the actual fulfillment process of picking, packing, and shipping can be executed in the selected location.

📦 Fulfillment Status

As a result of the order routing process, a pick job will be created in the fulfillmenttools platform.During the life time of the pick job (picking started, finished) and the corresponding handover job (created, handed over) the platform will send out events with status updates.This information is processed by the connector to update custom fields and ultimately theShipmentState of the commercetools order.

fft status

The following events are used to update the commercetools order:

EventAction
ORDER_CREATEDSet custom fieldfft_order_id
PICK_JOB_CREATEDSet custom fieldsfft_pickjob_id,fft_short_id, andfft_facility_id
PICK_JOB_PICKING_FINISHEDSet custom fieldfft_load_units_amount
HANDOVERJOB_CREATEDSet custom fieldfft_handoverjob_id, update ShipmentState toReady
HANDOVERJOB_HANDED_OVERUpdate ShipmentState toShipped

See the section oncustomization below for details on the used data fields.

Channels

The connector also synchronizes information from commercetoolsChannels to create or update a fulfillmenttoolsFacility. Please note that only Channels with theInventorySupply role are synchronized, other roles are ignored. The created fulfillmenttools Facility will be of typeSTORE and have theSHIP_FROM_STORE andPICKUP services enabled. In a future version of this connector, we will support Channel custom fields to configure the Facility type and services.

ct channel

The Channelkey is used as FacilitytenantFacilityId to establish a relationship between the two entities.When the commercetools Channel has an address, it is used as the Facility's address, otherwise a default is used, because an address is mandatory for a fulfillmenttools Facility. In this case you may have to update/edit the Facility with the correct data, please see theproduct documentation for details.

When the commercetools Channel is deleted, the related fulfillmenttools Facility is NOT deleted but only set toOFFLINE. This is to prevent accidental deletion of operational data. You can still delete the Facility via the API or in the backoffice, should you wish to do so.

Currently, the synchronization between Channels and Facilities is in one direction only, i.e. changes made to a fulfillmenttools Facility will not be forwarded to related commercetools Channel.

🚀 Deployment

👉 Prerequisites

  1. commercetools Composable Commerceaccount andAPI client
  2. fulfillmenttoolsaccount andAPI credentials

Installing the connector

While you can deploy the connector into your Composable Commerce project using theConnect API, the easiest way to deploy it is using the Merchant Center. In your project go to the Connect marketplace, select the fulfillmenttools Connector, click "Install" and follow the steps for deployment.

Uninstalling the connector

Again, you can undeploy the connector from your project using theConnect API or simply use the Merchant Center.

👨‍💻 Development

👉 Requirements

🛫 Setup

$ nvm use

🤸 Building and running the apps locally

This repository contains the two Connect appsevent andservice along with ashared module.Each app is built and deployed separately.

Theshared module contains functionality that is used by both apps.

All three modules are built in the same way:

$ npm install$ npm run build

Theevent andservice apps can be run locally using one of either goals:

$ npm run start$ npm run start:dev

When running the app indevelopment mode the.env.local file will be used (also for running unit tests).

To run the app inproduction mode, you need to provide a.env file (but do not check this into the git repository).

Donot check actual passwords etc. into the git repository!

🕵️ Running unit tests

When running unit tests the.env.local file will be used with dummy settings.

$ npm runtest

🕵️‍♀️ Linting

$ npm run lint

🔗 Integration of commercetools and fulfillmenttools

This section describes the necessary steps to integrate the connector with commercetools and fulfillmenttools, so that

  • order information is forwarded from commercetools to fulfillmenttools, and
  • fulfillment status updates are sent back from fulfillmenttools to commercetools.

Have a look at thecommercetools documentation for further details.

🙋‍♂️ Commercetools API client

For each commercetools project we need anAPI client (managed in Merchant Center under Settings > Developer settings) with at least the following scopes:

  • manage_orders
  • manage_states
  • manage_subscriptions
  • manage_types
  • view_products
  • view_project_settings
  • view_published_products
  • view_stores

Use the received credentials to setCTP_CLIENT_ID andCTP_CLIENT_SECRET when deploying the app.

⚙️ Commercetools customization

The connect apps use a ConfigurationCustom Object identified by containerfft and keyconfiguration with the following settings:

SettingDescription
collectChannelReferenceFieldNameName of custom field in a commercetoolsOrder that holds the key of a channel that should be used for a Click&Collect order. This field can freely be defined by the customer. When the fulfillmenttools connect app receives a commercetools Order it checks if this custom field is present. If so, the value of the field is used to identify the fulfillmenttoolsFacility for a C&C order.
orderCustomTypeKeyName of the commercetoolsCustom Type that is used for the Orders. This can freely be chosen by the customer. When the fulfillmenttools connect app receives a commercetools Order it checks if it already has this type. AdditionalCustom Fields are then added to this type and filled with information from the fulfillmenttools process.
shippingMethodMappingThis is a map where the key is thekey of a commercetoolsShipping Method. For each shipping method you want to use in your commercetools project you have to define a mapping. The value object of the mapping is used to select theDelivery Preferences of the fulfillmenttools Order.

Here's an example of the configuration object. The shipping method with keydhl is mapped to theDHL_V2 carrier. The shipping method with keycc designates a Click&Collect order. In commercetools the shipping methods keys can be freely defined while the fulfillmenttools carrier keys are fixed by the platform:

{"collectChannelReferenceFieldName":"fft_supply_channel_for_click_and_collect","orderCustomTypeKey":"orderCustomFields","shippingMethodMapping": {"dhl": {"serviceType":"SHIPPING","serviceLevel":"DELIVERY","carriers": ["DHL_V2"]    },"gls": {"serviceType":"SHIPPING","serviceLevel":"DELIVERY","carriers": ["GLS"]    },"cc": {"serviceType":"CLICK_AND_COLLECT"    }  }}

The following OrderCustom Fields are used by the connect apps and the configured customType is automatically extended with these fields:

  • fft_order_id
  • fft_pickjob_id
  • fft_load_units_amount
  • fft_handover_job_id
  • fft_shortid
  • fft_facility_id
  • fft_parcels

📫 Setup commercetools subscription

This is automatically done by theconnector:post-deploy script which is invoked after the app has been deployed into a commercetools environment.

📫 Setup fulfillmenttools subscriptions

This is automatically done by theconnector:post-deploy script which is invoked after the app has been deployed into a commercetools environment.

❌ Deactivate Event/Service

By default, all three events/services are activated (order sync, facility sync and status updates). However, you can deactivate each one individually by setting the corresponding value tofalse when installing the connector.

VARDescription
FEAT_ORDERSYNC_ACTIVESet tofalse will deactivate the order sync (default istrue)
FEAT_CHANNELSYNC_ACTIVESet tofalse will deactivate the channel sync (default istrue)
FEAT_STATUSUPDATES_ACTIVESet tofalse will deactivate the status updates (default istrue)

🏰 Architecture principles for building a commercetools Connect application

  • Connector solution should be lightweight in nature
  • Connector solutions should follow test driven development. Unit , Integration (& E2E) tests should be included and successfully passed to be used
  • No hardcoding of customer related config. If needed, values in an environment file which should not be maintained in repository
  • Connector solution should be supported with detailed documentation
  • Connectors should be point to point in nature, currently doesnt support any persistence capabilities apart from in memory persistence
  • Connector solution should use open source technologies, although connector itself can be private for specific customer(s)
  • Code should not containconsole.log statements, usethe included logger instead.

📜 License

All code in this repository is licensed under theMIT license.

🙌 Contributing

We'd love to have your helping hand on this ecosystem! Please seeCONTRIBUTING.md for more information on our guidelines.

💙 Thanks

Thanks for all your contributions and efforts towards improving the fulfillmenttools commercetools Connect app. We thank you for being part of our ✨ community ✨!

About

The official fulfillmenttools integration apps for commercetools Connect

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp