---
title: "Configuring scanner identifiers for customer profiles"
slug: "configuring-scanner-identifiers-for-customer-profiles-1"
tags: ["identifier", "config api", "Associate App configuration", "Associate App", "scan", "configuration", "customer", "customer profile", "tutorial", "api", "scanner", "profile"]
updated: 2024-11-12T12:56:27Z
published: 2024-11-12T12:56:27Z
canonical: "docs.newstore.com/configuring-scanner-identifiers-for-customer-profiles-1"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newstore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring scanner identifiers for customer profiles

This feature enables the scanner to identify whether the scanned code such as QR code or barcode contains customer information that can be utilized in the customer profile search. When a match is found during the scan, the app navigates to the customer profile search using the value extracted from the code.

The search functionality doesn't support searching within extended attributes.

The supported fields include:

- **displayId:** Specified by the retailer during imports.
- **email:** An email ID of the customer.
- **fullName:** The full name of the customer.
- **phoneNumber:** An E.164 formatted phone number.

## Pre-requisites

The feature is disabled by default. To enable scanner identifiers for your business:

1. Use the [Update app configuration](https://docs.newstore.net/api/configuration/apps/associate-app-config-api_config#operation/putConfig).
2. Set `release_toggle` > `new_customer_profile` to `true`.

> [!NOTE]
> Important
> 
> Enabling this feature will disrupt any active custom app extensions that you have configured for customer profile screens in the app.
3. For `customizations` > `customer_profile_scanner_identifiers`, add multiple identifier objects containing a `scanner_code_type` and a corresponding `regex` pattern.

> [!TIP]
> Note
> 
> The first matching identifier will be used. We recommend you to arrange the identifiers in a hierarchical order, starting with the most precise ones and progressing towards more abstract ones.

> [!NOTE]
> Important
> 
> After making any changes to the configuration, restart all running apps for the identifiers to take effect.

## Scanner code types

To identify the code type, use the following number values:

| **code type** | **value** |
| --- | --- |
| QR | 1 |
| Databar | 2 |
| Databar Expanded | 4 |
| EAN8 | 8 |
| EAN13 | 16 |
| UPCA | 32 |
| UPCE | 64 |
| Data Matrix | 128 |
| code39 | 256 |
| code93 | 512 |
| code128 | 1024 |
| pdf417 | 2048 |
| interleaved 2 of 5 | 4096 |

## Regex

The regex patterns support JavaScript syntax.

The first regex group `()` can be used to extract the search string to be used in the profile search.

> [!CAUTION]
> Danger
> 
> Do not use regex patterns that match EAN13 codes, such as `2900010002910`. For example, `^[0-9]+$`. Using such patterns will disrupt product scanning functionality.

To avoid regex patterns matching existing identifiers, you can use regex groups with a prefix or suffix, such as `email:...` or.

> [!NOTE]
> Important
> 
> - Don't use JSON strings in the code values, as they will not work for profile identification.
> - Don't use values in your codes that match the following reserved regex patterns, as they are intended for identifying other items such as orders or baskets:
> 
> `/^(.*)\$MGRAPPR$/i`
> 
> `/^(https?:\/\/.*)\$BASKET$/i`
> 
> `/&lt;open_logistic_order&gt;&lt;([\w-]+)&gt;/`

## Example

The scanner identifiers for customer profiles:

```json
{
    "customizations": {
        "customer_profile_scanner_identifiers": [
            {
              "scanner_code_type": 1,
              "regex": "^email:(.+@[^\\.].*\\.[a-z]{2,})$"
            },
            {
              "scanner_code_type": 1024,
              "regex": "[0-9]{9}"
            }
        ]
    }
}
```

**Related topics**

- [Configuring auto-populated fields for customer profiles](/v1/docs/configuring-auto-populated-fields-for-customer-profiles#config-aa-customer-profile-auto-populate)

<style> p[data-block-id] {font-size:1rem;} ul li p[data-block-id] {margin-bottom: 0;} ul[data-type="taskList"] li div p[data-block-id] {margin-bottom: 0;} ol li p[data-block-id] {margin-bottom: 0;} table tbody th p[data-block-id] { margin-bottom: 0;} blockquote p[data-block-id] {margin-bottom: 0 !important;} &nbsp;p[data-block-id]:empty::after {content: "\00A0";} </style>
