Customer and Company Integrations
The needs of integrating the Customers and Companies between Norce Commerce and other systems may differ quite a lot between clients. The best practice regarding this is dependent on some assumptions:
- The client sells both to consumers and businesses
- Fresh and updated order history is provided by the ERP to the ecommerce applications
- End customers can log in and change their Information on a "My Pages" site, connected with Norce by Norce Commerce Customer Service.
- Customers and Companies is created in Norce Commerce when their first order is received. In the order process the integration is responsible for creating the customer/company in the ERP, If not already there.
- During the order process the integration checks if there is an external code on the customer or company in Norce Commerce. Otherwise, the customer (or company) is created in the ERP during the order process.
- The
CustomerCode
, from the ERP is returned to Norce Commerce using the ImportCustomers / ImportCompanies methods in Norce Commerce Connect.
- If the Customer or Company, that has a code (exists in the ERP) updates its information in the frontend the changes can be sent to the ERP system.
- The integration listens to the events
CustomerChangeNotification
andCompanyChangeNotification
and fetches data using Norce Commerce Query and sends it to the ERP.
- The integration listens to the events
- As a fail-safe, a scheduled job fetches all customers from the ERP, and updates the customer / company code in Norce Commerce.
- The integration calls ImportCustomers and ImportCompanies, sending the bare minimum of information as well as the ERP code.
About the APIs
For system integration with Norce Commerce use:
- Norce Commerce Connect The API used by all system integrations is the Norce Commerce Connect. Read about how use it here: Calling Norce Commerce Connect
- Norce Commerce Query The API used to lookup and fetch data is the Norce Commerce Query. This is a queryable API that exposes Norce Commerces data layer for the solutions. Read about how to use it here: Calling Norce Commerce Query
- Norce Commerce Event Norce Commerce Event starts processes when something has happened in Norce. This is a service bus that the solutions can listen to and subscribe to events. Read about how use it here: Using Norce Commerce Event
Customer integration
In Norce Commerce, Customer's ( people) and Companies are separated in two different entities with relations to each other (organisation - contacts).
If the order systems, like the ERP, does not separate them in the same way. This mapping must be handled by the integration.
Use the Code
field in Norce Commerce, both on Customer and Company entities should have the client solution identifier of the customer/company. This is usually the ERP customer number but can sometimes be the CRM system identifier as well.
Client settings
There is two ways to set up Norce Commerce that makes a difference for the Customer integration.
- Customers / Companies are application unique
- Customers / Companies are client unique
If (1), Norce Commerce allows the same company / customer to have different customer codes on different applications. And (2) will make handle same customers and companies to create orders on several applications. Depending on how this is configured, the integration should be set up different as well.
Importing Customers
To update customers in Norce Commerce, ImportCustomers is called that receives the request as a payload that are then asynchronously handled. A job id
is returned that can be viewed by calling Job/Get
or manually through the Admin UI.
Read about asynchronous integration pattern here: System integration patterns
Description
ImportCustomers takes an enumerable of Customer entities and updates Norce Commerce if changes has been made.
Full and delta updates
Most integrations don't use full imports, only delta. Once a day is the most common frequency.
GDPR and anonymization functionality can be set up in Norce Commerce to automatically scramble customer information. Take this into account when setting up the customer integration.
The Customer object
Some important fields in the Customer object are:
Code
, the external identifier, should be matched to other client systems, like a CRM or ERP.Id
, the internal identifier in Norce. Should not be used to match the entity to anything else. Use this solely for matching back to Norce, like in a cookie or in a memory cache.EmailAddress
, if Code does not exist (yet), use email as the unique identifier.ApplicationKey
, relates the customer to one of the applications, if null, the customers are shared between all applications.
Some important relationships on the Customer object are:
Accounts
, optional entity for creating login functionality. Accounts are bound to one application, each. Cannot have more than one per application.Companies
, if the customer is a contact on an organisation.PriceLists
, if the customer has their own prices or assortments of products.
Importing Companies
To update companies in Norce Commerce, ImportCompanies is called that receives the request as a payload that are then asynchronously handled. A job id
is returned that can be viewed by calling Job/Get
or manually through the Admin UI.
Read about asynchronous integration pattern here: System integration patterns
Description
ImportCompanies takes an enumerable of Company entities and updates Norce Commerce if changes has been made.
Full and delta updates
Most integrations don't use full imports, only delta. Once a day is most common.
The Company object
Some important fields in the Customer object are:
Code
, the external identifier, should be matched to other client systems, like a CRM or ERP.Id
, the internal identifier in Norce. Cannot be set by you, only used for matching to an existing entity.OrganizationNo
, if Code does not exist (yet), use this as the unique identifier.
Some important relationships on the Customer object are:
Customers
, list of contacts, with full information.Contacts
, list if contacts, with just the code. The customer must already exist in Norce.PriceLists
, if the company has their own prices or assortments of products.
Related Event types
Norce Commerce event has several event types that can be used by the integration. Mostly this is needed for notifications to end customers or to other systems.
CustomerChangedNotification
Notification event that a customer has been changed. The solution listens to the event and lookup the Customer in Norce Commerce Query, before sending the notification to an external system.
- Administering Event types
- The Customer entity in Norce Commerce Query
CompanyChangedNotification
Notification event that a company has been changed. The solution listens to the event and lookup the Company in Norce Commerce Query, before sending the notification to an external system.
- Administering Event types
- The Company entity in Norce Commerce Query
Suggested further reading
- Norce Commerce Query
- Query examples in Postman
- Norce Commerce Event
- Norce Commerce Connect
- Connect examples
- Postman examples
- .Net Code examples for Customer integration