Uploading a broken inventory flat file to Amazon Seller Central usually wastes 15 to 45 minutes waiting on a processing report, only to hit error codes like 8016, 8560, or 8801 caused by Excel stripping leading zeros off UPC-12 barcodes or broken parent-child variation links.

Meanwhile, most online flat-file validators require uploading confidential wholesale catalogs and unreleased pricing to a remote server.

Here is how we built a 100% browser-local Amazon flat file preflight engine using self-hosted SheetJS 0.20.3 and pure ESM JavaScript:

1. Safe Browser-Local Parsing of Multi-Tab Seller Central .xlsx / .xlsm Templates

Amazon category templates ship with Instructions, Images, Example, Data Definitions, Valid Values, and a Template tab where row 1 is metadata (TemplateType=fptcustom), row 2 is human labels, row 3 is technical keys (item_sku, parent_child, external_product_id), and data begins on row 4.

To parse them safely in browser memory:

  1. Vendor patched SheetJS 0.20.3 (fixes CVE-2023-30533 and CVE-2024-22363) and lazy-load it only on .xlsx/.xlsm drops.
  2. Use dense: true, cellFormula: false, and bookVBA: false with explicit safety caps (5 MB file limit, 1,024 columns max, 5,000,000 cells max) so malformed sheets with trailing formatted columns cannot freeze the tab.
  3. Preserve exact 1-based Excel row offsets (excelRowOffset = range.s.r + headerRowIndex) and skip the secondary technical header row beneath labels so every reported finding matches the real row number in Excel.

2. Catching the 7 Feed Defects Offline Across 15 Canonical Fields

Auditing 15 core columns (seller_sku, parent_child, parent_sku, relationship_type, variation_theme, color_name, size_name, brand_name, gtin, gtin_type, main_image_url, title, price, quantity, update_delete) catches the defects behind most feed rejections:

Check Rule Code What It Catches
Excel UPC truncation gtin_leading_zero_stripped 11-digit numeric UPC where prepending 0 passes the GS1 mod-10 check digit
GS1 & Amazon IDs gtin_check_digit / gtin_format UPC-12, EAN-13, GTIN-14, JAN, ISBN-13 check digits + UPC-E (8), ASIN (10), ISBN-10, GCID (16)
Family links family_parent_missing / family_children_missing Orphaned children, duplicate parents, or non-Delete parents without children
Variation collisions family_duplicate_variation Two active children sharing identical (color_name, size_name) values under one parent
Parent pollution price_on_parent / gtin_on_parent Buyable fields (price, quantity, gtin, variation values) left on parent rows
Family consistency family_theme_mismatch / parent_sku_case_mismatch Child variation theme mismatch, brand drift, or parent SKU casing mismatch
Silent overwrites update_delete_blank Blank update_delete cells that default to full Update instead of PartialUpdate

One critical detail for tiered tools: run family grouping in O(N) over the entire parsed dataset BEFORE applying any preview row window, otherwise a parent on row 2 and child on row 30 trigger false family_children_missing errors.

3. Honest Proof-of-Fix Diffs (Separating Resolved Findings From Removed SKUs)

Naive before/after error counts can be gamed simply by deleting failing rows. Our multiset diff fingerprints each finding by (code, field, sellerSku, familyKey) and splits baseline findings into three distinct buckets:

  • Resolved: The error disappeared while seller_sku still exists in the corrected file.
  • Removed SKUs: The error disappeared only because that SKU row was deleted (never counted as fixed).
  • Remaining & New: Still-open findings plus regressions introduced during edits.
import { runCatalogAudit, freezeReviewContext, validateFrozenContext, compareIssueMultiset, } from './src/index.js'; const before = runCatalogAudit({ rawText: baselineTsv, sourceName: 'spring-2026.tsv', applyNormalization: true }); const frozen = freezeReviewContext(before); // Works across TSV -> CSV or XLSX -> TSV even when columns are reordered const check = validateFrozenContext(correctedCsv, frozen); if (check.ok) { const after = runCatalogAudit({ rawText: correctedCsv, requestedDelimiter: check.delimiter, mapping: check.mapping, applyNormalization: true, }); const proof = compareIssueMultiset(before.issues, after.issues, after.allSkuSet); console.log({ resolved: proof.resolvedCount, removedSkus: proof.removedCount, remaining: proof.remainingCount }); } 

4. Excel Formula-Injection Defense on Exports

Any exported issue CSV or 15-field Review TSV can be opened straight back in Excel. Always neutralize leading =, +, -, @, fullwidth operators (+/-), and leading NBSP/CJK whitespace with a leading apostrophe so untrusted vendor titles cannot trigger formulas.

Try It Locally or Reuse the MIT Core