# Katana

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

Connect Katana to SparkLayer on Shopify to sync B2B customers and price lists, map customer categories to customer groups, and fix common sync issues.

> **Quick summary**
>
> - The Katana integration makes Katana the source of truth for your B2B customers and prices. SparkLayer imports customers and price lists from Katana into Shopify and SparkLayer.
> - Data syncs one way, from Katana, every 4 hours. Changes made in Shopify don't go back to Katana. A customer's **Category** in Katana decides their SparkLayer customer group.
> - 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**, by signing in to Katana.
> - Needs the Pro or Enterprise plan, a Shopify store and an approved Katana account.

## What it does

[Katana](https://katanamrp.com/) is a manufacturing ERP that gives you a live view of sales, inventory and production.

SparkLayer has a direct integration with Katana. You manage your B2B customers and price lists in Katana, and SparkLayer brings them into Shopify and SparkLayer.

How data flows between Katana, SparkLayer and Shopify:

1. **Katana**: Customers with a category, and price lists
2. **SparkLayer**: Imports customers and price lists every 4 hours
3. **Shopify**: Customer records and metafields; B2B prices on the storefront

## What syncs and in which direction

Customers and prices sync one way, from Katana. SparkLayer's Katana integration doesn't send orders to Katana.

| Data | Direction | Details |
| --- | --- | --- |
| Customers | Katana to Shopify and SparkLayer | Katana is the master of your B2B customer data. Changes to customer records sync to Shopify and SparkLayer automatically. |
| Prices | Katana to SparkLayer | Price lists and product prices come from the price lists you set up in Katana. |

### Customer data

Customers are matched between Katana and Shopify by the **primary email** in Katana. 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.

| Katana | Shopify and SparkLayer |
| --- | --- |
| Address | Customer record in Shopify |
| Primary telephone | Customer record in Shopify |
| First and last name | Customer record in Shopify |
| Customer category | Customer record in Shopify, matched to a customer group |
| Company name | Shopify metafield |
| Discount rate | Shopify metafield |
| Price list | Shopify metafield |

### Price lists

SparkLayer imports each new 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 Katana |
| --- | --- |
| Handle / ID | Price list ID |
| Name | Price list name |
| Currency | Currency |

Price lists use Katana's base currency. If you give a customer a different currency in Katana, SparkLayer creates an automatic price list with currency conversion for them.

### New customers

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

## Set up Katana

Check the requirements, connect Katana, then set up your customers and price lists in Katana.

### 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 Katana account.** See the [Katana website](http://katanamrp.com/).

### Connect Katana

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 **Katana**.
3. Authorise SparkLayer to access your Katana account.

To change the settings later, open Katana 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 |
| --- | --- |
| **Send customers an invite email when activated in Katana** | Sends new customers Shopify's account invite email, asking them to confirm their account. See [New customers](#new-customers). |

### Set up customers in Katana

Katana uses the customer's **Category** to decide which [customer group](https://docs.sparklayer.io/help/customers/customer-groups.md) they belong to in SparkLayer.

1. 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 note the tag of the group you want, for example `b2b-ca` for a group called **B2B - Canada**.
2. In Katana, create or open the customer and set their **Category** to that tag, for example `b2b-ca`.
3. Check the customer has a primary email address. It's used to match them in Shopify.

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.

### Set up B2B prices in Katana

1. In Katana, go to **Price lists** and click **+ Price list**.
2. Enter a **Price list name**, for example `UKVIP`.
3. On the **Product pricing** tab, add products and set their prices. For each product, choose an **Adjustment method** (for example **Fixed**) and an **Amount**. Katana shows the **Final price**.
4. On the **Customers** tab, assign the price list to customers. 

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

## Limitations

- SparkLayer doesn't send B2B orders to Katana. The integration only brings customers and prices in from Katana.
- Shopify doesn't support separate addresses, so the default address in Katana 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 Katana into Shopify. Don't let customers edit addresses in SparkLayer, or new addresses won't reach Katana.
- Prices you delete in Katana aren't removed from SparkLayer. Delete them manually 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.

## Troubleshooting

**Why isn't my customer data syncing from Katana to Shopify?**

Check that:

- **The customer has a primary email address** in Katana. It's used to match them.
- **The Katana integration is turned on and authorised** in **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app.

**Why aren't customer addresses updating in Katana when edited in SparkLayer?**

Addresses sync one way, from Katana to Shopify, so changes made in SparkLayer don't reach Katana. To keep data consistent, turn off address editing in SparkLayer.

**New customers in Katana aren't appearing in Shopify. What should I check?**

Check that:

- **The Katana integration is turned on and authorised.**
- **New customers have all the required fields**, especially the email address.
- **The invite email settings are right**: **Send customers an invite email when activated in Katana**, and Shopify's **Customer account invite** email.

**My price list changes in Katana aren't showing in SparkLayer. What might be wrong?**

- Create and update price lists in Katana, not in SparkLayer.
- Prices deleted in Katana don't sync. Remove old prices manually in SparkLayer.

**Why is the wrong price showing for a B2B customer?**

Check that:

- **The customer is assigned to the right price list** in Katana.
- **The right currency is set on the customer**, if they use a different currency from your base currency.

**My new price list isn't appearing in SparkLayer. What should I do?**

Check the price list is saved in Katana, then allow time for SparkLayer to import it.

**Where can I change the invite email that new customers receive?**

In the Shopify admin, go to **Settings > Notifications** ([open in the Shopify admin](https://admin.shopify.com/settings/notifications/customer)) and edit the **Customer account invite** template. SparkLayer uses it when activating new accounts created from Katana.
