Search Documentation

Search for a documentation page...

Imports API

REST API endpoints for importing catalog content from external stores.

Import products from an external store (Shopify, WooCommerce, or any product page) into your YNS store. Imports run asynchronously — start a job and poll for progress.

Start Import

POST /api/v1/imports

Starts an asynchronous catalog import. Returns a jobId immediately (HTTP 202) — poll GET /api/v1/imports/{jobId} for progress and results.

Shopify stores are imported at full fidelity (images, descriptions, SKUs). WooCommerce and other platforms fall back to best-effort extraction. Each product is created as a single default variant. Items are created as draft by default so you can review before publishing. Existing slugs are skipped, so re-running is safe.

Request Body

FieldTypeRequiredDefaultDescription
sourceUrlstringYesThe source store URL (Shopify, WooCommerce, or any product page)
typestringNo"products"What to import. Currently products only.
statusstringNo"draft"Status for imported items: "draft" or "published"
curl -X POST \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"sourceUrl": "https://example-store.myshopify.com",
"status": "draft"
}' \
https://your-store.yns.store/api/v1/imports

Response (202)

{
"message": "Import started",
"jobId": "0191abc0-1234-7def-8000-000000000001",
"type": "products",
"stage": "scraping",
"sourceUrl": "https://example-store.myshopify.com"
}

Get Import Job

GET /api/v1/imports/{jobId}

Returns a single import job by UUID. Use this to poll for progress after starting an import.

Path Parameters

ParameterTypeDescription
jobIdstringImport job UUID
curl -H "Authorization: Bearer your_api_key" \
https://your-store.yns.store/api/v1/imports/0191abc0-1234-7def-8000-000000000001

Response (200)

{
"id": "0191abc0-1234-7def-8000-000000000001",
"type": "products",
"sourceUrl": "https://example-store.myshopify.com",
"stage": "completed",
"error": null,
"metadata": {
"platform": "shopify",
"currency": "USD",
"detectedCount": 25,
"imported": 23,
"skipped": 2,
"errors": []
},
"createdAt": "2026-07-01T10:00:00.000Z",
"updatedAt": "2026-07-01T10:02:30.000Z",
"completedAt": "2026-07-01T10:02:30.000Z"
}

Job Stages

StageDescription
scrapingFetching product data from the source URL
importingCreating products in the store
completedImport finished successfully
failedImport failed — check the error field

Metadata Fields

Once the job progresses past scraping, the metadata object contains:

FieldTypeDescription
platformstringDetected platform: "shopify", "woocommerce", or "generic"
currencystring | nullSource store currency
detectedCountnumberNumber of products found at the source
importednumberProducts successfully created
skippednumberProducts skipped (e.g. duplicate slugs)
errorsobject[]Per-product errors: { name, error }

List Import Jobs

GET /api/v1/imports

Returns this store's import jobs, newest first.

Query Parameters

ParameterTypeDefaultDescription
limitnumber20Jobs per page (1-100)
offsetnumber0Number of jobs to skip
curl -H "Authorization: Bearer your_api_key" \
https://your-store.yns.store/api/v1/imports

Response (200)

{
"data": [
{
"id": "0191abc0-1234-7def-8000-000000000001",
"type": "products",
"sourceUrl": "https://example-store.myshopify.com",
"stage": "completed",
"error": null,
"metadata": {
"platform": "shopify",
"detectedCount": 25,
"imported": 23,
"skipped": 2,
"errors": []
},
"createdAt": "2026-07-01T10:00:00.000Z",
"updatedAt": "2026-07-01T10:02:30.000Z",
"completedAt": "2026-07-01T10:02:30.000Z"
}
],
"meta": {
"count": 1,
"offset": 0,
"limit": 20
}
}