# Unleashed

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

Connect Unleashed to SparkLayer on Shopify to sync customers by customer type, with sell price tiers, customer pricing and discounts, and fix sync issues.

> **Quick summary**
>
> - The Unleashed integration makes Unleashed the source of truth for your B2B customers and prices. SparkLayer imports customers of the customer types you choose, with their sell price tiers, customer pricing and discounts.
> - Data syncs one way, from Unleashed, every 4 hours. Orders reach Unleashed through your existing Unleashed 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 Unleashed API ID and API key.
> - Needs the Pro or Enterprise plan, a Shopify store and an approved Unleashed account. 2 settings in your Unleashed–Shopify integration must change first.

## What it does

[Unleashed](https://www.unleashedsoftware.com/) is an inventory management system for manufacturers, wholesalers and distributors, covering inventory, stock, order management and fulfilment.

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

How data flows between Unleashed, SparkLayer and Shopify:

1. **Unleashed**: Customers of your chosen customer types, sell price tiers and customer pricing
2. **SparkLayer**: Imports them every 4 hours and creates price lists
3. **Shopify**: Customer records and metafields; B2B prices on the storefront
4. **Unleashed**: Orders arrive through your existing Unleashed integration

Before you start, check the [requirements](#requirements): 2 settings in your Unleashed–Shopify integration need to change. Read the [limitations](#known-limitations) too.

## What syncs and in which direction

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

| Data | Direction | Details |
| --- | --- | --- |
| Customers | Unleashed to Shopify and SparkLayer | Unleashed is the master of your B2B customer data. Changes to customers with one of your chosen customer types reach Shopify and SparkLayer automatically. |
| Prices | Unleashed to SparkLayer | Price lists and product prices come from the pricing you set up in Unleashed. |
| Orders | Shopify to Unleashed | Orders placed through SparkLayer reach Unleashed through your **existing** [Unleashed integration](https://support.unleashedsoftware.com/hc/en-us/articles/4402425783577-Shopify-Integration-Introduction), with your B2B prices. |

### Customer data

Customers are matched between Unleashed and Shopify by the **primary contact email** in Unleashed. SparkLayer syncs this data into Shopify, where you can see it on the customer record. 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.

| Unleashed | Shopify and SparkLayer |
| --- | --- |
| Address | Customer record in Shopify |
| Phone | Customer record in Shopify |
| First and last name | Customer record in Shopify |
| Company name | Shopify metafield |
| Stop Credit | Shopify metafield, used to allow payment on account |
| Taxable | Customer record in Shopify |

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

### Price lists

SparkLayer creates several kinds of price list from your Unleashed 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 |
| --- | --- |
| Default | Always. Holds every product's **Default Sell Price** from the product's **Sale** tab, as the baseline price. |
| Sell price tier | One for each sell price tier you use. |
| Customer-specific | One for each customer with prices on their **Customer Pricing** tab. |
| Discounted | When a customer has a **Discount (%)**, for example 10% off all products. |
| Alternative currency | When a customer uses a currency other than your base currency. |
| Prefixed | Generic price lists applied to every customer, so a basic sell price tier is always in place even if the customer's Unleashed setup doesn't assign one. |

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

1. The customer's product-specific prices from **Customer Pricing**.
2. Their percentage discount on top of their price tier.
3. Their sell price tier.
4. The **Default Sell Price**, as a fallback.

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 - Unleashed**, for example `["Customer-Test001", "SellPriceTier3-30", "SellPriceTier3", "DefaultSellPrice"]`. See [Metafields](https://docs.sparklayer.io/developers/data/metafields.md) for how the price list metafield works.

### Invite new customers

New customers created in Unleashed are added to Shopify **automatically**, as **Pending** accounts. If **Send customers an invite email when activated in Unleashed** 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 Unleashed).

## Set up Unleashed

Check the requirements, connect Unleashed, then set up your customers and prices in Unleashed.

### 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 Unleashed account.** See the [Unleashed website](https://www.unleashedsoftware.com/).
- **Customer synchronisation turned off** in your Unleashed–Shopify integration, so SparkLayer is the only thing creating B2B customers in Shopify.
- **Order Import Options not set to import orders to a single customer**, in your Unleashed order configuration. If you need that, use a second store for B2B.

### Connect Unleashed

1. In Unleashed, go to **Settings > System > Customer Types**. Add a customer type for each group of customers you'll give different prices, for example `Base` and `Gold`.
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](https://docs.sparklayer.io/help/customers/customer-groups.md) for each customer type, with a name that matches exactly. To test, start with a new group and a dummy customer before you use an existing group.
3. 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.
4. Under **Multi-channel management**, turn on the switch next to **Unleashed**.
5. Fill in the settings below, then click **Save**.

To change the settings later, open Unleashed 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 |
| --- | --- |
| **API ID** | The unique identifier for your Unleashed account. You'll find it in Unleashed under **Integration > Unleashed API Access**. |
| **API Key** | Your Unleashed API key: a code from Unleashed that lets SparkLayer read your data. Find it under **Integration > Unleashed API Access**. It isn't shown again after saving. |
| **Customer Types** | The Unleashed customer types to sync to Shopify. Each must match a customer type in Unleashed exactly. Separate them with a comma and no spaces, for example `Base,Gold`. |
| **Price Lists** | Unleashed price lists to give the highest priority for every customer, above any other price list assigned to them. Useful for promotions (see [Run a promotion](#run-a-promotion-with-a-priority-price-list)). Separate them with a comma and no spaces, for example `SellPriceTier1,SellPriceTier2`. Leave blank if you don't need one. |
| **Send customers an invite email when activated in Unleashed** | Sends new customers Shopify's account invite email, asking them to confirm their account. See [Invite new customers](#invite-new-customers). |
| **Configure Sell Price Tier currency codes** | For multi-currency stores. When ticked, a **Currency Code** field appears for each of the 10 tiers (for example `USD`). Leave a tier blank to use your store's default currency. See [Price in more than one currency](#price-in-more-than-one-currency). |

### Set up customers in Unleashed

1. In Unleashed, go to **Customers > Add Customer**, or open an existing customer.
2. On the **Details** tab, choose a **Customer Type** that's listed in the SparkLayer **Customer Types** setting. This decides the customer's SparkLayer customer group.
3. Set any tax settings, such as **Taxable**.
4. On the **Address** tab, add a full address.
5. Check the customer has a valid email address on their primary contact. Customers without one can't sync.

The customer is imported at the next sync and tagged with their customer group in the usual SparkLayer way.

### Set up B2B prices in Unleashed

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

1. To rename the tiers, go to **Settings > System > Sell Price Tiers** in Unleashed. 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 (**Inventory > Products > View Products**) and go to the **Sale** tab. Under **Sell Price Tiers**, enter the price for each tier you use. The **Default Sell Price** is the base price for every customer.
3. Open the customer and choose their **Sell Price Tier** on the **Details** tab. This is the price list they see when they sign in.

#### Set customer-specific prices

1. In Unleashed, open the customer and go to the **Customer Pricing** tab.
2. Search for a **Product** and enter a **Price / Discount %**.
3. Choose a **Price Type**: **Fixed price** or **Discount %**.
4. For a discount, choose what it's taken from in **Discount From**: **Default Sell Price** or **Customer Price Tier**. See the [limitations](#known-limitations) for how Discount % works.
5. Click **Add**.

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.

#### Give a customer an extra discount

To give a customer a percentage off on top of their price tier, open the customer in Unleashed and enter it in **Discount (%)** on the **Details** tab. SparkLayer creates a discounted price list for them.

#### Run a promotion with a priority price list

To run a promotion for all customers, adjust the product prices in one of your sell price tiers. Then enter that tier in the **Price Lists** setting in SparkLayer. It now takes priority over every customer's other price lists.

#### Price in more than one currency

If you sell in more than one currency, use a sell price tier for each currency. For example, Sell Price Tier 1 for GBP and Sell Price Tier 2 for EUR.

1. In **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app, open Unleashed.
2. Tick **Configure Sell Price Tier currency codes**.
3. Enter the currency code for each tier you use, for example `EUR` in **Tier 2 Currency Code**, and click **Save**.

If you only sell in your store's base currency, you don't need to do this.

## Limitations

- **Discount % in Customer Pricing.** Because of a limitation in the Unleashed API, a **Customer Pricing** line with the **Discount %** price type only affects the customer's **Sell Price Tier**, not the **Default Sell Price** or the **Customer Price Tier**. 
- SparkLayer uses the internal sell price tier names, not the custom names you can set in Unleashed settings.
- Customers marked **Obsolete** in Unleashed don't sync. If you make a customer obsolete, disable them manually in Shopify.
- Changing a customer's email address creates another customer in Shopify. Disable the old account manually.
- Only the primary contact syncs. If you choose a new primary contact, manually disable the existing Shopify customer.
- Your Unleashed–Shopify integration needs customer synchronisation turned off, and mustn't import orders to a single customer. See [Requirements](#requirements).

## Troubleshooting

**Why are some of my customers not syncing from Unleashed to Shopify?**

Check the customer's **Customer Type** in Unleashed matches one in the SparkLayer **Customer Types** setting exactly, and that the names there are separated by commas with no spaces (for example `Base,Gold`). Also check the customer's email address in Unleashed: it's used to match the records.

**Why am I not seeing B2B price updates in my Shopify store?**

Check the price lists in Unleashed are assigned to the right customers. If you use the **Price Lists** setting, check the names match and are separated by commas with no spaces.

**Why don't changes I make in Shopify show in Unleashed?**

Unleashed is the single source of truth for customers in this integration, so changes made in Shopify don't sync back. Make the change in Unleashed and the integration pushes it to Shopify.

**What should I do if Shopify orders aren't appearing in Unleashed?**

Check the integration settings, especially the **API Key** and **Customer Types**. If they're right, look for sync errors in the order logs in SparkLayer.

**Why aren't my custom-named price tiers showing in SparkLayer?**

SparkLayer uses Unleashed's default sell price tier names, such as "Sell Price Tier 1". Custom names don't appear in SparkLayer.

**Why do I have duplicate customers in Shopify after changing an email in Unleashed?**

Changing a customer's email address in Unleashed creates a new customer in Shopify. Disable the old account in Shopify after making the change.

**Why aren't customer-specific discounts applied correctly?**

Check the **Discount %** is set correctly in Unleashed. A **Discount %** line only affects the sell price tier, not the **Default Sell Price**. For other discounts, apply them to the relevant price tiers or use fixed prices in **Customer Pricing**.
