Who is the customer?
Lesson 6 of 12 7 min read
Decide how each WooCommerce order is matched to a customer Party, including guests, one-account setups and trade customers.
Every order needs a customer before your inventory system will accept it. Some businesses want each shopper as their own customer; others want every web order on a single "Web Sales" account; trade businesses need orders matched to an existing account code. In this lesson you'll choose the settings that give your business the right answer.
The building blocks
Supply Lens stores customers as Parties. A Party can carry identifiers: extra values, such as an email address or an account code, that Supply Lens uses to recognise the same customer arriving from different systems. The settings below decide which identifiers an order brings in, and which Party is used when no match is found.
Decision 1: one account, or one per customer?
| defaultCustomerId | The platform customer to use when an order has no identifiable customer information. A fallback for orders that would otherwise have no customer. |
|---|---|
| alwaysSetDefaultCustomerId | When true, defaultCustomerId is used for every order, whether or not a customer could be identified. Choose this when all web orders should sit under one generic customer account. |
- All web sales on one account? Set
defaultCustomerIdto that Party and turnalwaysSetDefaultCustomerIdon. - Each shopper as their own customer? Leave
alwaysSetDefaultCustomerIdoff. Still setdefaultCustomerIdas a safety net for orders with no customer details.
Decision 2: what about guest checkouts?
| guestPartyId | The platform customer assigned to guest checkout orders (WooCommerce customer ID 0). Lets you track guest purchases separately from orders by registered customers. |
|---|
A shopper who checks out without an account has no WooCommerce customer record. Pointing
guestPartyId at a dedicated Party, for example Web Guest, keeps those orders together
and out of your registered customers' accounts.
Decision 3: how should customers be recognised?
| includeBillingEmailAsCustomerIdentifier | When true, the billing email is added as a customer identifier of type woo-commerce-billing-email, so customers can be matched by billing email address. |
|---|---|
| customerIdentifierMetaDataKey | A WooCommerce metadata key whose value is used as a customer identifier. Use it when a plugin stores something like a trade account number on the order. |
| continueIfCustomerIdentifierMetaDataMissing | When true, the order is still imported if the metadata key above is missing. When false, orders without it are rejected. |
Metadata is extra information stored against a WooCommerce order, usually by a plugin or a custom checkout field. Each piece has a key (its name) and a value.
When should orders without the identifier be rejected? If every order must belong to a
known trade account and an order without one would be a mistake, set
continueIfCustomerIdentifierMetaDataMissing to false so those orders are held for
someone to look at. If your store takes both trade and retail orders, and only trade
orders carry the key, set it to true.
Good to know
This diagram shows how the settings relate. The settings guide doesn't spell out the exact order in which Supply Lens checks them, so test your own combination with real sample orders.
Two kinds of customer at Fernbrook
Fernbrook sells to the public and to a handful of spas. Spas log in and a plugin stores
their Unleashed customer code on each order under the key trade_account.
Priya sets customerIdentifierMetaDataKey to trade_account so spa orders match their
existing accounts. Because retail orders don't carry that key, she sets
continueIfCustomerIdentifierMetaDataMissing to true. She turns on
includeBillingEmailAsCustomerIdentifier so returning retail shoppers are recognised,
points guestPartyId at a Web Guest Party, and sets defaultCustomerId to a Web Sales
Party as the fallback. alwaysSetDefaultCustomerId stays off.
Recap
alwaysSetDefaultCustomerIdwithdefaultCustomerIdputs every order on one account.defaultCustomerIdalone is a fallback for orders with no identifiable customer.guestPartyIdsends guest checkouts to their own Party.- Billing email and a metadata key can both be used as customer identifiers.
continueIfCustomerIdentifierMetaDataMissingdecides whether orders without the metadata key are imported or rejected.
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.