> For the complete documentation index, see [llms.txt](https://docs.xorosoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xorosoft.com/xoroerp-1/connected-apps/shopify/configuration-settings/b2b-sync/general-settings.md).

# General Settings

### Overview

The **B2B Sync** feature in Shopify Integration enables businesses to manage **B2B company structures, customer mapping, and pricing synchronization** between Shopify and XoroERP.

This functionality is designed to support:

* Company and location hierarchy (Parent–Child structure)
* Accurate order mapping based on B2B customers
* Flexible pricing rules at the company or location level

<figure><img src="/files/NrDg82ZNvlepTOkCd32I" alt=""><figcaption></figcaption></figure>

B2B Sync works through three core flows:

1. **B2B Company Sync**
2. **Customer & Location Mapping**
3. **B2B Pricing Sync**

All three flows are configured from the **General Tab** under B2B Sync settings.

***

### B2B Sync&#x20;

#### Enable B2B Sync

**Type:** Checkbox

This setting allows your account to operate in **B2B (Business-to-Business) mode** for Shopify integration.

***

#### **What happens when this is enabled**

When **Enable B2B Sync** is turned on, all incoming orders are treated as B2B orders, and the system follows a specific method to identify customers and process orders.

* Orders are successfully created (dropped) in XoroERP
* Customers are matched using the **Shopify Customer ID**
* The system uses a **Customer Identifier Code** (such as Location ID) from the selected custom field

***

{% hint style="info" %}

#### **Important Requirement**

* The **Customer Identifier Code is mandatory**
* This value must be available in the configured custom field for each customer

If this information is missing, the system will not be able to correctly identify the customer or process the order.
{% endhint %}

***

#### **Customer Matching Logic**

When this setting is enabled:

* Customer matching is done **only using the Shopify Customer ID**
* The system will **not use phone number or email** for matching

<figure><img src="/files/vs3juWEoudc4RwE38e8Z" alt=""><figcaption></figcaption></figure>

#### What it does:

* Enables syncing of **B2B companies and locations**
* Allows **pricing rules to be applied and synced**
* Activates additional configuration options within the B2B Sync module

***

### Available Options Under B2B Sync

Once **Enable B2B Sync** is checked, the following options become available:

<figure><img src="/files/DkCetWilQ5ZfxgAlrOVC" alt=""><figcaption></figcaption></figure>

***

#### 1. Enable B2B Company Sync

**Description:**

This setting allows synchronization of **Shopify B2B Companies** into XoroERP.

**What gets synced:**

* Company details
* Associated customers
* Company locations

***

**B2B Customer Sync Type**

Selecting the above option enables a dropdown:

<div data-with-frame="true"><figure><img src="/files/cS7GuKiauf545DFr2nKt" alt=""><figcaption></figcaption></figure></div>

**a. Sync B2B Customer as Customer**

* Company is created as a **Parent Customer**
* Customers are created as **Child Customers**
* Maintains a **hierarchical structure**

***

**b. Sync B2B Location as Customer**

* Each location is treated as an **independent customer**
* No parent-child hierarchy is enforced

***

**Key Behavior**

* Multiple locations under a company are handled based on the selected sync type

***

#### Business Impact

* Enables structured B2B customer management
* Supports customer/location-level tracking and operations
* Ensures correct customer mapping during order creation

***

#### 2. Sync B2B Prices

**Description:**

This setting enables synchronization of **B2B catalog pricing from XoroERP to Shopify**.

When enabled:

* Pricing rules configured in XoroERP are applied in Shopify
* Pricing is mapped to **company or location level**

***

#### **Additional Settings**

Enabling this option exposes the following configurations:

***

#### B2B Price Sync Type

This setting determines **how pricing is synced between XoroERP and Shopify for B2B customers**.

In B2B scenarios, pricing is often different for each customer or company location. This setting allows you to control whether pricing should follow a **standard mapping** or a **custom, field-based mapping**.

<div data-with-frame="true"><figure><img src="/files/5Q16bmyVuBs935zqYjwH" alt=""><figcaption></figcaption></figure></div>

#### **Available Options**

***

**Default Price Sync Mapping**

When this option is selected, XoroERP uses the **default mapping configuration** to sync B2B pricing along with customer location data.

To use this option, **Enable B2B Company Sync** must be turned ON. Once enabled, XoroERP automatically generates and maintains the required **location ID mappings** in the backend. These mappings are then used during synchronization with Shopify to ensure the correct pricing is applied.

This option does not require any additional setup and is ideal for scenarios where you want the system to manage pricing and location mapping automatically using the default configuration.

***

**Price Sync Customer Field Map**

When this option is selected, XoroERP syncs B2B pricing to Shopify using **custom field-based mapping** instead of the default configuration.

This allows you to control how pricing is applied by linking customers and items to specific **company locations and product variants** in Shopify.

With this setup:

* Xoro price rules are synced to Shopify
* Pricing is applied based on the **mapped customer location and item variant**
* Suitable for advanced B2B setups where pricing varies by customer or location

***

The following options appear when the user selects **“Price Sync Custom Field Map”** from the dropdown under the **B2B Price Sync Type** setting

***

#### B2B Price Sync Customer Custom Field

This field is used to select a custom field in XoroERP that stores the **B2B Location ID** for each customer.

***

**What this means**

* Each customer is linked to a **specific company location in Shopify**
* This location determines which **price catalog** applies

<div data-with-frame="true"><figure><img src="/files/BtpT1gBqnrm9YWyfeXta" alt=""><figcaption></figcaption></figure></div>

Select the custom field containing:

* **Shopify Location ID**

**How it works**

* The system reads the Location ID from the selected custom field
* It uses this ID to:
  * Identify the correct company/location in Shopify
  * Apply the correct pricing for that customer

***

**Why this is important**

Without this mapping:

* The system cannot determine which pricing to apply
* Customers may receive incorrect prices

**Purpose:**

* Maps the customer to the correct catalog location
* Ensures correct pricing visibility in Shopify

***

#### B2B Price Sync Item Custom Field

This field is used to select a custom field in XoroERP that stores the **Shopify Variant ID** for items.

***

**What this means**

* Each item in XoroERP must be linked to its corresponding **Shopify product variant**
* Pricing is applied at the **variant level in Shopify**

<div data-with-frame="true"><figure><img src="/files/F7MOiDSA4ebGH6ty722N" alt=""><figcaption></figcaption></figure></div>

Select the custom field containing:

* **Shopify Variant ID**

**How it works**

* The system reads the Variant ID from the selected custom field
* It uses this ID to:
  * Match the item in Shopify
  * Apply the correct catalog pricing

**Purpose**:

* Links ERP items to Shopify catalog items
* Ensures accurate pricing application

***

#### Business Impact

* Ensures pricing is correctly reflected in Shopify catalogs
* Enables **granular pricing control** across locations

***

#### 3. Sync B2B Locations in Catalog

**Type:** Checkbox

When enabled:

* Location-specific pricing is synced to Shopify
* Pricing rules are applied at the **company location level**

**Key Behavior**

* Catalog pricing is mapped based on:
  * Customer location
  * Item variant

#### Important Notes

* Company structure must be correctly created in Shopify before syncing
* Currency must match between:
  * Customer
  * Account
* Custom field mapping is critical for pricing sync accuracy
* Missing mappings may result in:
  * Pricing sync failures
  * Order creation issues

***

### Summary

| Setting                       | Function                            |
| ----------------------------- | ----------------------------------- |
| Enable B2B Sync               | Activates all B2B workflows         |
| Enable B2B Company Sync       | Syncs company & location structure  |
| B2B Customer Sync Type        | Defines customer hierarchy behavior |
| Sync B2B Prices               | Syncs pricing rules to Shopify      |
| Sync B2B Locations in Catalog | Enables location-based pricing      |

***

#### Key Takeaway

> B2B Sync works effectively only when:

* Company structure is properly defined in Shopify
* Customer and location mapping is accurate
* Pricing rules are aligned with the selected configuration


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xorosoft.com/xoroerp-1/connected-apps/shopify/configuration-settings/b2b-sync/general-settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
