Introduction
Occtoo provides a pre-built formatter that transfers product, variant, category, and attribute data from Occtoo to commercetools. Changes are propagated automatically, and the configuration options make it easy to tailor the integration to your needs. Occtoo Studio gives you full control over what is transferred: use segments to select the content, and choose which languages and attributes to include.About commercetools
commercetools is a cloud-based headless commerce platform that provides APIs to power e-commerce sales and similar functions for large businesses. Read more at commercetools.com.Data flow
The data exposed by an Occtoo destination is transferred by the formatter and pushed to an import container in commercetools. The product flow is mandatory; the category flow is optional. The formatter runs every hour and checks for deltas, which are then sent to commercetools. You can also trigger a full run manually when needed. Updates are pushed to a commercetools import container, which imports them asynchronously so that large numbers of updates can be processed. You can follow the progress of an import in the Merchant Center.
Installation and setup
Prerequisites
- Access to the commercetools Merchant Center
- Access to the source code
Get the code
Request the code from developer@occtoo.com.Register an API client in commercetools
Register an API client in commercetools by going to Settings > Developer settings and selecting Create new API client. Make sure to select the scopes required by the formatter, then copy all the values shown in the API client details — they are only displayed once. Add the values to the following formatter settings:CommercetoolsImportClient__ClientIdCommercetoolsImportClient__ClientSecretCommercetoolsImportClient__AuthorizationBaseAddressCommercetoolsImportClient__ScopeCommercetoolsImportClient__ProjectKeyCommercetoolsImportClient__ApiBaseAddress
The values for
CommercetoolsImportClient__AuthorizationBaseAddress and CommercetoolsImportClient__ApiBaseAddress must end with a slash (/).
Endpoints
Products
The product flow is mandatory, so you need to provide an endpoint for product and product variant data. Add the URL of the product endpoint to the following setting:DestinationSettings__ProductUrl
- productName — Localized text
- productSlug — Localized text
- productId — Text
- productCategories — List
- sku — Text
- productDescription — Text
- productType — Text
- productMetaTitle — Localized text
- productKeywords — Localized text
- isMasterVariant — Boolean

Categories
The category flow is optional and requires a separate endpoint for the categories. If you use it, add the URL to the following setting:DestinationSettings__CategoriesUrl
- name — Localized text
- slug — Localized text
- description — Localized text
- parent — Text
- externalId — Text
- metaTitle — Localized text
- metaDescription — Localized text
- metaKeywords — Localized text
- orderHint — Text
The value of orderHint must be between 0 and 1.


Register an application in Occtoo
Register an application in Occtoo Studio and save its credentials in the configuration file for the formatter. Add the following settings:ApiClientCredentials__ClientIdApiClientCredentials__ClientSecretApiClientCredentials__TokenAuthUrl

Product type
Create a product type in commercetools to assign to all products, then add its name to theCommercetoolsSettings__ProductTypeName setting in the configuration file for the formatter.

Languages
The languages configured for the destination should match the languages configured in the Merchant Center. Add the list of outbound languages to the configuration file for the formatter, with one row per language. For example:

Import container
Import containers are created automatically and can be viewed in the Merchant Center. Use them to follow ongoing imports and to get information about any failures.
Attributes
Create the attributes in commercetools under the product type specified in the previous step, and set each attribute key to match the property identifier in Occtoo. For list values in commercetools, the values must be predefined before they can be used. Add the attributes you want to transfer to the configuration file for the formatter and specify the commercetools attribute type for each one. For example:- Boolean
- Text
- LocalizedText
- Number
- DateTime
- Date
- Time
- EnumList
- LocalizedList
Product publishing
To publish products or product variants automatically when they are transferred to commercetools, set either of these settings totrue:
CommercetoolsSettings__PublishProductsCommercetoolsSettings__PublishProductVariants
Manual execution
To run the flow manually, use the following POST endpoint:LastRunTime parameter, which specifies the point in time the delta is calculated from. For a full synchronization, set it to a very early date.