diff --git a/ecommerce_integrations/unicommerce/product.py b/ecommerce_integrations/unicommerce/product.py index 77a8f8d9..ea61d98a 100644 --- a/ecommerce_integrations/unicommerce/product.py +++ b/ecommerce_integrations/unicommerce/product.py @@ -271,6 +271,9 @@ def _build_unicommerce_item(item_code: ItemCode) -> JsonDict: item_json["enabled"] = not bool(item.get("disabled")) for barcode in item.barcodes: + if not item_json.get("scanIdentifier"): + # Set first barcode as scan identifier + item_json["scanIdentifier"] = barcode.barcode if barcode.barcode_type == "EAN": item_json["ean"] = barcode.barcode elif barcode.barcode_type == "UPC-A": diff --git a/ecommerce_integrations/unicommerce/tests/fixtures/simple_item.json b/ecommerce_integrations/unicommerce/tests/fixtures/simple_item.json index 472ce91a..74e33ca6 100644 --- a/ecommerce_integrations/unicommerce/tests/fixtures/simple_item.json +++ b/ecommerce_integrations/unicommerce/tests/fixtures/simple_item.json @@ -10,7 +10,7 @@ "categoryCode": "Products", "name": "TITANIUM WATCH", "description": "This is a watch.", - "scanIdentifier": "TITANIUM_WATCH", + "scanIdentifier": "73513537", "length": 100, "width": 100, "height": 50,