Validate Import
POST/api/v2/products/import/validate
Validates mapped import rows and returns a structured preview. No side effects — safe to call repeatedly.
products:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Route: v2.products.import.validate
Required body field:
- rows: array (min 1) of row objects with mapped column keys.
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
- 200
- 401
- 403
- 422
- 429
Successful response
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.