# Brightpearl

URL: https://docs.sparklayer.io/help/integrations/erps/brightpearl
Applies to: Shopify

Connect Brightpearl to SparkLayer on Shopify to sync B2B customers and price lists from Brightpearl, and map Brightpearl contact tags to customer groups.

> **Quick summary**
>
> - The Brightpearl integration makes Brightpearl the source of truth for your B2B customers and prices. SparkLayer imports tagged contacts and price lists from Brightpearl into Shopify and SparkLayer.
> - Data syncs one way, from Brightpearl, every 3 hours. Changes made in Shopify don't go back to Brightpearl. Orders reach Brightpearl through your existing Brightpearl–Shopify integration, at your B2B prices.
> - Connect it in the SparkLayer Dashboard at **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app, under **Multi-channel management**, with your Brightpearl account ID.
> - Needs the Pro or Enterprise plan, a Shopify store and an approved Brightpearl account.

## What it does

[Brightpearl](https://www.brightpearl.com/) is a multi-channel platform for running eCommerce operations, from inventory and stock to order management and fulfilment.

SparkLayer has a direct integration with Brightpearl. You manage your B2B customers and prices in Brightpearl, and SparkLayer brings them into Shopify and SparkLayer, so you don't need to upload them by hand.

How data flows between Brightpearl, SparkLayer and Shopify:

1. **Brightpearl**: Contacts with your SparkLayer tag, and non-cost price lists
2. **SparkLayer**: Imports customers and price lists every 3 hours
3. **Shopify**: Customer records and metafields; B2B prices on the storefront
4. **Brightpearl**: Orders arrive through your existing Brightpearl integration

## What syncs and in which direction

Customers and prices sync one way, from Brightpearl. Orders go back to Brightpearl through your own Brightpearl integration, not through SparkLayer.

| Data | Direction | Details |
| --- | --- | --- |
| Customers | Brightpearl to Shopify and SparkLayer | Brightpearl is the master of your B2B customer data. Changes to tagged contacts sync to Shopify and SparkLayer automatically. |
| Prices | Brightpearl to SparkLayer | Price lists and product prices come from the pricing you set up in Brightpearl. |
| Orders | Shopify to Brightpearl | Orders placed through SparkLayer reach Brightpearl through your **existing** Brightpearl integration, with your B2B prices. |

### Customer data

Customers are matched between Brightpearl and Shopify by the **primary email** in Brightpearl. SparkLayer then syncs this data into Shopify. Some details are stored in Shopify [metafields](https://docs.sparklayer.io/help/glossary.md#metafields): extra fields on the Shopify customer record that SparkLayer reads. The integration fills them in for you.

| Brightpearl | Shopify and SparkLayer |
| --- | --- |
| Address | Customer record in Shopify |
| Receive email newsletters | Customer record in Shopify |
| Primary telephone | Customer record in Shopify |
| First and last name | Customer record in Shopify |
| Title | Shopify metafield (`sparklayer.title`) |
| Company name | Shopify metafield (`sparklayer.company_name`) |
| Customer tag (see [Set up customers in Brightpearl](#set-up-customers-in-brightpearl)) | Shopify metafield (`sparklayer.group`), matched to a customer group |
| Credit limit and balance on account | Shopify metafield (`sparklayer.payment_on_account`), for example `{"credit_limit":1000,"balance":735}` |
| Price list | Shopify metafield |
| Customer custom field `SL_SAGTS` | Shopify metafield, matched to SparkLayer sales agent groups. Must be comma-separated. |

All customer data is managed in Brightpearl. Changes made directly in Shopify don't sync back to Brightpearl.

### Price lists

SparkLayer imports each new non-cost price list automatically and creates a matching price list in **Pricing > Price lists** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/pricing/lists)), or **SparkLayer Wholesale > Pricing > Price lists** in the Shopify app:

| Field in SparkLayer | Field in Brightpearl |
| --- | --- |
| Handle / ID | Price list code |
| Name | Price list |
| Currency | Currency |

Prices are matched according to whether the Brightpearl price list is set up as gross or net.

### New customers

New B2B contacts created in Brightpearl are added to Shopify **automatically**, as **Pending** accounts. Shopify sends them an **Activate your account** email so they can set a password.

This email is Shopify's **Customer account invite** notification. You can edit it in **Settings > Notifications** ([open in the Shopify admin](https://admin.shopify.com/settings/notifications/customer)) in the Shopify admin.

## Set up Brightpearl

Check the requirements, connect Brightpearl, then tag your B2B customers and create their price lists in Brightpearl.

### Requirements

- **The Pro or Enterprise plan.** See [Plans and features](https://docs.sparklayer.io/help/plans-and-features.md).
- **A Shopify store** connected to SparkLayer. See [Shopify](https://docs.sparklayer.io/help/platforms/shopify.md).
- **An approved Brightpearl account.** See the [Brightpearl website](http://brightpearl.com/).

### Connect Brightpearl

1. In the SparkLayer Dashboard, go to **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app.
2. Under **Multi-channel management**, turn on the switch next to **Brightpearl**.
3. Enter your **Brightpearl account ID**. You'll find it in your Brightpearl admin.
4. Authorise SparkLayer to access your Brightpearl account.

Once you're connected, open Brightpearl at **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app to set up the integration. It shows which Brightpearl account you're connected to.

| Setting | What it does |
| --- | --- |
| **Tagged customers to synchronise** | The Brightpearl contact tag whose contacts SparkLayer imports, for example `SparkLayer UK`. See [Set up customers in Brightpearl](#set-up-customers-in-brightpearl). |
| **Tax codes to set as exempt** | Brightpearl tax codes, for example `T0`, for customers who should be tax exempt. |

### Set up customers in Brightpearl

Brightpearl uses **contact tags** to decide which contacts are B2B customers and which [customer group](https://docs.sparklayer.io/help/customers/customer-groups.md) they belong to.

1. In Brightpearl, go to **Settings > Contacts > Tags**.
2. Create a tag for your B2B customers, for example `SparkLayer UK` for a single UK customer group.
3. In SparkLayer, enter the same tag name in **Tagged customers to synchronise** (see [Connect Brightpearl](#connect-brightpearl)) and click **Save**.
4. Add the tag to the Brightpearl contacts you want to import.

You can then set rules for the group, such as minimum orders and price lists, in **Customers > Groups** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/groups)), or **SparkLayer Wholesale > Customers > Customer groups** in the Shopify app.

#### Add customer sub-groups

To give some B2B customers different rules, such as a VIP group with special prices, create sub-groups:

1. In Brightpearl, create a tag that starts with your main tag, then a dash and the sub-group name. For example, `SparkLayer UK - VIP`.
2. In SparkLayer, go to **Customers > Groups** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/groups)), or **SparkLayer Wholesale > Customers > Customer groups** in the Shopify app and create a customer group named after the part that follows the dash, for example `VIP`.

Contacts with the sub-group tag are then placed in that customer group.

### Set up B2B prices in Brightpearl

1. In Brightpearl, go to **Settings > Products/Inventory > Price lists**.
2. Click **Add new price list** and complete the details. Make sure it isn't a cost price list: only non-cost price lists sync.
3. Open a product in Brightpearl. A tab for each price list now appears on the product's **Prices** tab.
4. Enter the prices, including any price breaks (for example, 1+ at £15.00 and 5+ at £10.00).

SparkLayer imports the new price list automatically. See [Price lists](#price-lists) for how its fields map.

## Limitations

- Shopify doesn't support separate addresses, so the default address in Brightpearl is used as both the shipping and billing address in Shopify.
- If you remove a customer from the customer group, also remove their `b2b` tag from their customer account in Shopify.
- Addresses sync one way, from Brightpearl into Shopify. Don't let customers edit addresses in SparkLayer, or new addresses won't reach Brightpearl.
- Customer sync errors are sent by email. 

## Troubleshooting

**A Brightpearl contact isn't appearing in Shopify**

Check the contact has the tag you entered in **Tagged customers to synchronise**, exactly as written, and has a primary email address. Sync errors are reported by email.

**A customer is in the wrong customer group**

Check the contact's tag. For a sub-group, the part of the tag after the dash must match the name of a customer group in **Customers > Groups** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/groups)), or **SparkLayer Wholesale > Customers > Customer groups** in the Shopify app.

**A price list isn't showing in SparkLayer**

Only non-cost price lists sync. Check the price list in Brightpearl isn't set as a cost price list.

**I changed a customer in Shopify and Brightpearl hasn't updated**

Customer data only syncs from Brightpearl to Shopify. Make the change in Brightpearl instead.
