/
Commerce Tools - User Guide

Commerce Tools - User Guide

1. Installation

You can install the connector from the commerce tools marketplace.

image-20250210-152530.png

You will be asked for few variables

 

 

Event configuration

  • CTP_REGION : Commerce Tools composable commerce API region

  • CTP_CLIENT_ID : Commerce Tools composable commerce client ID

  • CTP_CLIENT_SECRET : Commerce Tools composable commerce client secret

  • CTP_PROJECT_KEY : Commerce Tools composable commerce project key

  • CTP_SCOPE : Commerce Tools composable commerce client scope

Merchant center custom application configuration

  • CLOUD_IDENTIFIER : The identifier of the cloud Region that the Custom Application uses to connect to Composable Commerce. The values map to the actual Merchant Center API URL for that Region

  • ENTRY_POINT_URI_PATH : The Application entry point URI path identified during registration of Custom Application

  • ONESTOCK_WEBHOOK_ENCRYPTION_KEY : An hash that will be used to create webhooks in OneStock

Sync Order configuration

  • CTP_REGION : Commerce Tools composable commerce API region

  • CTP_CLIENT_ID : Commerce Tools composable commerce client ID

  • CTP_CLIENT_SECRET : Commerce Tools composable commerce client secret

  • CTP_PROJECT_KEY : Commerce Tools composable commerce project key

  • CTP_SCOPE : Commerce Tools composable commerce client scope

Sync Product configuration

  • CTP_REGION : Commerce Tools composable commerce API region

  • CTP_CLIENT_ID : Commerce Tools composable commerce client ID

  • CTP_CLIENT_SECRET : Commerce Tools composable commerce client secret

  • CTP_PROJECT_KEY : Commerce Tools composable commerce project key

  • CTP_SCOPE : Commerce Tools composable commerce client scope

Sync Stock configuration

  • CTP_REGION : Commerce Tools composable commerce API region

  • CTP_CLIENT_ID : Commerce Tools composable commerce client ID

  • CTP_CLIENT_SECRET : Commerce Tools composable commerce client secret

  • CTP_PROJECT_KEY : Commerce Tools composable commerce project key

  • CTP_SCOPE : Commerce Tools composable commerce client scope

2. Configuration page

2.1. API configuration

Site ID: Your OneStock Site ID
API Url: Should be either

API User: The api user that has been created for your project
API Password: The API password that has been created for your project

Once your credentials saved, you will have access to more configurations.

2.2. Sales channels

For each of your stores, you will need to map it to a OneStock sales channel. A dropdown with the available sales channels configured in OneStock will allow you to do so.

2.3. Stock Requests and Cron Schedules

For each of your commercetools channel, you need to configure stock request settings and define the cron schedules for stock imports. Below are the required steps:

2.3.1. Full Stock Request

Each store must have a full stock request assigned. This request is used to import the complete stock data for that channel.

  • Example: export_unified_web_fullexport_warehouses_full

2.3.2. Delta Stock Request

A delta stock request should also be assigned for each store. This request is used to import only the stock changes (differences) since the last import.

  • Example: export_unified_web_diff

2.3.3. Full Stock Import Schedule

You must define a specific time at which the full stock import will be executed every day. This is a single daily execution.

  • Example: HH:mm AM/PM

2.3.4. Delta Stock Import Schedule

For delta stock updates, you must set up a cron schedule specifying:

  • Frequency: How often the delta stock import should run (e.g., every hour).

  • Start Time: The time from which the delta imports begin each day.

  • End Time: The time until which the delta imports are allowed to run.

3. Synchronization page

The Onestock Synchronization page allows users to manage the synchronization of products and stock between their system and OneStock. The page consists of two main sections:

  1. Exporting products to OneStock

  2. Importing stock from OneStock

Note that published products will also be automatically updated in OneStock.

4. Mapping page

The mapping page enables users to map fields from OneStock's order data to the corresponding fields in Commercetools' order data. The mapping allows you to ensure that both systems can communicate effectively by synchronizing order data between them.

The mapping form consists of the following elements:

  • Onestock Source Field: The field from the Onestock order JSON that you wish to map. You can select any field available in the Onestock order data structure.

  • Commercetools Target Field: The field in the Commercetools order JSON where the Onestock source data will be mapped to. This field can be selected to match the corresponding structure in Commercetools.

For instance, suppose you have this json delivery promise data from OneStock in one of your custom field named delivery_promise:

{ "delivery_promise":{ "original_delivery_option":{ "carbon_footprint":10, "cost":10, "cutoff":1733090400, "delivery_method":"Home Delivery Standard Singapore", "destination":{ "location":{ "country":"SG", "zip_code":"322149" } }, "eta_end":1733832001, "eta_start":1733367597, "metric_values":{ "shipping_fees":5 }, "shipment_number":1, "delivery_routes":[ { "carrier":{ "name":"dhlv2", "option":"express" }, "items":[ { "id":"1000000003", "quantity":1 } ] } ], "status":"valid" }, "sent_delivery_option":{ "eta_start":1733367597, "eta_end":1733832001 } } }

And you want to map this in delivery_promise key in onestock order, the mapping will be:

Onestock Source Field: delivery_promise Commercetools Target Field: custom.fields.delivery_promise

5. Jobs page

This section provides an overview of stock export and product import jobs.

5.1. Stock Export Jobs

Displays a list of stock export jobs with the following columns:

  • Export ID: Unique identifier for each export job.

  • Type: Type of stock export (either 'full' or 'diff').

  • Request Name: Name of the stock request associated with the export.

  • Channel Key: The key for the channel.

  • Channel ID: The ID of the channel.

  • Status: Current status of the export job.

5.2. Product Import Jobs

Displays a list of product import jobs with the following columns:

  • Job ID: Unique identifier for each import job.

  • Trigger Type: The type of trigger that initiated the job.

  • Status: Current status of the import job.

 

Related content

Shopify Connector - User Guide
Shopify Connector - User Guide
More like this
Magento Open Source Connector - User Guide
Magento Open Source Connector - User Guide
More like this