HomeShopify & E-commerceShopify wholesale B2B order routing with…

Shopify wholesale B2B order routing with n8n

Shopify wholesale B2B order routing with n8n









Shopify wholesale B2B order routing with n8n solves a quiet problem that grows with every new stockist you sign: wholesale orders look identical to retail orders in your admin, so they sit in the same queue and get packed the same way. This guide builds a small n8n workflow that spots an order from a wholesale-tagged customer the moment it lands, adds a wholesale-queue tag, and pings your B2B fulfillment team on Telegram so those orders never slip into the retail pile.

What it does

When a store sells to both consumers and trade buyers, the two order types need different handling. Wholesale orders often ship on account terms, use different packing slips, get palletized instead of boxed, and route to a separate person. On a stock Shopify plan there is no built-in switch that says “this one is trade, treat it differently.”

This workflow adds that switch. It listens for every new order through a Shopify webhook. For each order it reads the buyer’s customer tags. If the buyer is tagged as a wholesale account, n8n stamps the order with a wholesale-queue tag and sends a Telegram message to your B2B channel with the order number, the customer name, and the total. Retail orders pass straight through and are ignored, so your consumer fulfillment stays exactly as it is today.

The result is a clean separation you can filter on. In Shopify admin you can search tag:wholesale-queue to see every open trade order, and your warehouse lead gets a real-time nudge instead of scrolling the full order list hunting for the B2B ones.

Why it beats the default

The manual default is a person remembering which customers are wholesale and eyeballing each order. That works at five trade accounts and breaks at fifty. Someone is out sick, a new hire does not know the account list, and a pallet order gets packed as twelve separate retail parcels. The cost of a missed classification is real: wrong packing, wrong paperwork, and a trade customer who now doubts you.

Shopify Flow can tag orders, but it is limited to Shopify Plus and keeps the logic locked inside Shopify. Routing a notification to Telegram, layering in Google Sheets logging later, or fanning out to a supplier email means leaving Flow anyway. n8n gives you the tag plus the alert plus room to grow in one place, on any Shopify plan, self-hosted or cloud.

Because the decision is driven by a customer tag you already control, onboarding a new stockist is a single action: tag their account wholesale. From that point every order they place is routed correctly with no change to the workflow and no tribal knowledge required.

What you need

  • A Shopify store on any plan, with an admin login that can create a custom app.
  • An n8n instance, either n8n Cloud or self-hosted (version 1.0 or newer).
  • A Shopify Admin API access token, created through the 2026 Shopify Dev Dashboard method. If you have not connected Shopify to n8n before, follow connect Shopify to n8n (2026 guide) first, then come back.
  • A Telegram bot token and the chat ID of the channel or group your B2B team watches.
  • Your wholesale customers tagged with wholesale in Shopify (Customers, open the account, add the tag).

Build time is around 20 minutes from scratch, or a couple of minutes if you import the ready-made template below and drop in your credentials.

Node-by-node list

The workflow is five nodes in a single line with one branch. Here is what each one is and does.

# Node Type Job
1 New Shopify order shopifyTrigger Fires on the orders/create webhook for every new order, delivering the full order payload including the customer object.
2 Customer tagged wholesale? if Checks whether customer.tags contains the word wholesale. True routes onward, false ends the run.
3 Prep wholesale fields set Pulls out the order id, order name, customer name, and total, and builds the appended tag string.
4 Tag order wholesale-queue shopify Updates the order, writing back the existing tags plus wholesale-queue.
5 Notify wholesale queue telegram Sends a formatted alert to your B2B team channel with the order details.

How it works

  [New Shopify order]  (orders/create webhook)
          |
          v
  [Customer tagged wholesale?]  --- false ---> (ignored, retail)
          |
        true
          v
  [Prep wholesale fields]  (order id, name, total, appended tags)
          |
          v
  [Tag order wholesale-queue]  (Shopify order update)
          |
          v
  [Notify wholesale queue]  (Telegram alert to B2B team)
  

