# Product and customer sync

URL: https://docs.sparklayer.io/help/integrations/data-sync

Check your products are syncing to SparkLayer in Product sync, look up a product's data, and find and fix customer sync errors on the Customers screen.

> **Quick summary**
>
> - SparkLayer keeps a copy of your products and B2B customers from your eCommerce platform, updated when you change them there. Only customers tagged `b2b` are imported, or customers your developer sends with SparkLayer [metafields](https://docs.sparklayer.io/help/glossary.md#metafields).
> - **Product sync** shows whether your products are up to date and lets you look one up: **Integrations > Product sync** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/integrations/products-sync)), or **SparkLayer Wholesale > Integrations > Product sync** in the Shopify app. Click **Sync products now** to sync straight away.
> - Customer sync problems show as a banner on **Customers** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/list)), or **SparkLayer Wholesale > Customers** in the Shopify app, with **Show errors** to see which customers need fixing. Your Home briefing flags them too.
> - To check a customer's data, open them in **Customers** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/list)), or **SparkLayer Wholesale > Customers** in the Shopify app.

## How sync works

Once your platform is connected (see [Managing integrations](https://docs.sparklayer.io/help/integrations/managing-integrations.md)), SparkLayer keeps two feeds from your store:

- **Product sync** tells SparkLayer which products and variants exist, so it knows which B2B prices to show when a signed-in B2B customer views a product.
- **Customer sync** tells SparkLayer who your B2B customers are, so it recognises them when they sign in and shows them the right B2B pricing and rules.

How product and customer data reaches your B2B customers:

1. **Your store**: Products, and customers tagged b2b
2. **Sync**: SparkLayer imports both feeds
3. **Price lists and customer groups**: Matched to products and customers
4. **Storefront**: Signed-in B2B customers see their prices

Each feed has a **full sync**, which copies everything, and **partial syncs**, which copy what's changed since. SparkLayer syncs every product in your store by default. A product can't be bought by B2B customers until it has a price: see [Pricing](https://docs.sparklayer.io/help/pricing.md).

## Check your products are syncing

Go to **Integrations > Product sync** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/integrations/products-sync)), or **SparkLayer Wholesale > Integrations > Product sync** in the Shopify app. When everything is working, the banner at the top reads **Products are up to date**. It shows how many products synced from Shopify, and the times of the last full and partial sync.

SparkLayer refreshes products every 10 minutes. To catch up sooner after you change products, click **Sync products now**. It usually takes a few minutes.

## Look up a product's data

**Product data lookup** shows what SparkLayer has for a product, to diagnose a price or stock question.

1. Go to **Integrations > Product sync** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/integrations/products-sync)), or **SparkLayer Wholesale > Integrations > Product sync** in the Shopify app.
2. In **Product data lookup**, search by name, SKU, barcode or ID.
3. Check the results. Each shows the **Product**, its **SKU**, its **Retail price** and whether it's **Up to date**.

| Search by | Example or where to find it |
| --- | --- |
| **SKU** | The stock keeping unit of a variant. A product with three variants might have the SKUs `ABC-1`, `ABC-2` and `ABC-3`. |
| **ID** | The product's ID on your platform. On Shopify, open the product in the admin: the ID is the number at the end of the URL. In `https://your-shopify-store-url.com/admin/products/7356521840875` the ID is `7356521840875`. |
| **Name** | All or part of the product name. |
| **Barcode** | The barcode, if the product has one. |

If nothing comes back, it says **No products found**: try the SKU, or a different name. If a product still isn't there, see [Troubleshooting](https://docs.sparklayer.io/help/troubleshooting.md#the-product-data-sync-says-this-product-cannot-be-found).

**Stock states**

SparkLayer also holds each variant's stock. 

