Supply Lens

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?

defaultCustomerIdThe platform customer to use when an order has no identifiable customer information. A fallback for orders that would otherwise have no customer.
alwaysSetDefaultCustomerIdWhen 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 defaultCustomerId to that Party and turn alwaysSetDefaultCustomerId on.
  • Each shopper as their own customer? Leave alwaysSetDefaultCustomerId off. Still set defaultCustomerId as a safety net for orders with no customer details.

Decision 2: what about guest checkouts?

guestPartyIdThe 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?

includeBillingEmailAsCustomerIdentifierWhen 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.
customerIdentifierMetaDataKeyA 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.
continueIfCustomerIdentifierMetaDataMissingWhen 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.

Rendering diagram...

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

  • alwaysSetDefaultCustomerId with defaultCustomerId puts every order on one account.
  • defaultCustomerId alone is a fallback for orders with no identifiable customer.
  • guestPartyId sends guest checkouts to their own Party.
  • Billing email and a metadata key can both be used as customer identifiers.
  • continueIfCustomerIdentifierMetaDataMissing decides whether orders without the metadata key are imported or rejected.

Quick guides for this topic

Complete and continue

Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.