Customer Profile

Customer Profile

To activate this feature, please contact your Onestock’s contact.

1. Context & Use Cases

Context

The Customer Profile feature was designed to allow Customer Service (CS) agents to access a centralized view of a customer’s information directly from the OneStock back office, without having to navigate through multiple screens or external tools.

It is an enabler for creating orders from the back office: the standard flow is to search for a customer, view their profile, and then initiate a new order on their behalf.

The feature relies on customer data already present in existing orders in OneStock, without any direct connection to an external CRM.

Connection to an external CRM will be added in a second version of the feature.

Feature Flag

The feature is protected by a feature flag (Customer Profile) allowing progressive activation per customer. This feature flag will be removed once the feature is rolled out generally.

Main Use Cases

image-20260608-101522.png
  • Search for a customer: A CS agent can search for a customer by last name, first name, or email from a dedicated page.

  • View a customer profile: The agent can access the customer’s raw data (identity, contact details, addresses, order list) and calculated data (number of orders, total revenue, average basket, returns, cancellations).

  • View order history: The customer’s order list is displayed from the profile, with the same filters as the Order List page.

  • Create an order: From the search page or the customer profile, the agent can initiate an order and is redirected to the Store App (OIS). OneStock will soon offer a feature to place orders directly from the Back Office.

  • Anonymize a customer: The agent can anonymize a customer’s data and their orders in one click, provided all orders are in a final state. See more info.

  • Access the profile from an order: From an order detail page, a link allows direct navigation to the associated customer profile.

2. Feature Benefits

 

  • Unified customer view: All information is centralized in a single interface, avoiding back-and-forth navigation.

  • Time savings for Customer Service: Quick search by last name, first name, or email speeds up customer request handling.

  • Effortless calculated data: Total revenue, average basket, number of returns, and cancellations are automatically calculated from the last 100 orders.

  • Enabler for order creation: The customer profile serves as a natural starting point for initiating an order on behalf of the customer from the BO.

  • Simplified GDPR compliance: Bulk anonymization of a customer and their orders is possible in one click from the profile.

  • Extensibility: Extension points (anchors) are available on the search page and customer profile to plug in external tools (e.g. Zendesk) via the UI extension system.

  • Independence from external CRMs: OneStock manages its own customer database and is not dependent on the rules of a third-party CRM for data management.

3. Configuration

Module activation

The Customer Profile module can be enabled or disabled from Configuration > Modules.

  • When the module is enabled, a new Customer Profile tab appears in the back-office menu.

  • By default, the module is visible in the general configuration (config gen).

Disabling the module does not prevent access to customer data in the database. Only the interface is hidden.

 

Customer Profile configuration page

The module has its own configuration page, accessible via Configuration > Customer Profile.

  • The page remains visible even if the module is not enabled.

 

“Create Order” button

A toggle in the Customer Profile configuration allows the Create Order button to be shown or hidden on the search and customer profile pages.

Situation

Default behavior

Situation

Default behavior

General configuration

Button enabled

Customer with OIS enabled

Button enabled

Customer without OIS enabled

Button disabled

This configuration is a beta version of the order creation feature from the back office. For now, order creation redirects to OIS when OIS is configured, and soon this button will open a real order creation funnel in the BO itself.

 

Access rights

The Customer Profile page is accessible to the same roles as the order management pages. Refer to the documentation Unified user management (end users) for details about roles.

Anonymization – Final state configuration

A customer can only be anonymized if all their orders are in a final state. The list of states considered final is configurable.

  • Default: fulfilled, removed

  • If the list is empty, all orders can be anonymized.

  • The configuration is done in the common file (and not in config gen).

 

Refer to the documentation Anonymization Configuration for more details about how anonymization works in OneStock.

When anonymization is launched from the customer profile, the following operations are executed:

  1. Check that all orders are in a final state (configurable).

  2. Anonymize customer data in the orders database.

  3. Anonymize address data in the orders database.

  4. Remove the customer ID from the associated orders.

  5. Delete the data from the customer database.

If an order is locked by another process, a retry is triggered (every 3 minutes, with the default number of attempts). Datadog monitoring is in place to alert in case of an anomaly.

4. Functional behavior

4.1 Search page

The search page is accessible via the Customer Profile tab in the back-office menu.

  • Search is performed by last name, first name, and/or email (combinations are possible).

  • Search is partial (beginning or end of a field) and case-insensitive.

  • Results display a maximum of 10 entries, with no pagination or scrolling.

  • A Create Order button is present if the configuration toggle is enabled.

4.2 Customer profile

By clicking a search result, the agent accesses the customer profile. The URL contains the customer’s internal ID. If the ID does not exist, a 404 error redirects to the search page.

Displayed raw data

  • Last name, first name, email, phone number

  • Favorite shipping address (or fallback to the last order)

  • Favorite billing address (or fallback to the last order)

  • Ability to view all addresses in a modal (maximum 10 addresses)

Displayed calculated data

This data is calculated based on the customer’s last 100 orders.