| Stock state | What it means |
| --- | --- |
| **Stock data found** | Stock information exists for this variant, for each location. |
| **Stock data not found** | SparkLayer has no stock data for this variant. Variants without stock data can't be bought. |
| **Stock not being tracked** | Inventory tracking is turned off for this variant on your platform, so there's no stock information. The variant can still be bought. |

## Check your customers are syncing

SparkLayer imports only customers tagged `b2b`, or customers your developer has sent with [metafields](https://docs.sparklayer.io/help/glossary.md#metafields) in the `sparklayer` namespace. That way, you control which customers are imported. On Shopify, see [Assign customers to a customer group](https://docs.sparklayer.io/help/customers/add-customers-to-a-group.md#assign-customers-to-a-customer-group) and [Shopify metafields](https://docs.sparklayer.io/help/platforms/shopify/metafields.md).

To check a customer has synced, find them in **Customers** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/list)), or **SparkLayer Wholesale > Customers** in the Shopify app and open them. Their page shows what SparkLayer holds: their details, customer group, company and addresses. See [Find and manage customers](https://docs.sparklayer.io/help/customers/managing-customers.md).

### Fix customer sync errors

When some customers didn't sync, **Customers** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/list)), or **SparkLayer Wholesale > Customers** in the Shopify app shows a banner such as **Customers sync completed with 3 errors**, with the times of the last full and partial sync.

1. Click **Show errors**. **Customer sync errors** lists each customer's name, email and the problem, such as "Missing a default shipping address".
2. Click **Open customers in Shopify** and fix each customer there.
3. Wait for the next partial sync. Fixed customers sync then.

From your first week, Home's [briefing](https://docs.sparklayer.io/help/dashboard.md#home) also tells you when customers didn't sync, with **Show errors**. Common errors and fixes are in [Troubleshooting](https://docs.sparklayer.io/help/troubleshooting.md#the-customer-data-sync-shows-errors).

If a customer or their address won't sync, these are the 2 most common causes:

| Cause | Fix |
| --- | --- |
| **An incomplete address**, often a secondary (second) address in the customer's address book | Complete the address in Shopify, with a country, first line, city and postcode or ZIP code, or delete it. Every address must be complete, not only the default one. |
| **The sales agent groups metafield isn't limited to preset choices** (Shopify) | Turn on **Limit to preset choices** on the metafield's definition, with each sales agent group as a choice. See [Set up the sales agent groups metafield](https://docs.sparklayer.io/help/platforms/shopify/metafields.md#set-up-the-sales-agent-groups-metafield). |

**Re-running the customer sync**

You don't need to start a customer sync yourself: it runs automatically. If you think it's stuck, [contact support](https://docs.sparklayer.io/help/support.md). Our team can run **Sync customers now** for you from SparkLayer's staff-only tools.

## Troubleshooting

**The banner shows errors, or no products are syncing**

For product sync, check the products have a SKU on every variant and are **Active**. For customer sync, click **Show errors** on **Customers** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/list)), or **SparkLayer Wholesale > Customers** in the Shopify app. For common causes and fixes, see [Troubleshooting](https://docs.sparklayer.io/help/troubleshooting.md#data-sync). If you can't resolve it, [contact support](https://docs.sparklayer.io/help/support.md).

**A product can't be added to the cart**

Look the product up in **Product data lookup**. Also check the product has a price in one of the customer's [price lists](https://docs.sparklayer.io/help/pricing.md).

**A customer isn't recognised when they sign in**

Find them in **Customers** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/list)), or **SparkLayer Wholesale > Customers** in the Shopify app. If they aren't there, check they're tagged `b2b` on your platform (or, if your developer set them up that way, have `sparklayer` metafields), then check **Show errors** for a sync problem.

**I've changed products on my platform but SparkLayer hasn't updated**

Products refresh every 10 minutes. To update them sooner, click **Sync products now** in **Integrations > Product sync** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/integrations/products-sync)), or **SparkLayer Wholesale > Integrations > Product sync** in the Shopify app.
