Skip to main content

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.

  2. Set release_toggle > new_customer_profile to true.

    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.

    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.

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 typevalue
QR1
Databar2
Databar Expanded4
EAN88
EAN1316
UPCA32
UPCE64
Data Matrix128
code39256
code93512
code1281024
pdf4172048
interleaved 2 of 54096

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.

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 ....

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

    /<open_logistic_order><([\w-]+)>/

Example

The scanner identifiers for customer profiles:

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

Related topics