# Shopify > Brightpearl - product creation and update

## Introduction

The flow creates and updates products from Shopify to Brightpearl.

Multiple requests are made to Brightpearl to retrieve brands, options, option values, tax codes, and categories. This information is cached.

Next, new and updated products are retrieved from Shopify (a lookback period can be defined from a [flow variable](#flow-variables)). These are searched in Brightpearl, and a script determines whether new products or product updates are needed. New products flow down one branch, and updated products flow down another for final syncing to Brightpearl.

## Process flow snapshot

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FSUvxsp8XwrC9qsafJMIe%2Ficon%20process%20flow.svg?alt=media&#x26;token=ad1dc886-4a4e-4cad-9ad0-3d755e0f3b5a" alt="" data-size="line"> Click to view process flow snapshot</summary>

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FsTyG6m2TspgEMcneJLWW%2FShopify%20%3E%20Brightpearl%20-%20product%20creation%20and%20update%20-%20full%20flow.png?alt=media&#x26;token=382bd2e6-6bcf-49c3-905d-af946cb1161f" alt="" data-size="original">

</details>

## Limitations

<table><thead><tr><th width="316.98828125">Limitation</th><th>Summary</th></tr></thead><tbody><tr><td>High call volume</td><td>Given the way Brightpearl works, this flow requires a high number of calls. For this reason, we advise that it's run manually, as needed.  </td></tr><tr><td>Price updates only</td><td>By default, the 'update' branch updates pricing - no other fields ar changed. </td></tr></tbody></table>

## Assumptions

<table><thead><tr><th width="316.98828125">Assumption</th><th>Summary</th></tr></thead><tbody><tr><td>Shopify data</td><td>It is assumed that data in Shopify is correct and up to date at the time this process flow is run.</td></tr><tr><td>Shopify sales channel for Brightpearl products</td><td>This flow assumes that you have a Shopify sales channel for Brightpearl items, named Brightpearl. If you use a different sales channel, some flow adjustments will be needed. Please refer to <a href="#process-flow-shapes">Customisation ➤ Process flow shapes</a> for details.</td></tr><tr><td>Product matching</td><td>Product matches are determined by SKU. A product is deemed 'new' if no exact match is found between Shopify and Brightpearl <code>SKU</code> values.</td></tr></tbody></table>

## Customisation

To ensure that this process flow runs as required, some customisation options are available. These are documented in the following sections:

* [Flow variables](#flow-variables)
* [Process shape shapes](#process-flow-shapes)

### Flow variables

The table below summarises [flow variables](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables) defined for this process flow.

<table><thead><tr><th width="163.5078125">Flow variable</th><th>Summary</th><th>Default value</th></tr></thead><tbody><tr><td><code>updatedat</code></td><td>Set the relative number of days to look back for product updates. Update the default value as required.</td><td>-2 hours UTC</td></tr></tbody></table>

{% hint style="info" %}
For information on working with flow variables, please refer to our [flow variables documentation](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables).
{% endhint %}

### Process flow shapes

This process flow includes some shapes that can be configured with your own settings. Please see guidelines in the table below.

{% hint style="warning" %}
Shape settings determine the outcome of process flows. Do not change shape settings unless they are listed below.&#x20;
{% endhint %}

<table data-full-width="false"><thead><tr><th width="243.33984375">Shape</th><th>Notes</th></tr></thead><tbody><tr><td>Trigger</td><td>The default schedule for this flow is to run <code>every 2 hours</code>. This is the recommended run frequency, but the schedule can be changed if necessary.</td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance<br><code>Source endpoint</code> :  Set to <code>GET Get all tax codes</code></td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance<br><code>Source endpoint</code> :  Set to <code>GET Get all brands</code></td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance<br><code>Source endpoint</code> :  Set to <code>GET Get all product options</code> </td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance<br><code>Source endpoint</code> :  Set to <code>GET Get all product option values</code> </td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance<br><code>Source endpoint</code> :  Set to <code>GET Get all product types</code> </td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance<br><code>Source endpoint</code> :  Set to <code>GET Get all product categories</code> </td></tr><tr><td>Connector (Shopify)</td><td><p>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance</p><p><code>Source endpoint</code> :  Set to <code>POST Get new and updated products for Brightpearl</code><br><code>Update at</code> :  Set to <code>{{flow.variables.updatedat}}</code>  <br><br>Note: The <code>Update at</code> variable references the f<a href="#flow-variables">low variable value defined for your lookback period</a>.</p></td></tr><tr><td>Connector (Brightpearl)</td><td><p>If you did not add or select a Brightpearl instance during the blueprint <a href="../installation-guide-shopify-and-brightpearl">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance</p><p><code>Source endpoint</code> :  Set to <code>GET Get search products</code><br><code>Parameters</code> :  A default filter is defined to search (and match) on <code>SKU</code> values. If you are matching on a different field, this filter should be adjusted.</p></td></tr><tr><td>Map<br><br><code>Branch</code>: <code>Create new products</code></td><td>This flow assumes that you have a Shopify sales channel for Brightpearl items, named <code>Brightpearl</code>. If you use a different sales channel, the custom string transform function associated with the <code>salesChannelName</code> mapping rule should be adjusted:<br><br><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FgMTnR6H4SQffRdU1IUbr%2FShopify%20%3E%20Brightpearl%20-%20product%20creation%20and%20update%20-%20saleschanneltransform.png?alt=media&#x26;token=c858024b-80ea-4870-8934-a44ccd47b366" alt=""></td></tr></tbody></table>

## Reference

Reference information for this process flow is documented in the following sections:

* [Scripts used in this process flow](#scripts-in-this-process-flow)
* [Cross-reference lookups used in this process flow](#cross-reference-lookups-in-this-process-flow)

### Scripts in this process flow

<table><thead><tr><th width="293">Script</th><th>Summary</th></tr></thead><tbody><tr><td>Brightpearl - Determine new and updated products</td><td>Checks if a product is currently in Brightpearl or requires updating.</td></tr><tr><td>Append price lists to the products for new products</td><td>Takes prices from Shopify and appends the relevant price to the correlating price break.</td></tr></tbody></table>

### Cross-reference lookups in this process flow

This process flow does not use cross-reference lookups.
