Skip to content
Zaraftis
Esc
↑↓navigate↵open⌘Jpreview

Import a catalog from CSV

Imports the customer’s product catalog from inline CSV text. The shape is validated at ingress and one invalid row refuses the whole import with the exact row errors. A small import completes inline and returns the snapshot; a large one returns 202 with a task whose completion carries catalog_snapshot_id. The customer’s catalog only; observed products never enter this path.

POST/commerce/catalog-imports
Authorization
AuthorizationBearer token · headerrequired

API key sent as Authorization: Bearer <key>. A key belongs to one workspace, has scopes, and can be limited to some brands.

or
AuthorizationOAuth2 access token · headerrequired

OAuth 2.1 sign-in (authorization code with PKCE) used by AI assistants that connect through the Zaraftis MCP server. Discovery URLs are at https://api.zaraftis.com/api/auth.

Header parameters
Idempotency-Keystringrequired

A new value, such as a UUID, for each new request. Send the same value to retry a request safely; see https://docs.zaraftis.com/conventions#safe-retries-with-idempotency-key.

min length 1 · max length 64
Request body
requiredapplication/json
brand_idstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
csvstringrequired
min length 1 · max length 4000000
Responses
200

The import completed inline (small file, or an identical re-import)

successbooleanrequired
dataCatalogImportResultrequired
Show properties
One of:
AcceptedCatalogImportObject
modestringrequired
task_idstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
task_urlstringrequired
min length 1
detailstringrequired
min length 1
CompletedCatalogImportObject
modestringrequired
catalog_snapshot_idstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
catalog_snapshot_urlstringrequired
min length 1
detailstringrequired
min length 1
request_idstringrequired
min length 1
202

The import was accepted as a durable task (large file)

successbooleanrequired
dataCatalogImportResultrequired
Show properties
One of:
AcceptedCatalogImportObject
modestringrequired
task_idstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
task_urlstringrequired
min length 1
detailstringrequired
min length 1
CompletedCatalogImportObject
modestringrequired
catalog_snapshot_idstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
catalog_snapshot_urlstringrequired
min length 1
detailstringrequired
min length 1
request_idstringrequired
min length 1
400

bad_request or validation_failed

successbooleanrequired
errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsobject
field_errorsobject[]
Show properties
Array of object
fieldstringrequired
codestringrequired
Allowed:requiredformattoo_smalltoo_largeunrecognized_keyinvalid
messagestringrequired
request_idRequestIdrequired
404

not_found: unknown id, or an id this key cannot see

successbooleanrequired
errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsobject
field_errorsobject[]
Show properties
Array of object
fieldstringrequired
codestringrequired
Allowed:requiredformattoo_smalltoo_largeunrecognized_keyinvalid
messagestringrequired
request_idRequestIdrequired
Request
curl -X POST 'https://api.zaraftis.com/v1/commerce/catalog-imports' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Idempotency-Key: string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "brand_id": "1bb61461-e5e3-4ebb-8cc6-5b0c37f1b7da",
  "csv": "string"
}'
Response
{
  "success": true,
  "data": {
    "mode": "accepted",
    "task_id": "736fde4d-9029-4915-8189-01353d6982cb",
    "task_url": "string",
    "detail": "string"
  },
  "request_id": "string"
}

Was this page helpful?