Employee at a wholesale trade counter reading a WhatsApp message on her phone
Saysimple platform
8 min read

Automatically Route WhatsApp Chats per Branch with Customer Data from Your ERP or CRM

Portrait of Kevin van der Storm

Summary

Wholesalers with several branches often want one WhatsApp number for all customers, while each chat still needs to reach the branch that serves that customer. With the Saysimple Flow Builder, every incoming message passes an opening hours check, a lookup in your ERP or CRM and a routing step, so the chat lands with the right branch team automatically. This article explains the flow step by step, with examples of the logic and conditions.

TL;DR

  • One number, every branch. All customers message the same WhatsApp number. The flow decides which branch team picks it up.
  • Your ERP or CRM knows the customer. An HTTP Request looks up the phone number and returns the branch, customer number, company name and sales representative.
  • Nobody gets lost. Unknown customers choose their branch from a WhatsApp list, and an overflow team catches whatever the flow can't place.

Think of a wholesaler with 10 branches, each with its own team of 4 people. Customers don't want to look up which number belongs to which branch. They just want to send a WhatsApp and get an answer from the people who know them. That is exactly what this flow does, on one WhatsApp channel with 10 teams and 40 users.

What does branch routing do?

Every incoming WhatsApp message goes through the same flow. Saysimple checks whether you are open, recognises the customer through your ERP or CRM, saves the most useful customer data on the contact profile and assigns the chat to the team of the right branch.

Why wholesalers use it

  • One easy number. Customers save one WhatsApp number, whatever branch they buy from.
  • Straight to the right people. Chats go directly to the branch that knows the customer and their orders. No forwarding between branches.
  • Context before the first reply. The agent sees the branch, customer number, company name and sales representative in the contact profile.
  • Clear ownership. Each branch team only sees its own chats, and the overflow team handles the rest.

How does the flow work?

Flow diagram: an incoming WhatsApp message passes an opening hours check, an HTTP request to the ERP, set variables and custom fields, then a Variable Flow assigns the chat to the right branch team.
  1. Incoming message. A customer sends a WhatsApp to your number and the flow starts.
  2. Opening hours. The customer gets a welcome message or an away message.
  3. ERP or CRM lookup. An HTTP Request asks your system who belongs to this phone number.
  4. Set variables. The answer is split into separate values, such as the branch.
  5. Set custom fields. Those values are saved on the contact profile in Saysimple.
  6. Variable Flow. The branch value decides the route.
  7. Assign to team. The chat lands in the inbox of the right branch team.

Step 1: How does the opening hours check work?

The Opening Hours node checks the moment the message comes in against your opening hours, per day and in your own time zone. It has two outputs: open and closed.

Opening hours logic: during opening hours the customer gets a welcome message, outside opening hours an away message, and both paths continue to the ERP lookup.

Both paths continue to the customer lookup. A message that comes in at night is routed straight away, so the right branch finds it waiting in the morning. Personalise the welcome with variables such as {{contact.name}}.

Step 2: How do you look up the customer in your ERP or CRM?

Add an HTTP Request node. It calls your ERP or CRM with the phone number of the person who sent the message. The examples below use an ERP, but the setup is the same for a CRM: any system with an API that can find a customer by phone number works.

  • Method: GET
  • URL: your ERP or CRM endpoint with the phone number as a variable, for example https://erp.example.com/customer?phone={{contact.phone}}
  • Variable name: the name for the answer, for example ERPContacts
  • Authentication: stored credentials or a header such as Authorization, so your API key is not visible in the flow

Use the Test button in the node to see the response of your system. You need its field names in the next step.

Which data comes back?

Example mapping of ERP fields to flow variables and Saysimple custom fields: branch, customer number, company name and sales representative.

Step 3: How do you save the data on the contact profile?

With a Set Variable node per value, you take one field from the response, for example {{ERPContacts.BranchName}}, and store it as the variable branch. Then a Set Custom Field node writes those variables to the custom fields of the contact.

The result: whoever opens the chat sees right away which branch, customer number, company and sales representative belong to this customer. The data stays on the profile for every next conversation too.

Step 4: How does the flow pick the right branch?

A Variable Flow checks the branch variable. Every branch gets its own rule with the operator contains, and every rule leads to an Assign to Team node for that branch.

Example Variable Flow rules: one rule per branch checks whether the branch variable contains the branch name and assigns the chat to that team; the Else path sends a list message.

Why contains? Names in your ERP or CRM are often longer than your team names, for example Wholesale Utrecht North. With contains Utrecht the rule still matches. Make sure no branch name is part of another one, or the first matching rule wins.

What happens when the branch is not recognised?

A new customer, a different phone number or an empty branch field ends up on the Else path. The flow then asks the customer which branch they want to contact.

Routing diagram: if the branch is found the chat goes to that branch team; if not, the customer chooses a branch from a WhatsApp list; without an answer or with Other, the chat goes to the overflow team.
  • WhatsApp list message. The customer picks their branch from a list, and the flow assigns the chat to that team.
  • Typed answers. Customers who type a branch name instead of tapping the list are caught by a keyword check and routed the same way.
  • No answer. After a set time the customer gets one reminder. A Counter makes sure that happens only once.
  • Overflow team. Still no choice, or the customer picks Other? One branch acts as the overflow team. They pick up the chat and pass it on internally.

What does this look like for your teams?

Everything runs on one WhatsApp channel. In Saysimple you create a team per branch, in this example 10 teams with 4 users each. Every team works in the shared inbox but only sees the chats assigned to them. Agents can always hand a chat over to another branch if a customer turns out to belong elsewhere.

What should you watch out for?

  • Phone number format. The number in WhatsApp is international, for example +31612345678. If your ERP or CRM stores 0612345678, the lookup finds nothing. Normalise the numbers in your system or in the API.
  • Exact branch names. The rules in the Variable Flow have to match the names your system returns. Check them against a test response.
  • Ten options per list. A WhatsApp list message shows up to 10 options. With more branches, group them by region or ask the customer to type the branch name.
  • Only what you need. Fetch and save only the fields your teams actually use.
  • A clear overflow team. Agree which team takes the overflow, and how they pass chats on.

Troubleshooting

Troubleshooting table for WhatsApp branch routing with an ERP lookup: common problems, their likely cause and what to do.

Frequently asked questions

Does this work with any ERP or CRM?
Yes, as long as your ERP, CRM or a layer in between offers an API that can find a customer by phone number and return the data as JSON.

Do I need a developer?
For the API connection, often yes: someone has to make the endpoint available and provide access. The flow itself you build in the Flow Builder without code.

Do I need a separate WhatsApp number per branch?
No. All branches share one WhatsApp channel. The routing happens in the flow.

What if a customer is linked to the wrong branch in the ERP or CRM?
The agent hands the chat over to the right team and updates the branch in your system. The next lookup then routes correctly.

Does the flow run again for every reply?
You decide. The flow nodes have an option not to trigger on replies, so a customer who is already talking to a branch is not sent through the routing again.

Can the sales representative get a notification?
The sales representative is saved on the contact profile. You can use that field to assign the chat to them or to inform them, depending on how your teams work.

Get more out of every conversation

Discover how Saysimple centralizes your customer communication, connects your teams, and automates processes.

Book a demo
Saysimple-inbox met een klantgesprek over rode gevelstenen
Woman sitting in a car using her phone

See what Saysimple neo looks like in your business.

Book a 30-minute demo. We'll walk through your use case, whether that's order desk automation, WhatsApp campaigns or ERP integration, and show you exactly how Saysimple neo works for B2B Commerce teams.

Trusted by 500+ customers

KlantKlantKlantKlant