commercetools Customer Sync
Essential knowledgeCore knowledge to understand Fluent Commerce
Changed on:
8 June 2026
Overview
The Customer Sync module manages the synchronization of customer profiles from commercetools to Fluent Order Management. The module automatically tracks when customer records are created or modified to ensure that contact details and account histories match across platforms. By utilizing a decoupled, queue-based architecture, the module handles data extraction and payload building asynchronously without affecting storefront performance.Key points
- What You Will Learn: You will learn how the module captures profile modifications, processes records via the system indexer, and utilizes structured payload builders to transmit customer updates asynchronously.
- Database Level Tracking: The background delta synchronization utilizes database triggers across four core entity tables to guarantee that all manual administrative edits, third-party updates, and bulk data imports are captured.
- Payload Modification Framework: The data pipeline constructs API payloads through type-specific data builders. Developers can safely customize or intercept profile properties before synchronization by leveraging eight dedicated event hooks.
Synchronization Methods
The module offers three pathways to initiate customer data synchronization into the asynchronous processing queue:- Command-Line Interface (CLI): Technical teams execute this option manually via the terminal. This method pushes all targeted data into the message queue and is designed for the initial full data load immediately after module installation.
- Administrative Console: Business users trigger manual synchronization from the admin panel. The module evaluates the selected date range and exports records modified from that specific timestamp up to the execution moment.
- Automatic Delta Sync: This automated background service uses database triggers and a custom system indexer to keep data current.
Technical Execution Pipeline
The automated background process monitors changes across four critical tables:`catalog_product_entity``catalog_product_entity_varchar``catalog_product_entity_int``catalog_product_entity_decimal`
`FluentConnector\Product\Model\Indexer\Product`. This indexer captures the modified entries and publishes them directly to the message queue.The consumer class `FluentConnector\Product\Model\MessageQueue\ProductSyncConsumer` monitors the queue and manages data transmission. To build the final API payloads, the system implements a strict builder pattern:`[Database Table Trigger] ──> [Product Indexer] ──> [Message Queue] ──> [ProductSyncConsumer] ──> [Payload Builder] ──> [Fluent API]`The core handler class `FluentConnector\Product\Model\Request\BuildProductPayload` evaluates the records and delegates configuration rules to type-specific builders:`FluentConnector\Product\Model\Request\Data\ProductType\Simple``FluentConnector\Product\Model\Request\Data\ProductType\Configurable`
Module Event Reference
You can customize data fields, queries, and collection properties without modifying core connector classes by using these event hooks:| Name | Description | Parameters |
`fluent_send_products_prepare_simple_variant_product_before` | Fires immediately after the database reads the records to be synchronized. | `collection` |
`fluent_send_products_prepare_simple_variant_product_data_after` | Allows custom modification of variant property arrays. | `product-payload` (array), `product` |
`fluent_send_products_prepare_simple_standard_product_before` | Fires after reading standard standalone records from the database. | `collection` |
`fluent_send_products_prepare_simple_standard_product_data_after` | Allows custom modification of standard record property fields. | `product-payload` (array), `product` |
`fluent_send_products_prepare_configurable_product_before` | Fires after matching configurable group records from the database. | `collection` |
`fluent_send_products_prepare_configurable_product_data_after` | Allows custom modification of configurable attribute matrices. | `productInfo` (array) |
`fluent_send_products_query_build_after` | Permits customization of the asynchronous query builder message. | `productMessage` (`EventMessageInterface`) |
`fluent_send_products_before` | Triggers directly before pushing data payloads out to the external platform. | `productIds` (array) |
`fluent_send_products_after` | Triggers immediately following a successful data payload transmission. | `productIds` (array) |
Configuration Examples
To execute a manual full synchronization from the command-line interface, use the following terminal command:Bash
`bin/magento fluent:product_full:push`