Populate barcodes from customer metafield

When enabled, customer barcodes will be updated when a customer is created/updated. Deleted metafield will result in a deleted barcode.

Only single value non-list and not deprecated types such as "number_integer" or "single_line_text_field" are supported. Learn more about metafields and metafield types.

Identify the metafield namespace and key

First, ensure you've added the required metafield. Then, to enable the "Metafield to barcode sync" feature, identify the namespace and the key of the created metafield.

Go to the customer metafields in Shopify Admin ("Settings" > "Metafields" > "Customers") and copy the namespace and the key. Note that a dot (.) separates them. Hence if your metafield's namespace and key value are "dummy_namespace.dummy_key", then dummy_namespace is the namespace, and dummy_key is the key.

Save the namespace and key in the app's settings

  1. Go to the app's "Settings" page.

  2. Check the "Sync metafield with barcode" checkbox.

  3. Enter the previously identified namespace and key, e.g. dummy_namespace and dummy_key.

  4. Uncheck the "Skip the update in the barcode is already assigned to a different customer" checkbox (Optional).

  5. Save.

Currently, only one unique custom barcode per customer is supported. If the created/updated customer's metafield contains a barcode already assigned to another customer, the sync will be skipped by default.

This behaviour can be changed by unchecking the "Skip the update in the barcode is already assigned to a different customer" checkbox. If unchecked, the app will delete the barcode from the other customer's profile and assign the barcode to the new customer.

Test

  1. Create or update a customer.

  2. Validate that the value in the customer's metafield appears in the "custom barcode" text field in the app's customer profile.

The app relies on the "CUSTOMERS_UPDATE" webhook. There may be a short delay between the customer being created/updated and the app receiving the notification and updating its database.

Last updated