Indicator

Description

Indicator

Description

Total revenue

Sum of order amounts

Average basket

Total revenue / number of orders (truncated to 2 decimals)

Number of returns

Orders with parcel return

Please share your needs regarding the calculated data to display so the feature can be completed.

Order list

  • Orders are displayed from most recent to least recent.

  • Pagination of 25 orders (same behavior as the Order List page).

  • The available filters are the same as on the Order List page (Order, Items, Stock Location by default).

  • Clicking an order opens the detail page; the browser back button allows returning to the customer profile.

  • The Ask AI filter is not available on this view.

4.3 Customer anonymization

Anonymization is accessible from the customer profile via a dedicated button.

  • A pop-in opens and checks whether the customer can be anonymized.

  • Anonymization possible: no associated order is currently being processed (all are in a configured final state).

  • Anonymization impossible: at least one order is still in progress. A message invites the agent to check the orders.

  • After successful anonymization, the agent is redirected to the search page.

  • Configuration: Customer Profile

Anonymization from the customer profile is “all or nothing”: if an order cannot be anonymized, no action is performed and an error message is displayed.

4.4 Access to the profile from an order

From an order detail page, the “X orders” button in the Customer Details block redirects to the associated customer profile — only if the Customer Profile module is enabled. Otherwise, the existing behavior is kept.

If the customer is anonymized but not the order, this button is not accessible because no match is found between the order’s customer ID and the customer database.

 

5. Technical operation

5.1 Customer database

OneStock has its own customer database (internal CRM), automatically populated whenever an order is created or imported.

Uniqueness rules

  • The internal OneStock ID is the customer uniqueness marker.

  • An email cannot have duplicate customers in the database.

  • Order of precedence for customer resolution: customer_id > external_id > email.

Creation / update rules

  • When creating/importing an order, we check whether the order is posted with a customer_iD or external_id.

    • If there is a external_id, see the section bellow

    • If there is a customer_id, the order is simply linked to the right customer.

    • If not, we search for a match by email.

      • If a match is found via email (or externalId/customerId), the order is linked to the existing customer.

      • If no match is found, a new customer is created and the order is linked to them.

  • Anonymized orders are not linked to any customer profile.

image-20260609-151551.png

 

External ID management

  • If an external_id is provided in the order, it is used to avoid creating duplicates, with priority over the email.

  • If several customers have the same external_id, the first one found is used and a warning log is emitted.

Specific case: email with several customer IDs

If the same email address is associated with several customer IDs (e.g. orders with distinct customer IDs), resolution is done arbitrarily by taking the most recently used customer.

In the case of a POST /orders without a specified customer_id, but where the email matches several customers in the database, we take the most recently used customer.

Database structure

A customer in the CUSTOMER database consists of an ID, an external ID, contact information (first_name, last_name, phone_number, email), and an address book.

Customer { ID ExternalID Contact Addresses FavoriteAddresses Information } Contact { Title FirstName LastName CompanyName PhoneNumber MobileNumber Email }

5.2 Search and indexing

  • Search relies on Elasticsearch indexing of customer data.

  • Partial and case-insensitive search is handled at index level.

  • Results are limited to 10 entries with no pagination.

5.3 Calculated data

  • The calculation is performed on the fly on the front end, based on the customer’s last 100 orders (for performance reasons).

  • All calculation logic is extracted into a dedicated composable or set of functions.

5.6 Management of orders imported via RabbitMQ

Orders imported via RabbitMQ (POST orders via Rabbit) now trigger the same customer resolution/creation process as orders created via HTTP. Routes related to external orders are excluded from this processing.

5.8 Extensions (injection points)

Extension anchors are available on the Customer Profile page:

  • Customer profile page: two types of anchors are available:

    • Below the customer’s raw information bo.customer.tab

    • As an additional tab on the profile (accessible from the URL) bo.customer.information

Extensions can access information from the customer database (customer ID, etc.). Refer to the documentation UI Extensibility - How to develop UI Extensions for details about the available anchors.

 

6. Migration script

Objective

The migration script populates the customer database from existing orders in OneStock, so that the feature is operational as soon as it is enabled.

Scope

  • Only non-anonymized orders are processed.

  • For each email address found, a customer document is created (or updated) in the database.

  • If a document with the same email address already exists, its information is replaced with that of the processed order.

Migration rules

  • Last name / first name / phone: information from the last order placed is kept.

  • Addresses: the last shipping and billing addresses are set as default addresses; the others populate the address combo.

Activation process

The feature is activated by batch (customer by customer) via the feature flag. Customers with a low order volume (e.g. Eres, Givenchy for the beta) are prioritized.

Load tests were carried out to validate the script’s performance. Only around 10 customers have more than 1 million orders per year, which remains manageable.

Tracking and monitoring

A Datadog monitoring dashboard is set up to monitor:

  • The influx of OMS → CRM messages (input queue size).

  • The influx of CRM → OMS messages.

  • The percentage of 500 errors.