> ## Documentation Index
> Fetch the complete documentation index at: https://docs.occtoo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bluestone PIM

## Introduction

This integration adds enriched product data from Bluestone PIM into the Occtoo Product Orchestration Engine. Digital teams can then combine that product data with data and content from other sources, such as ERP and CRM systems, enrich it further, and activate it in any channel in real time for a seamless customer experience. Everything is executed in a no-code studio, making digital teams more autonomous when launching new digital initiatives.

## About Bluestone PIM

With Bluestone PIM, you can get your products to market and in front of customers faster, regardless of channel, region, or language.

Read more at [bluestonepim.com](https://www.bluestonepim.com/).

## Data flow

Updates from Bluestone PIM are transferred automatically to the relevant Occtoo sources. You can run a full synchronization when needed, and continuous updates run whenever a sync is done to the public API.

The full synchronization fetches all products and categories and imports them asynchronously. For continuous updates to work, you must configure a webhook in the Bluestone PIM user interface. The webhook triggers an event every time a sync completes and transfers all data related to that batch of updates, including both product- and category-related changes.

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/Bluestone_PIM_overview-3a9f7061b864a09b3b0d0774c0748e86.jpg?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=5075f149656e09f928c82d59f4f90139" alt="Overview of the data transfer from Bluestone PIM" width="1580" height="632" data-path="images/integrations/providers/Bluestone_PIM_overview-3a9f7061b864a09b3b0d0774c0748e86.jpg" />

## Install and set up the provider

### Prerequisites

To complete the setup, you need:

* Access to the Bluestone PIM client
* A Bluestone PIM API key
* Access to the source code
* An Azure storage account

### Get the code

Request the code from [developer@occtoo.com](mailto:developer@occtoo.com).

### Create sources in Occtoo

Create the target sources in Occtoo, then add their identifiers to the following provider settings:

* `CategoriesDataSource`
* `ProductsDataSource`
* `MediaDataSource`

For instructions, see [Add a data source](/guides/studio/sources/add-a-data-source).

### Register the provider in Occtoo

Register a provider and include the target sources from the previous step. Add the data provider ID and secret to the following settings:

* `DataProviderId`
* `DataProviderSecret`

For instructions, see [Add a data provider](/guides/studio/sources/add-a-data-provider).

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/register_provider-5d1af044091e551eddf5a29ac4b3ab6d.png?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=d1033337652fe952cb72b38f39cd5863" alt="Register a provider" width="1320" height="622" data-path="images/integrations/providers/register_provider-5d1af044091e551eddf5a29ac4b3ab6d.png" />

### Media

Set the `HandleMedia` setting to one of three values:

* `ignore` — media is not transferred.
* `bluestone` — use the original URLs provided by Bluestone PIM.
* `occtoo` — upload all assets to the Occtoo media service.

### Configure the Bluestone API

Before any data can be retrieved, you need an API key to connect to the Bluestone API. Add the key to the `BluestoneAPIKeyValue` setting.

### Languages and contexts

Configure the languages, or contexts, to transfer up front. Two settings control the contexts:

* `DefaultContext`
* `AdditionalContext`

The default context holds the data for all non-localized attributes. Its value combines the context key from Bluestone and the language identifier from Occtoo, separated by a colon — for example, `en:en`.

The additional context is optional and can contain one or more contexts to transfer as localized content. This setting works in relation to localized attributes. It follows the same structure as the default context, with multiple contexts separated by a comma — for example, `13472:sv,14373:de`.

To retrieve the context keys, call the `/Contexts` endpoint in the Bluestone public API.

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/get_contexts-84a63d645e339d865df0de2a7d93d83c.png?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=352f4d7f6f432cf52f1e755d4350fb51" alt="Get contexts from the Bluestone public API" width="891" height="577" data-path="images/integrations/providers/get_contexts-84a63d645e339d865df0de2a7d93d83c.png" />

### Attributes

All attribute types from Bluestone are transferred to Occtoo automatically, and the attribute number is used as the attribute identifier in Occtoo. Complex data types from Bluestone are serialized into JSON. For key-value properties, both the key and the value are transferred as separate properties. For multi-select values, the default separator is `|`.

Properties that should be treated as localized text in Occtoo need to be configured. Two settings control localized properties:

* `LocalizedPropertiesProduct`
* `LocalizedPropertiesCategory`

Separate multiple properties with a comma. Specifying a property as localized means it receives the values for all configured contexts.

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/bluestone_attributes-66310f4ccabc5f64a60338bbb314c52d.png?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=fa82cc611230f13157a3eb5aefe8205d" alt="Bluestone attributes" width="1510" height="595" data-path="images/integrations/providers/bluestone_attributes-66310f4ccabc5f64a60338bbb314c52d.png" />

### Configure webhooks

The update flow requires two webhooks — one for updates and one for deletes.

#### Update webhook

The update webhook publishes all changes to products and categories. When you create it, select the **New sync done to public API** option and add the URL to the `DataSync` HTTP function.

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/add_webhook-2c19001667ed191c0d829eb99eaf7cc8.png?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=89bbe3784b094b9319bdcc5e4cec5a28" alt="Bluestone update webhook" width="1290" height="835" data-path="images/integrations/providers/add_webhook-2c19001667ed191c0d829eb99eaf7cc8.png" />

#### Delete webhook

The delete webhook removes products from Occtoo that have been archived in Bluestone. When you create it, select the **Change on product state in PIM** option.

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/delete_webhook-e6fae91485b2fbec55e73f7d9c3c3712.png?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=aceed35e3792b999b9d22c7f65c63d77" alt="Bluestone delete webhook" width="2077" height="1680" data-path="images/integrations/providers/delete_webhook-e6fae91485b2fbec55e73f7d9c3c3712.png" />

### Full synchronization

Two endpoints handle full synchronization — one for categories and one for products. Both accept GET and POST requests.

The category synchronization runs synchronously, fetching all categories and pushing them to the Occtoo onboarding API. The product synchronization iterates over all products and imports them asynchronously by placing them in a queue, which is then processed by a separate worker.

```bash theme={null}
# Categories full sync
GET https://[root-url]/CategoriesFullSync

# Products full sync
POST https://[root-url]/ProductFullSync
```

#### Storage account

The full export requires an Azure storage account. Configure it with the following settings:

* `StorageConnectionString` — the connection string for the storage account.
* `ProductQueue` — the name of the queue for the products.
* `ProductContainer` — the blob container used to persist the data.

<img src="https://mintcdn.com/occtoo/Rffi00S7HgnZZeFr/images/integrations/providers/full_export-c83d4663a5fbe319ed04a505cead190c.jpg?fit=max&auto=format&n=Rffi00S7HgnZZeFr&q=85&s=5219dd69b71865203c00bc36f42db57e" alt="Bluestone full synchronization" width="2050" height="487" data-path="images/integrations/providers/full_export-c83d4663a5fbe319ed04a505cead190c.jpg" />
