> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://doc.common-services.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Fix “External Product ID Is Shorter Than the Minimum Allowed (13 Characters)” - Amazon Marketplace Plus

When sending a product to Amazon, you may receive the following error message:
> **The value of “External Product ID” is shorter than the minimum allowed (13 characters).**

---

## What Does This Error Mean?

Amazon requires a valid 13-digit EAN barcode for the affected product or combination. This error occurs when:
* The barcode entered in PrestaShop contains fewer than 13 digits.
* A 12-digit UPC code was entered into the **EAN-13** field without a leading zero.

---

## Correcting One Product Manually

1. In PrestaShop, navigate to **Catalog > Products**.
2. Open the affected product.
3. Check the **EAN-13** field.
4. If the error concerns a combination, go to the **Combinations** tab and check the EAN-13 of that specific combination.
5. Correct the barcode, click **Save**, and re-verify the product in the Amazon module.

### Handling a 12-Digit UPC Barcode
If the barcode contains exactly 12 digits, confirm that it is a valid UPC code. You can convert a valid 12-digit UPC into an EAN-13 format by prepending a **0** at the beginning.

* **UPC:** `123456789012`
* **EAN-13 representation:** `0123456789012`

> **Warning:** Do not add a leading zero to an incomplete, truncated, or invalid barcode.

---

## Correcting Multiple Products Using SQL (Bulk Update)

If you have many products with 12-digit UPC codes stored in the EAN-13 field, you can update them in bulk using SQL queries in phpMyAdmin or your server database manager.

> **Important Recommendations Before Proceeding:**
> * Always create a **full database backup** before executing any `UPDATE` queries.
> * Always run the `SELECT` queries first to verify which rows will be modified.
> * Replace `ps_` with your actual database prefix if your store uses a custom prefix (e.g., `prestashop_`).

---

### Step 1: Preview Affected Products (SELECT Queries)

Run these queries first to verify which products and combinations contain 12-digit barcodes:

#### Standard Products (Without Combinations):

SELECT id\_product, reference, ean13
FROM ps\_product
WHERE CHAR\_LENGTH(ean13) = 12
AND ean13 REGEXP '^[0-9]{12};

#### Product Combinations:

SELECT id\_product\_attribute, id\_product, reference, ean13
FROM ps\_product\_attribute
WHERE CHAR\_LENGTH(ean13) = 12
  AND ean13 REGEXP '^[0-9]{12}$';

---

### Step 2: Prepend Leading Zero (UPDATE Queries)

After confirming that all returned entries are valid 12-digit UPCs, execute the following queries to add the leading `0` and convert them to 13-digit EANs:

#### Standard Products (Without Combinations):

UPDATE ps\_product
SET ean13 = CONCAT('0', ean13)
WHERE CHAR\_LENGTH(ean13) = 12
  AND ean13 REGEXP '^[0-9]{12}$';

#### Product Combinations:

UPDATE ps\_product\_attribute
SET ean13 = CONCAT('0', ean13)
WHERE CHAR\_LENGTH(ean13) = 12
  AND ean13 REGEXP '^[0-9]{12}$';

---

### Final Step

Once the SQL updates are complete, clear your PrestaShop cache, and resend the affected products to Amazon.