# Brightpearl > Shopify - sync locations

## Introduction

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

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

## 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>

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FT8ogYfvRSaVHZZ0HFpgL%2FBrightpearl%20%3E%20Shopify%20-%20sync%20locations%20-%20full%20flow.png?alt=media&#x26;token=349fc798-42b1-4a8a-a375-410bafd14b8f" alt=""><figcaption></figcaption></figure>

</details>

## Limitations

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

## Assumptions

<table><thead><tr><th width="266.79296875">Assumption</th><th>Summary</th></tr></thead><tbody><tr><td>Brightpearl data</td><td>It is assumed that data in Brightpearl 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 Brightpearl to Shopify). If required, a flow for the reverse direction is<a href="shopify-greater-than-brightpearl-fulfillment"> </a>available (<a href="shopify-greater-than-brightpearl-sync-locations">Shopify > Brightpearl - 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.&#x20;
{% endhint %}

<table data-full-width="false"><thead><tr><th width="220.09375">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="shopify-greater-than-brightpearl-sync-locations">Shopify to Brightpearl</a>), you may wish to add your own schedule. </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 warehouses</code></td></tr><tr><td>Connector (Shopify)</td><td>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.<br><code>Source endpoint</code> :  Set to <code>POST Get all locations via graphql</code></td></tr><tr><td>Script</td><td>The <code>BP to Shopify - 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 - <code>new location</code> creates new locations and <code>update location</code> updates existing locations. If you do not wish to update locations, this branch can be <a href="../../../../../process-flows/building-process-flows/process-flow-shapes/standard-shapes/branch-shape#deleting-a-branch">removed</a>. </td></tr><tr><td>Connector (Shopify)<br>branch: <code>new location</code></td><td>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.<br><code>Source endpoint</code> :  Set to <code>POST Add locations via graphql</code></td></tr><tr><td>Connector (Shopify)<br>branch: <code>update location</code></td><td>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.<br><code>Source endpoint</code> :  Set to <code>POST Update locations via graphql</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.
