# Shopify Flow for B2B

URL: https://docs.sparklayer.io/help/platforms/shopify/customisations/flow
Applies to: Shopify

Import ready-made Shopify Flow workflows for SparkLayer to mark B2B orders as paid, tag orders and customers, keep RRP metafields in sync and email your team.

> **Quick summary**
>
> - [Shopify Flow](https://help.shopify.com/en/manual/shopify-flow) automates tasks in your store when something happens, such as an order being created.
> - We've made ready-made B2B workflows for orders, customers, products and emails. Download one and [import it](https://help.shopify.com/en/manual/shopify-flow/manage/manage#import-a-workflow) into Shopify Flow.
> - Shopify Flow is a free app, available on every Shopify plan.

## How it works

A Shopify Flow workflow has a trigger, an optional condition and one or more actions. Many B2B workflows use the `b2b` tag SparkLayer adds to customers and orders, so they act only on B2B orders. For example, a workflow that tags B2B orders works like this:

Example workflow: tag orders as B2B:

1. **Start when**: Order created
2. **If**: Any of the order customer's tags match `b2b`
3. **Then**: Add the order tag `b2b_order`

To use one of our workflows:

1. Download the `.flow` file from the tables below.
2. In Shopify Flow, [import the workflow](https://help.shopify.com/en/manual/shopify-flow/manage/manage#import-a-workflow).
3. Check its settings, such as tags or email addresses, and change them to suit your store.
4. Turn the workflow on and save it.

## Order workflows

These workflows handle B2B orders after they're placed.

| Workflow | What it does | Download |
| --- | --- | --- |
| **Mark order as paid** | Marks an order as paid automatically when a B2B customer orders with a manual payment method. | [Download](https://cdn.shopify.com/s/files/1/0565/7500/0728/files/Mark_B2B_orders_as_paid_0a29877b-9fb6-4d8a-9f10-ca27ba055b66.flow?v=1635839553) |
| **Mark Payment on Account order as paid** | Marks an order as paid automatically when a B2B customer orders with **Payment on Account**. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Mark_B2B__Payment_on_Account__orders_as_paid.flow?v=1710337044) |
| **Archive B2B orders** | Archives B2B orders automatically, to keep them out of your main Shopify orders view alongside retail orders. | [Download](https://cdn.shopify.com/s/files/1/0565/7500/0728/files/Archive_B2B_Orders.flow?v=1635838493) |
| **Tag pre-orders** | Tags an order when it includes pre-order products. | See [Stock display](https://docs.sparklayer.io/help/storefront/stock-display.md) |
| **Tag order with the customer's net terms** | Tags each order with the [net terms](https://docs.sparklayer.io/help/ordering/credit-net-terms-and-invoicing.md) set on the customer (in a metafield). | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Tag_order_with_what_net_terms_the_customer_is_on.flow?v=1722499862) |
| **Populate order metafield from custom checkout fields** | Copies data from [custom checkout fields](https://docs.sparklayer.io/help/ordering/checkout-fields.md) (such as a date selector) on the draft order into metafields on the completed order. | [Download](https://cdn.shopify.com/s/files/1/0631/8453/5705/files/Update_order_Metafield_with_SparkLayer_Custom_Attributes_1.flow?v=1754639426) |
| **Control B2B order fulfilment** | Sends orders from your wholesale customer group to a particular Shopify stock location for fulfilment, so B2B orders are handled separately from retail. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_Fulfilment_location_11.flow?v=1760365759) |

## Customer workflows

These workflows update a customer's tags as they order and spend.

| Workflow | What it does | Download |
| --- | --- | --- |
| **Switch tag on first order** | When a B2B customer places their first order, replaces their tag with a new one and sends an internal email. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_switch_tag_assigned_to_a_B2B_customer_after_their_first_order_acb41199-9408-48f9-8e5e-f1228e836ceb.flow?v=1714641440) |
| **Adjust customer group tag by spend** | If you have customer groups such as Gold, Silver and Bronze, updates the customer's tag based on how much they spend, which moves them to a different B2B group. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Automatically_adjust_customer_tag_for_customer_group_depending_on_spend.flow?v=1722499466) |

## Product workflows

These workflows keep product data and sales channels up to date.

| Workflow | What it does | Download |
| --- | --- | --- |
| **Remove restock date when a variant is back in stock** | If you use [pre-orders](https://docs.sparklayer.io/help/storefront/stock-display.md) with a restock date, removes the date from the metafield when the product is back in stock. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Remove_restock_date_in_metafield_when_variant_back_in_stock.flow?v=1722499600) |
| **Add new products to the SparkLayer Wholesale and Online Store sales channels** | Makes new products available in the **SparkLayer Wholesale** and **Online Store** sales channels automatically. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Automatically_mark_new_products_with_B2B_ordering_Online_store_sales_channels.flow?v=1722499725) |
| **Add RRP metafield when product status changes** | When a product's status changes, writes each variant's Shopify price into its RRP field, in US dollars. Change `usd` in its value to your currency before you turn it on. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Add_RRP_when_product_status_updated.flow?v=1772815525) |
| **Update RRP metafield when a product is updated** | Once an hour, copies the Shopify price of each changed variant into its RRP field. Before you turn it on, change its currency and timing: see [Show RRPs to your trade customers](https://docs.sparklayer.io/help/guides/show-rrp.md#set-your-currency-and-timing). | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Update_RRP_Metafield_when_product_updated.flow?v=1772815525) |

## Email workflows

These workflows email you, your team or your sales agents.

| Workflow | What it does | Download |
| --- | --- | --- |
| **Send an email with order details** | Emails an address you choose when a B2B customer places an order with a particular B2B payment status. Useful for notifying the team who handle B2B accounts (see the example below). | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_Draft_order-_Send_email_to_verify_the_order.flow?v=1762519098) |
| **Send notification based on custom checkout fields (draft orders)** | Triggers an action, such as an internal email, based on [custom checkout fields](https://docs.sparklayer.io/help/ordering/checkout-fields.md). | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_Draft_Checkout_Custom_Attributes_-_Send_email_based_on_criteria.flow?v=1717486893) |
| **Send notification based on custom checkout fields (completed orders)** | Triggers an action, such as an internal email, based on [custom checkout fields](https://docs.sparklayer.io/help/ordering/checkout-fields.md). | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_Completed_Order_Checkout_Custom_Attributes_-_Send_email_based_on_criteria.flow?v=1717486893) |
| **Email sales agent when order placed by customer** | Notifies [sales agents](https://docs.sparklayer.io/help/sales-ordering.md) when a customer places an order, based on rules you set. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Sales_Agents_-_Email_sales_agent_when_order_placed_by_customer.flow?v=1726494991) |

### Change the email content

You can add order and customer details to a workflow's email with variables. In the **Send an email with order details** workflow, the **Send internal email** action has an **Email address**, a **Subject** and a **Message**. For example:

- **Subject**: Action required - Draft Order to review
- **Message**:

```liquid
**New Draft Order Created**

**Date:** {{ draftOrder.createdAt }}

**Customer:** {{ draftOrder.customer.displayName }}

**Email:** {{ draftOrder.customer.email }}

**Total:** {{ draftOrder.totalPriceSet.shopMoney.amount }} {{ draftOrder.totalPriceSet.shopMoney.currencyCode }}

**Items Ordered:**
{% for lineItem in draftOrder.lineItems %}
- {{ lineItem.quantity }} × {{ lineItem.title }} – {{ lineItem.originalUnitPriceSet.shopMoney.amount }} {{ lineItem.originalUnitPriceSet.shopMoney.currencyCode }}
{% endfor %}

=====
Please review this customer's order within **Shopify > Orders > Drafts**.
```

Click **Add variable** to insert other details.
