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

Run a commerce collection

Runs one paid commerce collection: the selected commerce queries on the resolved platforms in one country, collected through the collection partner. Every (query, platform) pair is one billable unit. Returns 202 with the collection, task, and billing references. A missing shopping module is evidence, never a failure.

POST/commerce/collections
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)$
queriesstring[]required
min items 1 · max items 50
platform_idsstring[]required
min items 1 · max items 20
countrystring
min length 2 · max length 2
Responses
202

Accepted collection

successbooleanrequired
dataAcceptedCommerceCollectionObjectrequired
Show properties
collection_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)$
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)$
statusstringrequired
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
collection_urlstringrequired
min length 1
platform_idsstring[]required
countrystringrequired
min length 2 · max length 2
requested_query_countintegerrequired
min 1 · max 9007199254740991
billingBillingObject | nullrequired
Show properties
Any of:
BillingObject
operationstringrequired
Allowed:ai_platform_querysite_auditauto_visibility_setupcommerce_collectioncompetitor_generation
credit_catalog_versionstringrequired
min length 1
quantity_requestedintegerrequired
min 0 · max 9007199254740991
unit_creditsinteger | nullrequired
Show properties
Any of:
integer
integer
null
null
maximum_creditsintegerrequired
min 0 · max 9007199254740991
reserved_creditsintegerrequired
min 0 · max 9007199254740991
billing_statusstringrequired
Allowed:reserveddeductedreleased
credits_deductedinteger
min 0 · max 9007199254740991
credits_releasedinteger
min 0 · max 9007199254740991
wallet_history_idstring | nullrequired
Show properties
Any of:
string
string
null
null
null
null
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
402

wallet_not_activated, insufficient_credits, or payment_action_required

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/collections' \
  -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",
  "queries": [
    "string"
  ],
  "platform_ids": [
    "string"
  ],
  "country": "st"
}'
Response
{
  "success": true,
  "data": {
    "collection_id": "4bdef85c-3f50-4006-a713-2350da665f80",
    "brand_id": "1bb61461-e5e3-4ebb-8cc6-5b0c37f1b7da",
    "status": "queued",
    "task_id": "736fde4d-9029-4915-8189-01353d6982cb",
    "task_url": "string",
    "collection_url": "string",
    "platform_ids": [
      "string"
    ],
    "country": "st",
    "requested_query_count": 1,
    "billing": {
      "operation": "ai_platform_query",
      "credit_catalog_version": "string",
      "quantity_requested": 0,
      "unit_credits": 0,
      "maximum_credits": 0,
      "reserved_credits": 0,
      "billing_status": "reserved",
      "credits_deducted": 0,
      "credits_released": 0,
      "wallet_history_id": "string"
    }
  },
  "request_id": "string"
}

Was this page helpful?