> For the complete documentation index, see [llms.txt](https://docs-shpf.bsscommerce.com/b2b-wholesale-solution/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-shpf.bsscommerce.com/b2b-wholesale-solution/b2b-pricing/custom-pricing/import-and-export-custom-pricing-rules.md).

# Import & Export Custom Pricing Rules

Bulk-manage your custom pricing rules using CSV import/export — ideal for large product catalogs, multiple customer segments, or migrating rules between stores.

Create, update or back up many Custom Pricing rules at once from a CSV file.

## Open Import & Export

Go to **B2B pricing › Custom Pricing**, click **More actions** and select **Import & export**. The page has an **Export** card, an **Import** card and an **Export history** table below them. If you have no rules yet, you can also click **Import from CSV** in the empty state.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2Fgit-blob-fc0a32c7e7624b18fab813a8f438d9e390935c9e%2Fcms-cp-import-01.png?alt=media" alt="Custom Pricing Import &#x26; export page"><figcaption><p>Custom Pricing Import &#x26; export page</p></figcaption></figure>

## Export Existing Rules

1. On the **Import & export** page, click **Export**.
2. Choose the file format: **CSV** or **Excel (.xlsx)**. All rules are exported.
3. Start the export. It runs as a **background job** with a progress indicator, and you can keep working while it finishes.
4. When it completes, click the download link, or download the file later from **Export history**.

{% hint style="info" %}
**Export history** lists your recent files with **File name**, **Created** and **Access expires**. Files stay available for a limited time (about 1 day); after that the link shows **Link expired**. Click **Export again** to create a fresh file.

Choose **CSV** if you want to import the file again: an exported file uses the same columns as the import.
{% endhint %}

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2Fgit-blob-d5374f03695ff7f53992b4c0ce9d448b811e2d5d%2Fcms-cp-export-01.png?alt=media" alt="Export rules dialog"><figcaption><p>Export rules dialog</p></figcaption></figure>

### Export from the rules list

You can also export without leaving the rules list:

1. Go to **B2B pricing › Custom Pricing**. Click **Export** above the rules list, or select rules and choose **Export** from the bulk actions.
2. In the **Export rules** window, choose what to export: **Current page**, **All records**, **Selected records** (when you have ticked rules) or the records matching your search (when a search is active).
3. Under **Export as**, choose **CSV** or **Excel**, then click **Export rules**.
4. The export runs in the background, so you can leave the page. When it finishes, click the download link.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2Fgit-blob-c3374cc69fa9d0d8a9d490c55ee425121e78feca%2Fcms-export-modal-01.png?alt=media" alt="Export rules window opened from the rules list"><figcaption><p>Export rules window opened from the rules list</p></figcaption></figure>

## Import New or Modified Rules

### Step 1: Download the Sample File

1. Click **Import** on the **Import & export** page. The **Import rules by CSV** window opens.
2. Click **Download sample CSV**.
3. Open the file in Excel or Google Sheets. The first row holds the column names. The rows under it say whether each column is required, describe its format and show two example rules.

{% hint style="warning" %}
**Before you upload, delete every row under the column names:** the Required/Optional row, the Data type and Example rows and both example rules. The importer reads them as real rules, so the guide rows fail the check and the example rules would be created.
{% endhint %}

### Step 2: Fill In One Row per Rule

| Scenario                  | What to do                                                            |
| ------------------------- | --------------------------------------------------------------------- |
| Creating a new rule       | Leave the **ID** column blank                                         |
| Updating an existing rule | Keep the rule's **ID** and tick **Overwrite rules with matching IDs** |

Type values exactly as listed below, including capital letters. Separate several customers, products or markets with commas.

| Column                         | Required?   | Accepted values                                                                                                                                                             |
| ------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ID**                         | Optional    | Blank to create a rule. The ID of an existing rule to update it (only with **Overwrite rules with matching IDs**).                                                          |
| **Name**                       | Required    | Any text.                                                                                                                                                                   |
| **Priority**                   | Required    | Whole number from 0 to 99. 0 is the highest priority.                                                                                                                       |
| **Status**                     | Required    | `enable` or `disable`, in lower case.                                                                                                                                       |
| **Market**                     | Required    | `All`, or the names of Region markets exactly as in Shopify admin, separated by commas.                                                                                     |
| **Customer condition**         | Required    | `All`, `Logged-in`, `Not logged-in`, `Specific customers`, `Customer tags` or `Company locations`.                                                                          |
| **Customers**                  | Conditional | Customer emails, customer tags or company location IDs, separated by commas. Needed for Specific customers, Customer tags and Company locations.                            |
| **Exclude customer condition** | Required    | `None`, `Specific customers`, `Customer tags` or `Company locations`.                                                                                                       |
| **Exclude customers**          | Conditional | Emails, tags or company location IDs, separated by commas. Needed unless the condition is `None`.                                                                           |
| **Product condition**          | Required    | `All`, `Specific products`, `Specific variants`, `Specific collections` or `Specific tags`.                                                                                 |
| **Products**                   | Conditional | Product IDs, titles, SKUs or barcodes, variant IDs, SKUs or barcodes, collection IDs or titles, or product tags, separated by commas. Needed unless the condition is `All`. |
| **Exclude product condition**  | Required    | `None`, `Specific products`, `Specific variants`, `Specific collections` or `Specific tags`.                                                                                |
| **Exclude products**           | Conditional | Same values as **Products**. Needed unless the condition is `None`.                                                                                                         |
| **Discount type**              | Required    | `Fixed price`, `Decrease fixed amount`, `Decrease fixed percentage`, `Increasing price`, `Increase fixed amount` or `Increase fixed percentage`.                            |
| **Discount value**             | Required    | A number of 0 or more, with no currency or % sign. Percentages go up to 100.                                                                                                |
| **Start date**                 | Optional    | `YYYY-MM-DD`.                                                                                                                                                               |
| **Start time**                 | Optional    | `HH:MM` or `HH:MM:SS`.                                                                                                                                                      |
| **End date**                   | Optional    | `YYYY-MM-DD`. Cannot be before the start date.                                                                                                                              |
| **End time**                   | Optional    | `HH:MM` or `HH:MM:SS`.                                                                                                                                                      |

{% hint style="info" %}
Customers are matched by **email**. Products are matched by ID, title, SKU or barcode, variants by ID, SKU or barcode, collections by ID or title, and company locations by their numeric ID. For a product whose title contains a comma, use the product ID, SKU or barcode instead.
{% endhint %}

### Step 3: Upload the File

Save the file as CSV and drop it into the upload area. Custom Pricing accepts **one .csv file up to 5 MB**. Only one import can run at a time.

<figure><img src="https://1478990334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGolQYRPH9iUGYatlTXwl%2Fuploads%2Fgit-blob-61d53f199285e1808dc2c1d32bf9179d7f192429%2Fcms-cp-import-02.png?alt=media" alt="Import rules by CSV window"><figcaption><p>Import rules by CSV window</p></figcaption></figure>

### Step 4: Choose How Existing Rules Are Handled

After you choose a file, two options appear. By default every row creates a **new** rule, and a row that has an ID is rejected.

* **Overwrite rules with matching IDs**: updates the rule with that ID. The rule takes exactly the values in your row, so a blank cell clears that setting. Other rules are kept as they are.
* **Replace all existing rules**: deletes every current Custom Pricing rule before importing. Leave the **ID** column blank.

Tick one of the two at most, then click **Validate and import**.

{% hint style="warning" %}
**Replace all existing rules** is permanent. Export your rules first to keep a copy.
{% endhint %}

### Step 5: Check the Result

We check the whole file first: the column names, every value, the IDs and whether each customer, product, collection, company location and market exists in your store.

* **If anything fails**, nothing is imported. Download **import\_errors.csv**, which lists the location, the error and the message for each problem. The link works for 7 days. Fix the file and import it again.
* **If the file passes**, rules are saved in the background. A status card shows how many succeeded, and saved rules reach your storefront automatically.
* If some rules fail while saving, the ones that passed are still saved, and the card links to **import\_errors.csv** for the rest.

## Best Practices & Tips

* **Back up your current rules** by exporting before making sweeping changes.
* Use the sample file as your base and don’t change the column names.
* Include IDs only when you intend to **update existing rules**.
* To change rules you already have: export them, edit the file without touching the **ID** column, then import it with **Overwrite rules with matching IDs**.
* A start date is used only together with a start time, and an end date only when the start date and time are set. An end time is used only with an end date. Times are saved exactly as you type them.
* Make sure customer emails and other referenced values match your store data exactly.

{% hint style="info" %}
If you need further assistance, please feel free to reach us at [**support@bss-b2b.solutions**](mailto:support@bss-b2b.solutions) or [**Live Chat**](https://go.crisp.chat/chat/embed/?website_id=9f64b5a9-1a02-4190-93b8-8ef56b19f740).
{% endhint %}
