> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/shopify-and-brightpearl/available-process-flows-shopify-and-brightpearl/shopify-greater-than-brightpearl-sync-locations.md).

# Shopify > Brightpearl - sync locations

## Introduction

The `Shopify > Brightpearl - sync locations` flow retrieves all locations from Shopify and then all locations from Brightpearl. A script determines if a location (i.e. warehouse) exists in Brightpearl - if no, a new warehouse is created and if yes, the existing warehouse is updated.

{% hint style="info" %}
This blueprint includes two process flows to handle the sync of locations between Shopify and Brightpearl: Shopify > Brightpearl (detailed here) and [Brightpearl > Shopify](/product-documentation/blueprints/patchworks-blueprints/shopify-and-brightpearl/available-process-flows-shopify-and-brightpearl/brightpearl-greater-than-shopify-sync-locations.md). You only need to run ONE, depending on which way you want the sync to work.
{% endhint %}

## Process flow snapshot

<details>

<summary><img src="/files/y1IE71BfODU6ZRj1HNMM" alt="" data-size="line"> Click to view process flow snapshot</summary>

<figure><img src="/files/fBNzHjmGgO8vlWnk2FsQ" alt=""><figcaption></figcaption></figure>

</details>

## Limitations

<table><thead><tr><th width="266.79296875">Limitation</th><th>Summary</th></tr></thead><tbody><tr><td>All locations/warehouses are synced</td><td>There is no option to limit which locations/warehouses are synced.</td></tr></tbody></table>

## Assumptions

<table><thead><tr><th width="266.79296875">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>Sync direction</td><td>Running this flow assumes that you want to sync prices in this direction (i.e. from Shopify > Brightpearl). If required, a flow for the reverse direction is<a href="/pages/oSS9Hc95Izm25ZlTd4WB"> </a>available (<a href="/pages/GaPOSwXs0nNdg0lByBGn">Brightpearl > Shopify - sync locations</a>). You should run one or the other.</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

This process flow does not use flow variables.

### 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.
{% endhint %}

<table data-full-width="false"><thead><tr><th width="190.171875">Shape</th><th>Notes</th></tr></thead><tbody><tr><td>Trigger</td><td>No default schedule is set for this flow. If you decide to sync locations in this direction (rather than from <a href="/pages/GaPOSwXs0nNdg0lByBGn">Brightpearl to Shopify</a>), you may wish to add your own schedule.</td></tr><tr><td>Connector (Shopify)</td><td>If you did not add or select a Shopify instance during the blueprint <a href="/pages/ZuNUyYvEy14sajACk8N9">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> : Set to <code>POST Get all locations via graphql</code></td></tr><tr><td>Connector (Brightpearl)</td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">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 warehouses</code><br><code>Updated at</code> : Set to <code>{{flow.variables.updatedat}}</code><br><br><code>Updated at</code> references a <a href="#flow-variables">flow variable value</a>, defined in process flow settings.</td></tr><tr><td>Script</td><td>The <code>Shopify to BP - Determine new and updated locations</code> script can be updated if additional location details are required.</td></tr><tr><td>Branch</td><td>Two branches are defined - one creates new locations and the other updates existing locations. If you do not wish to update locations, this branch can be <a href="/pages/SbKROjSHiyQePT2FZUN7#deleting-a-branch">removed</a>.</td></tr><tr><td>Connector (Brightpearl)<br><code>Branch</code>: <code>New location</code></td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">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>POST Create new locations</code></td></tr><tr><td>Connector (Brightpearl)<br><code>Branch</code>: <code>New location</code></td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">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>POST Create new warehouses</code></td></tr><tr><td>Connector (Brightpearl)<br><code>Branch</code>: <code>Update location</code></td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">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>POST Update warehouse addresses</code></td></tr><tr><td>Connector (Brightpearl)<br><code>Branch</code>: <code>Update location</code></td><td>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">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>POST Update warehouse addresses</code></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>BP to Shopify - Determine new and updated locations</td><td>Compares Brightpearl warehouses with Shopify locations, then creates or updates Shopify locations as needed.</td></tr></tbody></table>

### Cross-reference lookups in this process flow

This process flow does not use cross-reference lookups.
