# Cin7 Core

URL: https://docs.sparklayer.io/help/integrations/erps/cin7-core
Applies to: Shopify

Connect Cin7 Core to SparkLayer on Shopify to sync B2B customers, contacts and sell price tiers, set sync tags and tax-exempt codes, and fix sync issues.

> **Quick summary**
>
> - The Cin7 Core integration makes Cin7 Core the source of truth for your B2B customers and prices. SparkLayer imports tagged customers, their contacts and their price tiers into Shopify and SparkLayer.
> - Data syncs one way, from Cin7 Core, every hour. Orders reach Cin7 Core through your existing Cin7 integration.
> - 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 Cin7 Core account ID and API key.
> - Needs the Pro or Enterprise plan, a Shopify store and an approved Cin7 Core account.

## What it does

[Cin7 Core](https://www.cin7.com/solutions/core/) is an inventory management system for retailers, wholesalers and manufacturers, covering inventory, stock control, order management and fulfilment.

SparkLayer has a direct integration with Cin7 Core. You manage your B2B customers and prices in Cin7 Core, and SparkLayer brings them into Shopify and SparkLayer, with a price list for each price tier.

How data flows between Cin7 Core, SparkLayer and Shopify:

1. **Cin7 Core**: Customers with your sync tags, their contacts, sell price tiers and customer prices
2. **SparkLayer**: Imports them every hour and creates price lists
3. **Shopify**: A customer account per contact, with SparkLayer metafields
4. **Cin7 Core**: Orders arrive through your existing Cin7 integration

Read the [limitations](#known-limitations) before you start.

## What syncs and in which direction

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

| Data | Direction | Details |
| --- | --- | --- |
| Customers | Cin7 Core to Shopify and SparkLayer | Cin7 Core is the master of your B2B customer data. Changes to customers with your sync tags reach Shopify and SparkLayer automatically. SparkLayer creates a Shopify customer for every contact of each customer it syncs: the customer's **Default** contact becomes the main account, and its other contacts become [company users](https://docs.sparklayer.io/help/customers/company-users.md) under it. |
| Prices | Cin7 Core to SparkLayer | Price lists and product prices come from the pricing you set up in Cin7 Core. |
| Orders | Shopify to Cin7 Core | Orders placed through SparkLayer reach Cin7 Core through your [existing Cin7 integration](https://help.core.cin7.com/hc/en-us/articles/9034589848335-Shopify-Integration), with your B2B prices. |

### Customer data

Customers are matched between Cin7 Core and Shopify by the **contact email** in Cin7 Core. SparkLayer 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.

| Cin7 Core | Shopify and SparkLayer |
| --- | --- |
| First and last name | Customer record in Shopify |
| Email and phone number | Customer record in Shopify |
| Addresses | Customer record in Shopify |
| Tax rule (using **Tax-Exempt Codes**) | Tax exemption on the customer record in Shopify |
| Tags | SparkLayer customer group, in a Shopify metafield called "Group". Only **Additional Customer Tags** appear as tags on the Shopify customer. |
| Company name | Shopify metafield called "Company" |
| Discount | Shopify metafield called "Discount Percentage" |
| Credit limit and on hold | Shopify metafield called "Payment On Account" |
| Sale price tier and customer-specific prices | Shopify metafield, so the customer sees the right prices (see [Price lists](#price-lists)) |

All customer data is managed in Cin7 Core. Changes made directly in Shopify don't sync back, and are overwritten at the next sync.

### Price lists

SparkLayer creates several kinds of price list from your Cin7 Core prices. They appear 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 as **Integration** price lists.

| Price list | When it's created |
| --- | --- |
| Sell price tier | One for each sell price tier you use. |
| Customer-specific | One for each customer with prices on their **Product prices** tab. |
| Alternative currency | When a customer uses a currency other than your base currency. For example, if your store is in GBP and you assign a customer USD, SparkLayer creates a USD copy of the tier ("Dear Tier Price 1 USD"), converting the GBP prices at the live exchange rate. |
| Prefixed | Generic price lists applied to every customer, so a basic sell price tier is always in place even if the customer's Cin7 Core setup doesn't assign one. |

When a customer views a product, SparkLayer checks their Cin7 Core price lists in this order and uses the first price it finds:

1. The customer-specific price list, if there is one.
2. The customer's sell price tier.

Customers with other currencies or discounts get extra price lists. As with any price lists, the first one with the product's SKU wins: see [Price list order](https://docs.sparklayer.io/help/pricing/managing-pricing.md#price-list-order).

**Where the price list order is stored, for your developer**

Each customer's price lists are listed in order in a Shopify customer metafield called **Price List - Cin7**, for example `["dear-cust-…", "dear-tier-1-eur"]`. See [Metafields](https://docs.sparklayer.io/developers/data/metafields.md) for how the price list metafield works.

### Invite new customers

New customers created in Cin7 Core are added to Shopify **automatically**, as **Pending** accounts. If **Send customers an invite email when activated in Cin7 Core** is ticked, 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. To stop sending it, untick the setting in **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app (click **Modify** next to Cin7 Core).

## Set up Cin7 Core

Check the requirements, connect Cin7 Core, then set up your customers and price tiers in Cin7 Core.

### 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 Cin7 Core account.** See the [Cin7 website](https://www.cin7.com/solutions/core/).

### Connect Cin7 Core

1. In **Customers > Groups** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/customers/groups)), or **SparkLayer Wholesale > Customers > Customer groups** in the Shopify app, create the [customer groups](https://docs.sparklayer.io/help/customers/customer-groups.md) you want to use. To test, start with a new group and a dummy customer.
2. 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.
3. Under **Multi-channel management**, turn on the switch next to **Cin7 Core**.
4. Fill in the settings below, then click **Save**.

To change the settings later, open Cin7 Core at **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app.

| Setting | What it does |
| --- | --- |
| **Account ID** | The unique identifier for your Cin7 Core account. You'll find it in Cin7 Core under **Integration > API**. |
| **API Key** | Your Cin7 Core API key: a code from Cin7 Core that lets SparkLayer read your data. Find it under **Integration > API**. It isn't shown again after saving. |
| **Customer Sync Tags** | Only Cin7 Core customers with one of these tags are imported to Shopify. Each tag must match a SparkLayer customer group exactly. Separate tags with a comma and no spaces, for example `base,gold`. |
| **Additional Customer Tags** | If an imported customer has any of these tags in Cin7 Core, they get the same tags in Shopify, prefixed with `spark-`. They must be valid Shopify tags and mustn't clash with your SparkLayer customer groups. Shopify only: ignored on other platforms. |
| **Tax-Exempt Codes** | Cin7 Core tax rules that should make a customer tax exempt in Shopify, for example `TAXFREE`. |
| **Send customers an invite email when activated in Cin7 Core** | Sends new customers Shopify's account invite email, asking them to confirm their account. See [Invite new customers](#invite-new-customers). |
| **Ignore Non-Default Contacts** | When ticked, only each customer's **Default** contact syncs to SparkLayer. |

### Set up customers in Cin7 Core

1. In Cin7 Core, go to **Sale > Customer** and open or create the customer.
2. On the **General** tab, fill in:
   - **Name** (first and last name are required)
   - **Currency**
   - **Sale price tier**
   - **Tax rule**. To make the customer tax exempt in Shopify, choose a rule you've listed in **Tax-Exempt Codes**.
   - **Tags**: add the tag for the customer's SparkLayer customer group, for example `base` or `gold`.
3. On the **Addresses** tab, add a full address.
4. On the **Contacts** tab, add each contact with a first and last name and a valid email address. Tick **Default** for the main contact.
5. Check the tag is listed in **Customer Sync Tags** in SparkLayer.

The customer is imported at the next sync. You don't need to tag the customer with the customer group in Shopify: SparkLayer adds the group as a metafield. If a customer has several contacts, the **Default** contact becomes the main account and the others become company users under it.

### Set up B2B prices in Cin7 Core

Cin7 Core has **up to 10 price tiers**, so you can give different customer levels different prices. You can also set customer-specific prices on top.

1. To rename the tiers, go to **Settings > General Settings > Sell Price Tier Names** in Cin7 Core. SparkLayer doesn't use the custom names: tiers always appear in SparkLayer as "Sell Price Tier 1" to "Sell Price Tier 10".
2. Open a product and go to the **Prices** tab. Enter the price for each tier you use.
3. Open the customer and choose their **Sale price tier** on the **General** tab. This is the price list they see when they sign in.

#### Set customer-specific prices

1. In Cin7 Core, open the customer and go to **Product prices**.
2. Search for a product and enter a fixed **Custom price**.

SparkLayer creates a customer-specific price list for these prices 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.

## Limitations

- SparkLayer uses the internal sell price tier names, not the custom names you can set in Cin7 Core settings.
- Changing a customer's email address creates another customer in Shopify. Disable the old account manually.
- If you change a customer's **Default** contact in Cin7 Core, manually disable the Shopify account for the old default contact.
- Removing the tag from a customer doesn't disable them in Shopify.
- Shopify doesn't support separate addresses, so the default address in Cin7 Core is used as both the shipping and billing address in Shopify.
- Addresses sync one way, from Cin7 Core into Shopify. Don't let customers edit addresses in SparkLayer: new addresses won't reach Cin7 Core and are replaced at the next sync.

## Troubleshooting

**My customers aren't appearing in Shopify**

Check that:

- **The customer has the right tag** in Cin7 Core, matching a SparkLayer customer group name, and the tag is in **Customer Sync Tags**.
- **The tag format is right**: tags separated by commas with no spaces, for example `base,gold`.
- **The customer has a Default contact** with a valid email address.

**Customer account invites aren't being sent**

Shopify sends the **Customer account invite** email when a new customer is created. Check **Send customers an invite email when activated in Cin7 Core** is ticked in the Cin7 Core settings in **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app.

**Customer-specific prices aren't showing**

- After changing prices, wait for the next sync to finish. Syncs run every hour.
- Check the Shopify customer has the **Price List - Cin7** metafield with the right price lists.

**Changes made in Shopify aren't reflected in Cin7 Core**

The integration is one way, from Cin7 Core to Shopify, so always make changes in Cin7 Core. Changes made directly in Shopify are overwritten at the next sync.

**Product prices look wrong for a customer**

Check that:

- **The customer's price tier** (**Sale price tier**) or customer-specific prices are right in Cin7 Core.
- **The tier prices** in Cin7 Core have the values you expect for those products.
- **No old price lists or tags** are still linked to the customer in SparkLayer.

**Duplicate customers appear in Shopify**

Changing a customer's email address, or their **Default** contact, in Cin7 Core creates a new Shopify customer. Disable the old account manually.