Step-by-step build

  1. Create a new workflow in n8n and name it something like “Shopify wholesale B2B order routing.”
  2. Add a Shopify Trigger node. Set Authentication to Access Token and attach your Shopify Admin API credential. Set the Topic to orders/create. When you activate the workflow later, n8n registers this webhook in your store automatically, so there is nothing to paste into Shopify by hand.
  3. Add an IF node named “Customer tagged wholesale?” and connect the trigger to it. Add one condition: left value {{ $json.customer.tags }}, operator String contains, right value wholesale. Turn on the loose type validation and case-insensitive option so Wholesale and WHOLESALE also match.
  4. Add a Set (Edit Fields) node named “Prep wholesale fields” and wire it to the IF node’s true output. Create these string assignments: orderId = {{ $json.id }}, orderName = {{ $json.name }}, customerName = {{ $json.customer.first_name }} {{ $json.customer.last_name }}, total = {{ $json.total_price }} {{ $json.currency }}, and newTags = {{ $json.tags ? $json.tags + ', wholesale-queue' : 'wholesale-queue' }}. That last expression appends the queue tag without wiping any existing order tags.
  5. Add a Shopify node named “Tag order wholesale-queue” after the Set node. Resource Order, Operation Update. Set Order ID to {{ $json.orderId }}. Under Update Fields add Tags with the value {{ $json.newTags }}. Use Admin API version 2026-04 on the credential so the order update behaves as documented.
  6. Add a Telegram node named “Notify wholesale queue” as the last step. Attach your Telegram bot credential, set Chat ID to your B2B channel id, and set the Text to a short message that references the earlier node, for example:
    New wholesale order {{ $('Prep wholesale fields').item.json.orderName }}
    Customer: {{ $('Prep wholesale fields').item.json.customerName }}
    Total: {{ $('Prep wholesale fields').item.json.total }}
    Tagged wholesale-queue for the B2B fulfillment team.

    Referencing the Set node by name matters here, because after the Shopify update step the current $json is the Shopify response, not your prepared fields.

  7. Save, then toggle the workflow to Active. Place a test order from a customer account tagged wholesale and confirm the order picks up the wholesale-queue tag and the Telegram message arrives.
💡

Tip: prefer a schedule instead of a live webhook? Swap node 1 for a Schedule Trigger plus a Shopify “Get Many” orders step filtered to recent, unfulfilled orders. The rest of the workflow stays the same. The webhook version is lighter and near instant, so it is the better default for routing.

Common mistakes

  • Reading the wrong tags. {{ $json.tags }} is the order tag string, while {{ $json.customer.tags }} is the customer tag string. The routing decision must read the customer tags, or brand-new trade accounts never match.
  • Overwriting order tags. A Shopify order update replaces the entire tag list. If you set Tags to just wholesale-queue you erase anything already there. Always append, as the Set node does.
  • Referencing $json in the Telegram text. After the Shopify update, $json is the Shopify order response. Pull your display fields from $('Prep wholesale fields') instead so the message shows what you prepared.
  • Guest checkouts with no customer. A rare order can arrive without a customer object. The contains check treats a missing value as no match, so guest orders route to retail, which is the safe default here.
  • Leaving the workflow inactive. The orders/create webhook is only registered while the workflow is Active. If nothing fires, check the Active toggle first.

Cost at realistic volume

Everything in this workflow sits inside free tiers at normal store volume. Telegram bot messages are free with no cap that a store would reach. The Shopify Admin API is included with your plan and rate limits are generous for one tag write per wholesale order.

On n8n, one order equals at most two executed steps that count against usage: the webhook plus the update and alert for wholesale orders, and effectively nothing for retail orders since they exit at the IF node. A store doing 60 wholesale orders a month runs about 60 execution paths. On n8n Cloud’s entry plans that is a rounding error, and on self-hosted n8n it is free. Realistically this workflow costs you nothing to run and saves the minutes per order a person would otherwise spend sorting trade from retail.

Download the ready-to-import template

The guide above is free to follow, and building it by hand takes about 20 minutes. The template is the same validated workflow as a single .json import, so you skip the build and just add your credentials. Prefer it done for you? Our done-for-you setup service installs and tests it on your instance.

Download the template ($13) →

Instant download · Works on n8n Cloud and self-hosted

FAQ

Do I need Shopify Plus or a B2B plan for this?

No. This routing runs entirely on customer tags and the standard Admin API, so any Shopify plan works. You mark wholesale accounts with a customer tag like wholesale, and n8n reacts to that tag on every new order. You do not need the native B2B channel or Shopify Plus company profiles for it to function.

How does n8n know a customer is a wholesale buyer?

The orders/create webhook payload includes the customer object, and that object carries the customer tags string. The IF node checks whether that string contains the word wholesale. If you tag your B2B accounts with wholesale in Shopify admin, every order they place is detected automatically, with no manual lookup on your side.

Will tagging the order overwrite existing order tags?

Not with this template. The Shopify order update replaces the full tag list, so the Set node first reads the order’s current tags and appends wholesale-queue to them. A guest order with no tags simply gets wholesale-queue, and an order that already carries tags keeps them all plus the new one.

Can I send the alert to Slack or email instead of Telegram?

Yes. Swap the final Telegram node for a Slack or Gmail node and map the same fields the Set node prepared: order name, customer name, and total. The routing and tagging logic upstream does not change, so you only replace the last notification step to fit whichever channel your fulfillment team already watches.

What happens to regular retail orders?

Nothing. The IF node has two outputs, and retail orders leave through the false branch, which is not connected to anything. They flow through your normal fulfillment untouched. Only orders from customers tagged wholesale get the wholesale-queue tag and trigger the Telegram alert to your B2B team.

Related guides