Skip to main content

Validate Import

POST 

/api/v2/products/import/validate

Validates mapped import rows and returns a structured preview. No side effects — safe to call repeatedly.

Route: v2.products.import.validate

Required body field:

  • rows: array (min 1) of row objects with mapped column keys.

SKU-8009 added image URL fields to the accepted row shape:

  • rows[].image_url_1 (string) — Primary image URL (http/https only, max 2048 chars)
  • rows[].image_url_2 .. rows[].image_url_9 (string) — Additional gallery image URLs

Validation rules for each image_url_N:

  • Must start with http:// or https://
  • Must pass FILTER_VALIDATE_URL
  • Must be < 2048 characters
  • Duplicate URLs (case-insensitive) are skipped with a warning
  • If all image_url_* columns are blank/unmapped, existing product images are left unchanged

Response shape: { products: [...], summary: {...} }

Each product entry includes a new field:

  • _image_urls: array of { url, is_primary, sort_order, download } | null
    • null = no image_url_* columns mapped, OR all blank (existing images preserved)
    • Otherwise: ordered by image_url_1..9 position; image_url_1 becomes is_primary=true; download=true triggers async download/storage on import.

The summary reports: total_products, total_new, total_updates, total_errors, total_warnings.

Stock UoM (added 2026-05-30): stock_uom_code is now a supported field. Provide a value matching an existing UoM code (e.g. EACH, KG, BOX). On create, it sets the product's initial stock UoM; on update, it flips the stock UoM to the matching uom_id.

Request

Responses

Successful response