How should customers be found and created?
Lesson 12 of 24 8 min read
Choose how Supply Lens matches each order to an Unleashed customer, whether it may create or update customers, and what happens on stop credit.
Getting the customer right is the decision with the longest tail. Match on the wrong thing and orders land on the wrong account; update too eagerly and Supply Lens overwrites details your credit controller carefully set in Unleashed. This lesson takes you through the matching options, the create and update rules, and stop credit.
Decision 1: how is the customer matched?
Supply Lens always looks the customer up. You choose what it matches on.
| allowCustomerSourceIdentifierForCustomerCode | On by default. The source system's customer identifier may be used as the Unleashed customer code when looking up or creating customers. This is matching by code. |
|---|---|
| searchForCustomersByEmail | Find the customer by the email address of a customer contact instead of by code. The order fails if the contact has no email, if no customer has that email, or if more than one does. |
| searchForCustomersByEmailTagMap | Turns the email search on or off for orders with a matching tag. searchForCustomersByEmail applies when no tag matches. |
Supply Lens can also match by name. Speak to your Supply Lens contact if you need that option.
When to use which
- Match by code when your channel and Unleashed share a customer code, or when Supply Lens should create customers using the channel's identifier. It suits web shops that create new customers every day.
- Match by email when the source system knows who the customer is but has no shared code, and every customer already exists in Unleashed. It suits B2B portals with a fixed customer list.
Email search does not create customers
With searchForCustomersByEmail on, an email that matches no customer is treated as an error and the order fails. Supply Lens does not create the customer in this configuration. Do not use email search for a channel that sends new customers.
Email search and API calls
Matching by code uses a memory store, so ten orders for one customer in a run look it up once. Email search currently looks up every order, so ten orders make ten calls. Bear this in mind for high-volume channels.
Decision 2: create and update, or create only?
When an order arrives for a new customer, Supply Lens creates the customer before sending the order. It also writes the customer record whenever it holds no resolved Party for that customer. If you never cross-reference your customers in Supply Lens, that means every order, unless you tell it not to.
| skipCustomerUpdateIfExists | When true, existing customers are never updated; only new ones are created. Choose this when customer data is managed in Unleashed. |
|---|---|
| prioritiseNameForCustomerName | When true, the individual's name is preferred over the company name for the customer name. Use it for consumer channels where most orders have no company. |
| customerExcludeEmailAddress | When true, the customer's email address is not sent to Unleashed. |
Customer writes replace the whole record
The customer is written as a whole object. That means a value Supply Lens sends replaces whatever was there, every time it writes. If your team edits customers in Unleashed, turn on skipCustomerUpdateIfExists so Supply Lens populates new customers once and then leaves them alone.
Decision 3: what happens on stop credit?
| failIfCustomerOnStopCredit | When true, the order fails if the matched customer has Stop Credit on in Unleashed. |
|---|---|
| runMapsOnCustomerStopCredit | A list of map IDs to run when the customer is on stop credit, instead of failing. Use it to route the order to a different workflow. |
Choose fail when no order should reach Unleashed for a customer on stop, and someone will act on the failure. Choose run maps when you want a defined alternative, such as alerting the credit team, rather than a hard failure. Your Supply Lens contact will set up the maps.
Two channels, two strategies
Hilltop's Shopify consumers are new every day, so Priya keeps matching by code, which lets Supply Lens create them. She turns on prioritiseNameForCustomerName because consumers rarely have a company name.
Hilltop's cafés are set up in Unleashed by the accounts team, with negotiated terms. They now order through a B2B portal that identifies them only by email. For that channel, Priya uses searchForCustomersByEmailTagMap to switch email search on for portal orders, turns on skipCustomerUpdateIfExists so accounts' changes are never overwritten, and turns on failIfCustomerOnStopCredit.
Recap
- Code matching is the default and lets Supply Lens create new customers; email matching needs every customer to exist already.
- An email search that finds no customer, or several, fails the order on purpose.
- Customer writes replace the whole record; use
skipCustomerUpdateIfExistswhen Unleashed owns customer data. - On stop credit, choose between failing the order and running alternative maps.
Quick guides for this topic
Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.