{"openapi":"3.0.0","info":{"title":"Sellalog public API","version":"2.0.0","description":"\nREST API of **Sellalog** for your own store: catalogs, products, prices per catalog, price links, orders,\nleads and webhooks. Everything here works with a **tenant API key**.\n\n### Authentication\n`Authorization: Bearer sk_live_…` on every request. Create the key in Sellalog → **Ajustes → Integraciones → Claves de\nAPI** (Pro plan). A key acts as an ADMIN of its store, never of another one, and is shown only once.\n\n### Conventions\n* JSON in and out (`Content-Type: application/json`), UTF-8. Dates are ISO 8601 (UTC). Money is a number in the store\n  currency unless a `currency` field says otherwise.\n* **Errors** are always `{ \"error\": \"<English message>\", \"code\": \"<STABLE_CODE>\" }` plus details for some codes\n  (`issues` on VALIDATION, `limit` / `current` on plan limits). Branch on `code`, never on the message.\n* **Upsert by your own id**: `PUT /catalogs/by-ref/{ref}` and `PUT /products/by-ref/{ref}` create the row the first\n  time (201, `X-Upsert: created`) and update it afterwards (200, `X-Upsert: updated`). `ref` = 1–120 of\n  `A-Z a-z 0-9 . _ - : @ ~`, unique per store. Re-running a script never makes duplicates.\n* **Idempotency-Key** (optional) on POST create endpoints: the same key + same body within 24 h returns the first answer\n  (`Idempotent-Replayed: true`); same key with another body → 422 `IDEMPOTENCY_KEY_REUSED`.\n* **Pagination**: `GET /orders` → `page` / `limit` (max 200) with `total` and `hasMore`; `GET /products` →\n  `limit` (max 500) / `offset` with the total in the `X-Total-Count` header (the body stays an array).\n\n### Rate limits\nPer API key: **1200 requests per minute** (fixed window). Over it → **429** with\n`{ \"error\": \"...\", \"code\": \"RATE_LIMITED\" }`, a `Retry-After` header (seconds) and the draft-7 `RateLimit` /\n`RateLimit-Policy` headers. Wait `Retry-After` seconds and retry; keep at most ~3 requests in flight.\n"},"servers":[{"url":"https://api.sellalog.com/api","description":"Sellalog API"}],"tags":[{"name":"Catalogs","description":"Catalogs (groups of products) with visibility and checkout mode"},{"name":"Colors","description":"Color library and palettes"},{"name":"Curvas","description":"Size runs (quantity presets per size)"},{"name":"Domains","description":"Custom domains (Tiendanube-style). Several per store, one **primary**. Status machine:\n`pending_dns` → `verifying` → `issuing_ssl` → `active` (only after a real HTTPS request with a\nvalid certificate is answered by this store's catalog) · `error` (`lastError` code + `lastErrorParams`).\nSubdomains: `CNAME {name} → {cnameTarget}`. Apex domains: `A @ → {serverIp}`, or — platform on\nCloudflare for SaaS and the customer's zone on Cloudflare (`apexCname`) — `CNAME @ → {cnameTarget}`\n(flattened, DNS only) + `CNAME _acme-challenge → {hostname}.{uuid}.dcv.cloudflare.com` (delegated DCV).\nThe primary is served once `active`; until then the oldest active domain keeps serving (`activePrimary`).\nBackground re-check every 10 min while not active, hourly when active; a live domain that fails\ntwice in a row becomes `error` and the owner is notified. Plan feature `customDomain` (Pro).\n\n**Catalog domains** (`catalogId`): the host opens ONE catalog as its home (`especial.example.com` → that\ncatalog at `/`, `/p/{id}` inside it, orders into it). `/public/resolve` answers it with `basePath ''` +\n`pinnedCatalog`. Never the primary nor a 301 alias while the catalog is active; same DNS/SSL path as any\ndomain. The catalog deactivated → the domain falls back to the whole store (its `redirect` flag → 301 to the\nprimary); the catalog deleted → the owner's choice (see DELETE /catalogs/{id}). A catalog may have several\ndomains (move it to a new one): the NEWEST active is its address (catalog URL, share/price links); each older\none (`redirect` on) 301s to `https://{newest}{path}?{query}`; until the new one is active the old one serves.\n"},{"name":"Orders","description":"Orders received from the catalog"},{"name":"Packaging","description":"Packaging options (case, half case, size run…)"},{"name":"PriceLinks","description":"Temporary links that show prices (and optionally stock) while the catalog hides them"},{"name":"Products","description":"Products"},{"name":"Sellers","description":"Sellers who send price links from the \"Sellalog Vendedores\" app (iOS / Android)"},{"name":"Sizes","description":"Sizes library"},{"name":"Tags","description":"Product tags (featured = top tabs, others = filter pills, listed under their `group` heading)"},{"name":"Tenant","description":"Settings and stats of the authenticated tenant"},{"name":"Upload","description":"Image upload (Cloudinary)"},{"name":"Visitors","description":"Catalog visitors, leads and access requests. Each visitor carries:\n`temperature` (hot | warm | cold | anonymous), `viewingNow` (seen < 60s ago), `viaLink` (the price link that\nbrought them: { id, clientName, sellerId, sellerName, catalogId, catalogName, product, lastAt } | null),\neffective `accessStatus` (NONE | PENDING | APPROVED | REJECTED | EXPIRED).\nThe store's own team (`isTeam`, or a visitor who left the store's own email/WhatsApp — lib/teamVisitors.js)\nis left out of every list, of `counts` and of the live list; `GET /visitors/:id` still opens it (`isTeam: true`).\nProduct-level analytics (detail views, live, notSeen) need the `visitorAnalytics`\nfeature (Starter+); leads and requests are available on every plan.\n"},{"name":"Webhooks","description":"One outbound webhook per store. Sellalog POSTs JSON events to your https URL:\n`{ id, type, createdAt, tenant: { slug }, data }` with headers\n`X-Sellalog-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, `X-Sellalog-Event`,\n`X-Sellalog-Delivery`. Answer 2xx within 10 s; anything else is retried with backoff for ~24 h\n(1 m, 5 m, 30 m, 2 h, 6 h, 15 h). Events: `price_link.opened`, `price_link.cart_updated`,\n`price_link.expired_unopened`, `order.created`, `order.paid` (+ `ping` from /webhooks/test).\nSame event may arrive twice: dedupe by `id`. Requires the `apiKeys` plan feature (Pro).\n"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_...","description":"Tenant API key (`sk_live_` + 32 chars). Create it in Ajustes → Integraciones → Claves de API (Pro plan)."}},"parameters":{"ExternalRef":{"in":"path","name":"ref","required":true,"description":"Your own id: 1-120 of A-Z a-z 0-9 . _ - : @ ~, starting with a letter or digit, unique per store (case-sensitive)","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:@~-]{0,119}$","example":"cliente-tienda-norte"}},"IdempotencyKey":{"in":"header","name":"Idempotency-Key","required":false,"description":"Optional. Same key + same JSON body within 24 h → the first answer again (header `Idempotent-Replayed: true`), nothing created twice. Same key, other body → 422 IDEMPOTENCY_KEY_REUSED; while the first is running → 409 IDEMPOTENCY_IN_PROGRESS. 1-200 visible ASCII characters.","schema":{"type":"string","maxLength":200,"example":"import-2026-12-01-row-17"}}},"responses":{"ValidationError":{"description":"VALIDATION — the body or query is not valid (`issues` = zod issues)","content":{"application/json":{"example":{"error":"Invalid data","code":"VALIDATION","issues":[{"path":["price"],"message":"Expected number, received string"}]}}}},"NotFound":{"description":"*_NOT_FOUND — the id is not one of this store","content":{"application/json":{"example":{"error":"Not found","code":"NOT_FOUND"}}}},"RefConflict":{"description":"EXTERNAL_REF_TAKEN — another row of this store already has that externalRef","content":{"application/json":{"example":{"error":"Another product of this store already has this externalRef","code":"EXTERNAL_REF_TAKEN"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","example":"Product limit reached"},"code":{"type":"string","example":"PLAN_LIMIT_PRODUCTS"}}},"Tenant":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","example":"northwind"},"name":{"type":"string","example":"Northwind Apparel"},"plan":{"type":"string","enum":["FREE","STARTER","PRO","ENTERPRISE"]},"currency":{"type":"string","example":"MXN"},"locale":{"type":"string","enum":["en","es"]},"country":{"type":"string","example":"MX","nullable":true},"timezone":{"type":"string","example":"America/Mexico_City","nullable":true},"settings":{"type":"object"},"onboardingDone":{"type":"boolean"},"beta":{"type":"object","description":"Beta plan: { active, plan, effectivePlan } — while payments are off every store runs on max(plan, BETA_PLAN)"},"billingIssue":{"type":"string","nullable":true,"enum":["refunded","chargeback",null],"description":"/tenant/me only: payment problem raised by a Paddle adjustment"},"createdAt":{"type":"string","format":"date-time"}}},"Catalog":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Spring 2027"},"slug":{"type":"string","example":"spring-2027"},"active":{"type":"boolean"},"visibility":{"type":"string","enum":["public","lead","private"]},"ctaMode":{"type":"string","enum":["order","quote","whatsapp"]},"orderMode":{"type":"string","enum":["cart","interest"],"description":"How buyers ask here (default cart). interest = 'Me interesa': no cart / checkout, orders refused (409 CATALOG_INTEREST_ONLY); buyers heart products and send the selection to their seller (POST /public/{slug}/interest)."},"showInMenu":{"type":"boolean"},"showPrices":{"type":"boolean","nullable":true,"description":"true/false override settings.showPrices for this catalog; null = follow the store. A valid price link still reveals prices."},"showStock":{"type":"boolean","nullable":true,"description":"true/false override settings.hideStock for this catalog; null = follow the store. A price link with its own showStock wins."},"applyDiscounts":{"type":"boolean","description":"Full size-run (\"curva\") discount applies in this catalog (default true). false: no curva discount in the public listing (?catalog=) and in orders."},"saleForms":{"type":"array","nullable":true,"description":"Sale forms of this catalog: null = like the store (every applicable option at the store's %). A list [{ key: 'pack' | <packagingOptionId>, enabled, discount (-100..100) }] offers only the enabled forms at this catalog's %; a missing key = enabled at the store's % ('pack' at 0 %). Order: 'pack' first, then the store's option order.","items":{"type":"object","properties":{"key":{"type":"string"},"enabled":{"type":"boolean"},"discount":{"type":"number"}}}},"showInBot":{"type":"boolean","description":"Dormant (the Telegram bot was removed on 2026-11-26): ignored on write."},"announcement":{"type":"object","nullable":true,"description":"Announcement bar in this catalog: null = like the store (settings.announcement); { off: true } = no bar; { text, linkLabel?, linkMessage?, linkUrl? } = its own (same rules as the store bar)."},"baseCurrency":{"type":"boolean","description":"Prices in the stored currency here (default false): no refCurrency \"charge\" conversion in the listing, product sheet, PDF and orders (no fx); store minimum/delivery amounts ÷ rate. Forces payments off while the store converts."},"payments":{"type":"boolean","description":"Online payment for orders from this catalog (default true). false = orders are just sent: no Mercado Pago, no pay now / pay later choice."},"externalRef":{"type":"string","nullable":true,"example":"cliente-tienda-norte","description":"Your own id for this catalog (1-120 of A-Z a-z 0-9 . _ - : @ ~), unique per store. Upsert with PUT /catalogs/by-ref/{ref}."},"url":{"type":"string","example":"https://sellalog.com/northwind/c/spring-2027","description":"Public address (GET responses)"},"createdAt":{"type":"string","format":"date-time"}},"example":{"id":"clcat01","name":"Tienda Norte","slug":"tienda-norte","active":true,"visibility":"public","ctaMode":"order","showInMenu":false,"showPrices":null,"showStock":null,"applyDiscounts":true,"saleForms":null,"announcement":null,"baseCurrency":false,"payments":true,"externalRef":"cliente-tienda-norte","url":"https://sellalog.com/northwind/c/tienda-norte","domainUrl":null,"rules":null,"createdAt":"2026-11-27T12:00:00.000Z"}},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"White Oxford Shirt"},"sku":{"type":"string","nullable":true,"example":"SHIRT-001"},"minQty":{"type":"integer","example":6,"description":"Minimum order quantity per order, in units"},"price":{"type":"number","example":18},"comparePrice":{"type":"number","nullable":true},"description":{"type":"string","nullable":true},"composition":{"type":"string","nullable":true},"images":{"type":"array","items":{"type":"string"}},"stock":{"type":"integer"},"stockStatus":{"type":"string","enum":["in_stock","pending"],"nullable":true},"colorItems":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"hex":{"type":"string"},"quantity":{"type":"integer"}}}},"sizes":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"packagingItems":{"type":"array","items":{"type":"object"}},"sale":{"type":"boolean"},"highlighted":{"type":"boolean","description":"Destacado: first in the catalog default order, with a badge on the card"},"active":{"type":"boolean"},"catalogId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true,"example":"art-1001","description":"Your own id for this product (1-120 of A-Z a-z 0-9 . _ - : @ ~), unique per store. Upsert with PUT /products/by-ref/{ref}."},"linkedCatalogIds":{"type":"array","items":{"type":"string"},"description":"Other catalogs it is linked into (GET responses)"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"example":{"id":"clprd01","name":"White Oxford Shirt","sku":"SHIRT-001","externalRef":"art-1001","price":"18.00","comparePrice":null,"cost":null,"margin":null,"description":"Slim fit, 100% cotton","composition":"100% cotton","images":["https://res.cloudinary.com/demo/image/upload/shirt.jpg"],"stock":40,"stockStatus":null,"minQty":1,"sale":false,"highlighted":false,"active":true,"catalogId":"clcat00","colorItems":[{"name":"White","hex":"#FFFFFF","quantity":0}],"packagingItems":[],"sizes":[{"sizeId":"clsz1","quantity":1,"size":{"id":"clsz1","name":"M","order":2}}],"tags":[{"id":"cltag1","name":"Shirts"}],"linkedCatalogIds":[],"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}},"Order":{"type":"object","properties":{"id":{"type":"string"},"customerName":{"type":"string"},"customerEmail":{"type":"string","nullable":true},"customerPhone":{"type":"string","nullable":true},"customerCompany":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"currency":{"type":"string","example":"USD"},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"name":{"type":"string"},"sku":{"type":"string"},"qty":{"type":"integer"},"price":{"type":"number","nullable":true},"packaging":{"type":"string","nullable":true}}}},"subtotal":{"type":"number"},"total":{"type":"number"},"status":{"type":"string","enum":["RECEIVED","PENDING","CONFIRMED","PREPARING","READY","SHIPPED","DELIVERED","CANCELLED"]},"visitorId":{"type":"string","nullable":true},"viewedAt":{"type":"string","format":"date-time","nullable":true,"description":"First time a team member opened it in the panel (POST /orders/{id}/seen); null = new"},"seller":{"type":"object","nullable":true,"description":"Who made the sale (from the price link, or set by hand): id null = a name only","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string"}}},"sellerSetBy":{"type":"string","nullable":true,"description":"Person who set the seller by hand (PUT /orders/{id}/seller); null = from the link"},"sellerSetAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}}}}},"security":[{"apiKey":[]}],"paths":{"/catalogs":{"get":{"tags":["Catalogs"],"summary":"List catalogs (with url)","description":"`url` = the catalog's public address: its catalog domain once active (`https://especial.example.com`,\nthe catalog at that root — see Domains), else `{store}/c/{slug}`. `domainUrl` = that catalog domain, or null.\n`priceSummary` = { currency, count, min, max, avg, fixed, vsSource } over its active products: what buyers see,\nfixed linked prices, and the % of linked products against their home catalog (null without linked products).\nOldest first. Catalogs in the trash are left out (`GET /catalogs/trash`).\n","parameters":[{"in":"query","name":"externalRef","schema":{"type":"string"},"description":"Exact: only the catalog with this externalRef (or [])"},{"in":"query","name":"slug","schema":{"type":"string"},"description":"Exact: only the catalog with this slug (or [])"}],"responses":{"200":{"description":"Catalogs (an array, also when filtered)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Catalog"}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Catalogs"],"summary":"Create a catalog (private visibility needs Pro)","description":"To create-or-update by your own id (re-runs without duplicates) use `PUT /catalogs/by-ref/{ref}`.\n`externalRef` here must be free in the store (409 EXTERNAL_REF_TAKEN). Counts toward the plan's catalog limit.\n","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string","example":"Hombre"},"slug":{"type":"string","example":"hombre"},"active":{"type":"boolean"},"showInMenu":{"type":"boolean"},"visibility":{"type":"string","enum":["public","lead","private"]},"externalRef":{"type":"string","nullable":true,"example":"cliente-tienda-norte"}}},"example":{"name":"Hombre","slug":"hombre","showInMenu":true}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_LIMIT_CATALOGS | PLAN_FEATURE_REQUIRED (private) | FORBIDDEN"},"409":{"description":"DUPLICATE (slug taken) | CATALOG_SLUG_IN_TRASH | EXTERNAL_REF_TAKEN | CATALOG_REF_IN_TRASH"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}":{"get":{"tags":["Catalogs"],"summary":"One catalog with its checkout rules","description":"The catalog + `url` / `domainUrl` + `rules` (its own overrides, null = none) + `effective`: per rule { value…, source:\ncatalog | store | catalogOff | forced } and `currency` (the catalog's selling currency; `stale: true` = an own amount\nwhose currency no longer converts — the store's value applies).\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Catalog","content":{"application/json":{"example":{"id":"clcat01","name":"Tienda Norte","slug":"tienda-norte","active":true,"visibility":"public","ctaMode":"order","showInMenu":false,"showPrices":null,"showStock":null,"applyDiscounts":true,"saleForms":null,"announcement":null,"baseCurrency":false,"payments":true,"minOrder":true,"badgesAuto":null,"externalRef":"cliente-tienda-norte","rules":null,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z","effective":{"currency":"MXN","minOrder":{"enabled":false,"source":"store"}},"url":"https://sellalog.com/northwind/c/tienda-norte","domainUrl":null}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"put":{"tags":["Catalogs"],"summary":"Update a catalog","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"},"showPrices":{"type":"boolean","nullable":true,"description":"Prices in this catalog (null = store setting; OWNER/ADMIN)"},"showStock":{"type":"boolean","nullable":true,"description":"Stock in this catalog (null = store setting; OWNER/ADMIN)"},"applyDiscounts":{"type":"boolean","description":"Full size-run (curva) discount in this catalog (default true). false = no curva discount — public listing and orders (OWNER/ADMIN)"},"saleForms":{"type":"array","nullable":true,"description":"null = like the store; [{ key: 'pack' | packagingOptionId, enabled, discount }] = only the enabled forms, at this catalog's % (OWNER/ADMIN). Unknown keys are dropped."},"announcement":{"type":"object","nullable":true,"description":"Announcement bar here: null = like the store (settings.announcement); { off: true } = no bar; { text, linkLabel?, linkMessage?, linkUrl? } = its own (same rules as the store's). OWNER/ADMIN"},"baseCurrency":{"type":"boolean","description":"Prices in the stored currency here (default false): no refCurrency charge conversion in listing, PDF and orders; forces payments off while the store converts. OWNER/ADMIN"},"exactSalePrices":{"type":"boolean","description":"Fixed prices here are already in the charge currency and sold as sent (default false; set by a connected app's price push): no × rate for them and no rounding of the unit price; forms with a % round up to the charge step. OWNER/ADMIN"},"exactPackRound":{"type":"boolean","description":"Only with exactSalePrices: true (default) = forms with a % (Curva, Caja…) round up to the store's charge step; false = to cents. The unit price stays exact either way. OWNER/ADMIN"},"priceRounding":{"oneOf":[{"type":"string","enum":["none"]},{"type":"number"}],"nullable":true,"example":500,"description":"Redondeo of this catalog's prices (default null = like the store: refCurrency round / packRound / exactPackRound). 'none' = every form price in cents; a step = every form price (Unidad at 0 % included) rounded UP to it, in the currency the catalog sells in — 1, 10, 100, 500, 1000 for ARS-like currencies (ARS, CLP, COP, PYG, CRC, HUF, JPY, KRW, IDR, VND), 0.5, 1, 5 for the others (400 PRICE_ROUNDING_STEP). Wins over exactSalePrices / exactPackRound. Listing, cart, orders, PDFs, favorites, link previews. OWNER/ADMIN"},"payments":{"type":"boolean","description":"Online payment for orders from this catalog (default true). false = orders are just sent (no Mercado Pago, no pay now/later choice). OWNER/ADMIN"},"minOrder":{"type":"boolean","description":"The store's minimum order applies here (default true). false = orders from this catalog have no minimum (while rules.minOrder is unset). OWNER/ADMIN"},"orderMode":{"type":"string","enum":["cart","interest"],"description":"How buyers ask here (default cart = cart + checkout). interest = 'Me interesa': no cart, no checkout, orders refused (409 CATALOG_INTEREST_ONLY); buyers heart products and send the selection to their seller (POST /public/{slug}/interest → sellers app push). OWNER/ADMIN"},"rules":{"type":"object","nullable":true,"description":"Own checkout rules (lib/catalogRules.js, API-CHANGES \"Per-catalog checkout rules\"). Partial: only the keys sent\nchange; `null` per key = like the store; `rules: null` = all back to the store. Keys: `minOrder` { enabled,\nmode, amount, units, currency }, `shipping` { pickup?, delivery?, carrier?, currency }, `orderPayment`\noff|optional|required, `payLater` { mode, label?, hint? }, `stockConfirmTags`, `leadCapture`, `orderContact`\nphone|either|both, `orderCopyWhatsapp`, `orderFinalMessage`. Aliases: paymentChoice, buyerFields,\norderThanksMessage, flat minOrderEnabled/Mode/Amount/Units/Currency. Amounts in the catalog's selling\ncurrency (400 RULES_CURRENCY). OWNER/ADMIN. The response adds `effective` (value + source per rule).\n","example":{"minOrder":{"enabled":true,"mode":"amount","amount":300,"currency":"USD"},"shipping":{"pickup":{"enabled":true},"currency":"USD"},"orderContact":"both"}},"badgesAuto":{"type":"object","nullable":true,"description":"Carteles automáticos de las cards en este catálogo (lib/productBadges.js). `null` = todos apagados\n(lo que hace cualquier catálogo existente). Se puede mandar parcial — lo que falte toma el valor de\nfábrica y los números se recortan a su tope: `priceDrop {on, days 1–90}`, `lowStock {on, boxes 1–99, units 1–9999 | null}` (units = umbral en unidades, null = en cajas),\n`backInStock {on, days 1–90}`, `newArrival {on, days 1–90}`, `topOrdered {on, count 1–20}`.\nComo máximo salen DOS carteles por producto, en ese orden de prioridad. OWNER/ADMIN.\n","example":{"lowStock":{"on":true,"boxes":2},"priceDrop":{"on":true,"days":10}}}}},"example":{"name":"Tienda Norte","showInMenu":false,"visibility":"private"}}}},"responses":{"200":{"description":"Updated — the catalog + `effective` (what orders get here per rule, lib/catalogRules.js rulesSummary)","content":{"application/json":{"example":{"id":"clcat01","name":"Tienda Norte","slug":"tienda-norte","active":true,"visibility":"public","ctaMode":"order","showInMenu":false,"showPrices":null,"showStock":null,"applyDiscounts":true,"saleForms":null,"announcement":null,"baseCurrency":false,"payments":true,"minOrder":true,"badgesAuto":null,"externalRef":"cliente-tienda-norte","rules":null,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z","effective":{"currency":"MXN","minOrder":{"enabled":false,"source":"store"}}}}}},"400":{"description":"VALIDATION | RULES_CURRENCY"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"409":{"description":"CATALOG_SLUG_IN_TRASH | MP_NOT_CONNECTED | MP_RECONNECT_REQUIRED | MP_CURRENCY_UNSUPPORTED"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Catalogs"],"summary":"Delete a catalog — it goes to the trash for 30 days (OWNER/ADMIN)","description":"Never hard-deletes (API-CHANGES \"Safe catalog delete\"). The catalog becomes invisible everywhere (public catalog,\nlists, menus, PDFs, price links, sellers app, bot, assistant, metrics) and is purged 30 days later unless restored\n(`POST /catalogs/{id}/restore`). Check `GET /catalogs/{id}/delete-preview` first. Body (all optional, safe defaults):\n  - `products`: `{ action: archive }` (default — hidden everywhere, recoverable; their links in other catalogs are\n    dropped) | `{ action: delete }` (like archive until the purge, which deletes them) | `{ action: move, catalogId }`\n    (another catalog of the store becomes their home; their links in other catalogs follow them).\n  - `domain` (when it has a catalog domain): `{ action: disconnect }` (default — the domain stays registered and\n    shows a neutral \"catalog not available\" page; never the store, never the primary) | `{ action: store }` (a\n    regular domain of the store) | `{ action: move, catalogId }` (opens another catalog — also one that already\n    has a domain: the newest active domain is that catalog's address, the older ones 301 there).\n  The choice applies to every catalog domain of the catalog.\nConnected apps on it are revoked (signed `connection.revoked` webhook) and must authorize again after a restore.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"examples":{"defaults":{"value":{}},"move":{"value":{"products":{"action":"move","catalogId":"ckcat2"},"domain":{"action":"move","catalogId":"ckcat2"}}}}}}},"responses":{"200":{"description":"{ catalog: { id, name, deletedAt, purgeAt }, products: { action, count, catalogId? }, domain: { action, hostname } | null, apps }","content":{"application/json":{"example":{"catalog":{"id":"clcat01","name":"Tienda Norte","deletedAt":"2026-11-27T12:00:00.000Z","purgeAt":"2026-12-27T12:00:00.000Z"},"products":{"action":"archive","count":0},"domain":null,"apps":[]}}}},"400":{"description":"VALIDATION | CATALOG_TARGET_INVALID | DOMAIN_CATALOG_INVALID"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/delete-preview":{"get":{"tags":["Catalogs"],"summary":"What deleting this catalog touches, in counts (OWNER/ADMIN)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"catalog":{"id":"ckcat1","name":"Especial","slug":"especial","visibility":"private","active":true},"products":{"own":120,"active":118,"alsoElsewhere":40},"linkedIn":12,"priceLinks":9,"sellerLinks":3,"connectedApps":[{"id":"ckapp","client":{"id":"pos-one","name":"Point of sale"}}],"domains":[{"id":"ckdom","hostname":"especial.example.com","status":"active"}],"orders":31,"trashDays":30,"defaults":{"products":{"action":"archive"},"domain":{"action":"disconnect"}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/restore":{"post":{"tags":["Catalogs"],"summary":"Restore a catalog from the trash (OWNER/ADMIN)","description":"Brings back the catalog, its products (un-archived, or moved back), its links, its domain binding (unless the\ndomain was re-assigned meanwhile) and its price links. Connected apps stay disconnected (`appsToReconnect`).\nCounts toward the plan's catalog limit. `slugChanged` = its address was taken and got a suffix.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"{ catalog, slugChanged, restored: { products, rules, rows, domain: restored | skipped | null }, appsToReconnect }","content":{"application/json":{"example":{"catalog":{"id":"clcat01","name":"Tienda Norte","slug":"tienda-norte","active":true,"visibility":"public","ctaMode":"order","showInMenu":false,"showPrices":null,"showStock":null,"applyDiscounts":true,"saleForms":null,"announcement":null,"baseCurrency":false,"payments":true,"minOrder":true,"badgesAuto":null,"externalRef":"cliente-tienda-norte","rules":null,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z","effective":{"currency":"MXN","minOrder":{"enabled":false,"source":"store"}}},"slugChanged":false,"restored":{"products":0,"rules":1,"rows":0,"domain":null},"appsToReconnect":[]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_LIMIT_CATALOGS"},"404":{"description":"CATALOG_NOT_IN_TRASH"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/trash":{"get":{"tags":["Catalogs"],"summary":"Catalogs in the trash (OWNER/ADMIN), newest first","responses":{"200":{"description":"[{ id, name, slug, visibility, deletedAt, purgeAt, daysLeft, products: { action, count, catalogId? }, domain: { action, hostname } | null, apps }]","content":{"application/json":{"example":[{"id":"clcat9","name":"Old season","slug":"old-season","visibility":"public","deletedAt":"2026-11-27T12:00:00.000Z","purgeAt":"2026-12-27T12:00:00.000Z","daysLeft":30,"products":{"action":"archive","count":52},"domain":null,"apps":[]}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/by-ref/{ref}":{"get":{"tags":["Catalogs"],"summary":"One catalog by your own id (externalRef)","description":"Same answer as `GET /catalogs/{id}`. Only the caller's store is searched — another store's ref is a 404.","parameters":[{"$ref":"#/components/parameters/ExternalRef"}],"responses":{"200":{"description":"The catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"400":{"description":"EXTERNAL_REF_INVALID"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"put":{"tags":["Catalogs"],"summary":"Create or update a catalog by your own id (upsert)","description":"The store's catalog with `externalRef = ref` is updated (partial, like `PUT /catalogs/{id}`) → **200**,\n`X-Upsert: updated`. None → created with that ref (like `POST /catalogs`) → **201**, `X-Upsert: created`; `name`\nis required then and `slug` is optional (made from the name, `-2`, `-3`… when taken). Repeating the same call\nnever makes a second catalog. Scoped to the caller's store: the same ref in another store is a different catalog.\n`externalRef` in the body may be left out (or must equal `ref`). Counts toward the plan's catalog limit when it\ncreates. A ref held by a catalog in the trash → 409 CATALOG_REF_IN_TRASH (restore it, or use another ref).\n","parameters":[{"$ref":"#/components/parameters/ExternalRef"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"description":"Required when it creates"},"slug":{"type":"string","maxLength":40,"pattern":"^[a-z0-9-]+$"},"showInMenu":{"type":"boolean","description":"Tab in the store menu (default false: reachable by its link only)"},"visibility":{"type":"string","enum":["public","lead","private"],"description":"private needs the Pro plan"},"active":{"type":"boolean"},"ctaMode":{"type":"string","enum":["order","quote","whatsapp"]},"showPrices":{"type":"boolean","nullable":true},"showStock":{"type":"boolean","nullable":true}}},"examples":{"customer":{"summary":"One catalog per customer, out of the menu","value":{"name":"Tienda Norte","showInMenu":false}},"private":{"value":{"name":"Tienda Norte","slug":"tienda-norte","visibility":"private","showInMenu":false}}}}}},"responses":{"200":{"description":"Updated (`X-Upsert` header = updated)","headers":{"X-Upsert":{"schema":{"type":"string","enum":["updated"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"201":{"description":"Created (`X-Upsert` header = created)","headers":{"X-Upsert":{"schema":{"type":"string","enum":["created"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"400":{"description":"VALIDATION | EXTERNAL_REF_INVALID | EXTERNAL_REF_MISMATCH | RULES_CURRENCY"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_LIMIT_CATALOGS | PLAN_FEATURE_REQUIRED (private) | FORBIDDEN"},"409":{"description":"CATALOG_REF_IN_TRASH | CATALOG_SLUG_IN_TRASH | EXTERNAL_REF_TAKEN (race) | DUPLICATE (slug taken)"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/by-slug/{slug}":{"get":{"tags":["Catalogs"],"summary":"One catalog by its address (slug)","description":"Same answer as `GET /catalogs/{id}`, for the catalog at `{store}/c/{slug}`. Catalogs in the trash are not found.","parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string","example":"spring-2027"}}],"responses":{"200":{"description":"The catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/order":{"patch":{"tags":["Catalogs"],"summary":"Set the product order of a catalog (full list, first to last)","description":"`ids` = every product the catalog shows (own and linked), in the new order. Positions are rewritten 1..N; the\nweekly sync never touches them afterwards. A product that isn't in the catalog → 400 PRODUCTS_NOT_IN_CATALOG.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"example":{"ids":["clprd03","clprd01","clprd02"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"example":{"ok":true,"count":3}}}},"400":{"description":"VALIDATION | PRODUCTS_NOT_IN_CATALOG"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/products":{"get":{"tags":["Catalogs"],"summary":"Products of one catalog — its own and the linked ones, with the price IN this catalog","description":"Linked products come from another catalog (their home) and keep its photos, stock, sizes and\ndescription; their price here follows the catalog's link rule (`priceMode: rule`) unless fixed\n(`priceMode: fixed`). `ownPrice` is the price in the home catalog. Includes inactive products\n(`active: false`), which the public catalog hides. `?linked=1` returns only linked products.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"linked","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"content":{"application/json":{"example":{"catalog":{"id":"ckcat2","name":"Especiales","slug":"especiales"},"rules":[{"id":"ckrule","sourceCatalogId":"ckcat1","sourceCatalogName":"Catálogo","percent":-10,"rounding":"step","roundStep":10,"linkAll":true}],"products":[{"id":"ckp1","name":"Remera lisa","sku":"RL-01","images":[],"active":true,"stock":3,"price":90,"comparePrice":null,"ownPrice":99.5,"linked":true,"priceMode":"rule","sourceCatalogId":"ckcat1","stockOverride":3,"ownStock":0,"tags":[]}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/links":{"post":{"tags":["Catalogs"],"summary":"Link products of another catalog into this one (prices follow a rule)","description":"Creates or updates the rule for `sourceCatalogId` → this catalog and links products.\n`all: true` links the whole source catalog; with `linkAll` (default true) new products of the\nsource appear here automatically and removed ones disappear. Otherwise pass `productIds`\n(products homed in the source). Price here = source price × (1 + percent/100), then\n`rounding`: `none` | `step` (ceil to `roundStep`, default the store's import rounding or 1) |\n`99` (ends in .99). `multiplier: 1.2` is accepted instead of `percent: 20`.\nLinked products never count toward the plan's product limit.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"sourceCatalogId":"ckcat1","all":true,"linkAll":true,"percent":-10,"rounding":"step","roundStep":10}}}},"responses":{"200":{"description":"{ linked, skipped, rule }","content":{"application/json":{"example":{"linked":120,"skipped":0,"rule":{"id":"clrule1","sourceCatalogId":"clcat00","sourceCatalogName":"Main","percent":10,"rounding":"step","roundStep":100,"linkAll":true}}}}},"400":{"description":"VALIDATION | LINK_SAME_CATALOG"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Catalogs"],"summary":"Remove products from this catalog (never deletes the products)","description":"Linked products leave this catalog (an \"all products\" link remembers the exclusion). Own products are skipped.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"example":{"productIds":["ckp1","ckp2"]}}}},"responses":{"200":{"description":"{ removed, skipped }","content":{"application/json":{"example":{"removed":2,"skipped":0}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"patch":{"tags":["Catalogs"],"summary":"Fix or free linked prices and stock in this catalog (bulk)","description":"Either `items: [{ productId, price?, comparePrice?, stock? }]` — each item sends a price, a stock or both\n(absent = unchanged); `price: null` goes back to the rule; `stock` (integer ≥ -1: -1 ask/not tracked,\n0 sold out here) is this catalog's own stock and `stock: null` goes back to the product's stock —\nor `{ productIds, percent }` to fix each selected product at its current price here ± percent\n(with the rule's rounding). Only linked products change; a product's own price/stock is edited on the product.\n`currency` (optional, per item): the currency of `price` — the store currency (default) or its charge currency (keeps a\nprice a connected app sent in it, `priceCurrency`); anything else → 400 UNSUPPORTED_CURRENCY.\n`excluded` (optional, per item): true = hide the product in this catalog only, keeping its fixed price, stock and\nposition here; false = show it again. It may also reach a product hidden here today (link row, or its home\ncatalog linked by a rule). A connected app's next stock push can bring an article back.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"fixed":{"value":{"items":[{"productId":"ckp1","price":85},{"productId":"ckp2","price":null}]}},"stock":{"value":{"items":[{"productId":"ckp1","stock":3},{"productId":"ckp2","stock":null}]}},"hide":{"value":{"items":[{"productId":"ckp1","excluded":true}]}},"percent":{"value":{"productIds":["ckp1","ckp2"],"percent":-5}}}}}},"responses":{"200":{"description":"{ updated, skipped }","content":{"application/json":{"example":{"updated":2,"skipped":0}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/link-rules/{sourceCatalogId}":{"put":{"tags":["Catalogs"],"summary":"Change the price rule of a linked source catalog (prices recompute live; fixed prices stay)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"sourceCatalogId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"percent":-15,"rounding":"99","linkAll":true}}}},"responses":{"200":{"description":"The rule","content":{"application/json":{"example":{"id":"clrule1","sourceCatalogId":"clcat00","sourceCatalogName":"Main","percent":-15,"rounding":"99","roundStep":100,"linkAll":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"CATALOG_NOT_FOUND | LINK_RULE_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Catalogs"],"summary":"Stop linking a source catalog (its products leave this catalog; nothing is deleted)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"sourceCatalogId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ ok, removed }","content":{"application/json":{"example":{"ok":true,"removed":120}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/catalogs/{id}/copy-products":{"post":{"tags":["Catalogs"],"summary":"Duplicate products of another catalog into this one (independent copies)","description":"Copies are new products homed here (same photos, sizes, colors, tags, packaging), with the\nprice adjusted once by `percent`/`rounding`. They count toward the plan's product limit\n(403 PLAN_LIMIT_PRODUCTS with `room`) and never receive later changes of the originals.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"sourceCatalogId":"ckcat1","productIds":["ckp1","ckp2"],"percent":-10,"rounding":"none"}}}},"responses":{"201":{"description":"{ copied }","content":{"application/json":{"example":{"copied":24}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_LIMIT_PRODUCTS"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/colors":{"get":{"tags":["Colors"],"summary":"List colors","description":"Sorted by `order` ascending.","responses":{"200":{"description":"Colors","content":{"application/json":{"example":[{"id":"clcol1","tenantId":"clten1","name":"Navy","hex":"#1F2A44","order":3,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Colors"],"summary":"Create a color","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":50},"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","nullable":true}}},"example":{"name":"Navy","hex":"#1F2A44"}}}},"responses":{"201":{"description":"Color creado","content":{"application/json":{"example":{"id":"clcol1","tenantId":"clten1","name":"Navy","hex":"#1F2A44","order":3,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/colors/{id}":{"put":{"tags":["Colors"],"summary":"Update a color","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"hex":{"type":"string","nullable":true}}},"example":{"hex":"#22304D"}}}},"responses":{"200":{"description":"Color actualizado","content":{"application/json":{"example":{"id":"clcol1","tenantId":"clten1","name":"Navy","hex":"#22304D","order":3,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Colors"],"summary":"Delete a color","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Color eliminado","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/colors/reorder":{"patch":{"tags":["Colors"],"summary":"Reorder colors","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","order"],"properties":{"id":{"type":"string"},"order":{"type":"integer"}}}},"example":{"ids":["clcol2","clcol1"]}}}},"responses":{"200":{"description":"Orden actualizado","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/colors/palettes":{"get":{"tags":["Colors"],"summary":"List palettes","responses":{"200":{"description":"Palettes with their colors","content":{"application/json":{"example":[{"id":"clpal1","tenantId":"clten1","name":"Winter","createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z","colors":[{"paletteId":"clpal1","colorId":"clcol1","order":0,"color":{"id":"clcol1","tenantId":"clten1","name":"Navy","hex":"#1F2A44","order":3,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}]}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Colors"],"summary":"Create a palette","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":50},"colorIds":{"type":"array","items":{"type":"string"}}}},"example":{"name":"Winter","colorIds":["clcol1"]}}}},"responses":{"201":{"description":"Paleta creada","content":{"application/json":{"example":{"id":"clpal1","tenantId":"clten1","name":"Winter","createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z","colors":[{"paletteId":"clpal1","colorId":"clcol1","order":0,"color":{"id":"clcol1","tenantId":"clten1","name":"Navy","hex":"#1F2A44","order":3,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/colors/palettes/{id}":{"put":{"tags":["Colors"],"summary":"Update a palette (replaces its colors)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"colorIds":{"type":"array","items":{"type":"string"}}}},"example":{"name":"Winter 27","colorIds":["clcol1"]}}}},"responses":{"200":{"description":"Paleta actualizada","content":{"application/json":{"example":{"id":"clpal1","tenantId":"clten1","name":"Winter 27","createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z","colors":[{"paletteId":"clpal1","colorId":"clcol1","order":0,"color":{"id":"clcol1","tenantId":"clten1","name":"Navy","hex":"#1F2A44","order":3,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Colors"],"summary":"Delete a palette","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paleta eliminada","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/curvas":{"get":{"tags":["Curvas"],"summary":"List size runs","responses":{"200":{"description":"Size runs, oldest first","content":{"application/json":{"example":[{"id":"clcur1","tenantId":"clten1","name":"S-XL","items":[{"sizeId":"clsz0","quantity":1},{"sizeId":"clsz1","quantity":2},{"sizeId":"clsz2","quantity":2},{"sizeId":"clsz3","quantity":1}],"createdAt":"2026-11-27T12:00:00.000Z"}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Curvas"],"summary":"Create a size run","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","items"],"properties":{"name":{"type":"string","maxLength":50},"items":{"type":"array","items":{"type":"object","required":["sizeId","quantity"],"properties":{"sizeId":{"type":"string"},"quantity":{"type":"integer","minimum":0}}}}}},"example":{"name":"S-XL","items":[{"sizeId":"clsz0","quantity":1},{"sizeId":"clsz1","quantity":2},{"sizeId":"clsz2","quantity":2},{"sizeId":"clsz3","quantity":1}]}}}},"responses":{"201":{"description":"Curva creada","content":{"application/json":{"example":{"id":"clcur1","tenantId":"clten1","name":"S-XL","items":[{"sizeId":"clsz0","quantity":1},{"sizeId":"clsz1","quantity":2},{"sizeId":"clsz2","quantity":2},{"sizeId":"clsz3","quantity":1}],"createdAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/curvas/{id}":{"put":{"tags":["Curvas"],"summary":"Update a size run","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","items"],"properties":{"name":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"sizeId":{"type":"string"},"quantity":{"type":"integer"}}}}}},"example":{"name":"S-XL (2-2)"}}}},"responses":{"200":{"description":"Curva actualizada","content":{"application/json":{"example":{"id":"clcur1","tenantId":"clten1","name":"S-XL (2-2)","items":[{"sizeId":"clsz0","quantity":1},{"sizeId":"clsz1","quantity":2},{"sizeId":"clsz2","quantity":2},{"sizeId":"clsz3","quantity":1}],"createdAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Curvas"],"summary":"Delete a size run","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Curva eliminada","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tenant/domains":{"get":{"tags":["Domains"],"summary":"List the store's custom domains with the DNS records to create","responses":{"200":{"description":"{ domains, activePrimary, provider, sslAutomation, cnameTarget, serverIp, limit, featureEnabled }","content":{"application/json":{"example":{"domains":[{"id":"ckd1","hostname":"catalogo.mibrand.com","kind":"subdomain","isPrimary":true,"redirect":true,"status":"active","records":[{"type":"CNAME","name":"catalogo","value":"domains.sellalog.com","purpose":"routing"}]}],"activePrimary":"catalogo.mibrand.com","provider":"cloudflare","sslAutomation":true,"cnameTarget":"domains.sellalog.com","serverIp":"72.60.255.2","limit":5,"featureEnabled":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders":{"get":{"tags":["Orders"],"summary":"List orders (filters: status, payment, q, visitorId)","parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["RECEIVED","PENDING","CONFIRMED","PREPARING","READY","SHIPPED","DELIVERED","CANCELLED"]}},{"in":"query","name":"payment","description":"Online payment state (store's Mercado Pago); `any` = every order with a payment","schema":{"type":"string","enum":["pending","approved","rejected","refunded","any"]}},{"in":"query","name":"unseen","description":"1 = only orders nobody on the team has opened yet (viewedAt null, not cancelled, not a pay-first order still waiting for its payment): the home's new orders and the sidebar badge","schema":{"type":"string","enum":["1"]}},{"in":"query","name":"seller","description":"Who made the sale: a seller id (GET /orders/sellers), or `none` = orders with no seller","schema":{"type":"string"}},{"in":"query","name":"sellerName","description":"Exact name of a seller with no id (a dashboard user's link, a removed seller, an API caller)","schema":{"type":"string"}},{"in":"query","name":"q","description":"Order number (#1003), customer name/email/phone/company, or seller name","schema":{"type":"string"}},{"in":"query","name":"since","description":"Created at or after this instant (ISO 8601). With `sort=asc`, poll forward from the last order you saw","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"until","description":"Created before this instant (ISO 8601)","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"updatedSince","description":"Changed (status, items, payment…) at or after this instant","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"catalogId","description":"Orders placed in one catalog","schema":{"type":"string"}},{"in":"query","name":"kind","schema":{"type":"string","enum":["order","quote"]}},{"in":"query","name":"sort","description":"desc (default) = newest first · asc = oldest first","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"in":"query","name":"page","schema":{"type":"integer","default":1}},{"in":"query","name":"limit","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"Paginated orders (each with seller { id, name } | null — id null = a name only). `hasMore` = there is a next page","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}},"example":{"orders":[{"id":"clord1","number":1042,"kind":"order","channel":"web","status":"RECEIVED","customerName":"Ana Gómez","customerEmail":"ana@example.com","customerPhone":"+5215555550000","customerCompany":"Tienda Norte","currency":"MXN","items":[{"productId":"clprd01","name":"White Oxford Shirt","sku":"SHIRT-001","qty":12,"price":180,"packaging":"Caja"}],"subtotal":2160,"total":2160,"catalogId":"clcat01","seller":{"id":"cls1","name":"Laura"},"viewedAt":null,"createdAt":"2026-11-27T12:00:00.000Z"}],"total":1,"page":1,"limit":50,"hasMore":false}}}},"400":{"description":"VALIDATION (since / until / updatedSince is not a date)"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/{id}":{"get":{"tags":["Orders"],"summary":"Get an order (with visitor)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"ORDER_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Orders"],"summary":"Delete an order","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"ORDER_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/{id}/status":{"put":{"tags":["Orders"],"summary":"Change the order status","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["RECEIVED","PENDING","CONFIRMED","PREPARING","READY","SHIPPED","DELIVERED","CANCELLED"]}}},"example":{"status":"CONFIRMED"}}}},"responses":{"200":{"description":"Estado actualizado","content":{"application/json":{"example":{"id":"clord1","number":1042,"status":"CONFIRMED","total":2450,"currency":"MXN","seller":null,"updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/export.csv":{"get":{"tags":["Orders"],"summary":"CSV export of orders (one row per order line, UTF-8 BOM)","description":"Same filters as GET /orders, so the file matches the list on screen.","parameters":[{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"kind","schema":{"type":"string","enum":["order","quote"]}},{"in":"query","name":"channel","schema":{"type":"string","example":"whatsapp"}},{"in":"query","name":"q","schema":{"type":"string"},"description":"Customer name/email/phone/company, or order number (#1003)"},{"in":"query","name":"visitorId","schema":{"type":"string"}}],"responses":{"200":{"description":"text/csv","content":{"text/csv":{"schema":{"type":"string"},"example":"﻿number,orderId,kind,channel,createdAt,status,customerName,…\r\n1042,clord1,order,web,2026-11-27T12:00:00.000Z,RECEIVED,Ana Gómez,…\r\n"}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/packing.pdf":{"get":{"tags":["Orders"],"summary":"Packing sheet (\"Hoja de preparación\") of one or more orders, as a PDF","description":"For the warehouse: order number, date, customer, seller, delivery and note, then one block per product (sorted by\nname/code) with a thumbnail, the order's codes (same rule as the buyer's order: `cardFields.skuSource`), and per\nline its color, form (packs × units), units, a size grid (sizes × qty, when the sizes are known) and a tick box.\n**No prices.** Several ids → one PDF, one section per order (new page each), in the order given. Language = the\nstore's locale. Any team role (also API keys).\n","parameters":[{"in":"query","name":"ids","required":true,"schema":{"type":"string"},"description":"Comma-separated order ids (max 50)"}],"responses":{"200":{"description":"application/pdf","content":{"application/pdf":{"schema":{"type":"string","format":"binary"},"example":"%PDF-1.3 … (binary)"}}},"400":{"description":"VALIDATION (no ids / more than 50)"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"ORDER_NOT_FOUND (none of the ids is an order of this store)"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/sellers":{"get":{"tags":["Orders"],"summary":"Sellers to filter orders by (and to assign an order to)","description":"`sellers` = the store's sellers (sellers app) with how many orders each has; `others` = names on orders with no\nseller id (a dashboard user's price link, a removed seller, an API caller's sellerName) → filter with\n`GET /orders?sellerName=`; `withoutSeller` = orders with no seller (`?seller=none`). Any team role.\n","responses":{"200":{"content":{"application/json":{"example":{"sellers":[{"id":"cls1","name":"Laura","active":true,"orders":12}],"others":[{"name":"Marta","orders":3}],"withoutSeller":40}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/{id}/items":{"put":{"tags":["Orders"],"summary":"Replace the items of an order (e.g. pricing a quote)","description":"Totals are recalculated server-side. Lines that carry a full size-run discount (`curvaRun`,\n`curvaDiscount`, set when the order was placed) get `curvaQty` / `curvaAmount` recomputed from\ntheir new `qty` and `price`; `total` = `subtotal` − those discounts.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object"},"description":"Full items array with updated prices"}}}}}},"responses":{"200":{"description":"Updated order with the recalculated total","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/orders/{id}/split":{"post":{"tags":["Orders"],"summary":"Split an order in two","description":"Moves the given items to a new RECEIVED order (copying customer, currency and visitor). The original keeps the rest; totals are recalculated.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itemIndices"],"properties":{"itemIndices":{"type":"array","items":{"type":"integer"},"description":"Zero-based indexes of the items to move to the new order"}}}}}},"responses":{"200":{"description":"Split done","content":{"application/json":{"schema":{"type":"object","properties":{"original":{"$ref":"#/components/schemas/Order"},"newOrder":{"$ref":"#/components/schemas/Order"}}}}}},"400":{"description":"ORDER_SPLIT_INDICES_REQUIRED | ORDER_SPLIT_EMPTY | SPLIT_EMPTY_ORDER"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"ORDER_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/packaging":{"get":{"tags":["Packaging"],"summary":"List packaging options","responses":{"200":{"description":"Options sorted by `order`","content":{"application/json":{"example":[{"id":"clpk1","tenantId":"clten1","name":"Caja","multiplier":"12","ruleBase":"fixed","discount":"10","order":1,"autoAssign":false,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Packaging"],"summary":"Create a packaging option","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"multiplier":{"type":"number","description":"Multiplier over the color total or the size run units; for ruleBase fixed, the number of units (whole, ≥ 1)"},"ruleBase":{"type":"string","enum":["colors","curva","fixed"],"description":"Base for the quantity: color total, size-run units, or a fixed number of units (fixed: only offered on products with no sizes or a single size)"},"discount":{"type":"number","description":"Percent discount (negative = surcharge) when buying this option"},"order":{"type":"integer"}}},"example":{"name":"Caja","multiplier":12,"ruleBase":"fixed","discount":10}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"example":{"id":"clpk1","tenantId":"clten1","name":"Caja","multiplier":"12","ruleBase":"fixed","discount":"10","order":1,"autoAssign":false,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/packaging/{id}":{"put":{"tags":["Packaging"],"summary":"Update a packaging option","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"multiplier":{"type":"number"},"ruleBase":{"type":"string","enum":["colors","curva","fixed"]},"discount":{"type":"number"},"order":{"type":"integer"}}},"example":{"discount":12}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"example":{"id":"clpk1","tenantId":"clten1","name":"Caja","multiplier":"12","ruleBase":"fixed","discount":"12","order":1,"autoAssign":false,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Packaging"],"summary":"Delete a packaging option","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"example":{"ok":true,"productsUpdated":14}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/packaging/reorder":{"patch":{"tags":["Packaging"],"summary":"Reorder packaging options (the first applicable one is the catalog's default)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"integer"}}}},"example":{"ids":["clpk2","clpk1"]}}}},"responses":{"200":{"description":"{ ok: true }","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/price-links":{"get":{"tags":["PriceLinks"],"summary":"List price links (with buyer tracking numbers)","parameters":[{"in":"query","name":"active","schema":{"type":"boolean"},"description":"true → only links that have not expired"},{"in":"query","name":"expiredUnopened","schema":{"type":"boolean"},"description":"true → expired and never opened by a buyer"},{"in":"query","name":"externalRef","schema":{"type":"string"},"description":"Exact match on your own id"},{"in":"query","name":"catalogId","schema":{"type":"string"},"description":"Only the links of this catalog"},{"in":"query","name":"clientName","schema":{"type":"string"},"description":"Exact client name (case-insensitive): find a customer's link before making another"},{"in":"query","name":"kind","schema":{"type":"string","enum":["catalog","product","all"],"default":"catalog"},"description":"catalog = price links (default); product = single-product passes (each with `product { id, name, image, active } | null`); all = both"},{"in":"query","name":"seller","schema":{"type":"string"},"description":"An app seller's id (GET /sellers) → only the links they sent; `none` → only the links no app seller sent (panel, API)"},{"in":"query","name":"sort","schema":{"type":"string","enum":["created","activity"],"default":"created"},"description":"activity → by last buyer activity (open, product view, ping, cart, order), newest first; never-touched links after them, newest first"},{"in":"query","name":"limit","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"Links, newest first (or by last activity with `sort=activity`) — each with `kind` (catalog | product), url (opens its catalog; a pass: its product page), catalogId, catalog { id, name, slug, active } | null,\nclientName, clientPhone, externalRef, firstOpenedAt, lastOpenedAt, opens (buyer sessions), visitors (buyers),\nproductsViewed, orderCount, lastOrder { id, number, total, currency, status, paymentStatus } | null,\ncartTotal, cartUpdatedAt, lastActivityAt (last buyer activity | null). Opens/visitors never include the store's team or bots.\n","content":{"application/json":{"example":[{"id":"clx1a2b3c","token":"Qm9vb3N0ZXJMaW5rVG9rZW4","url":"https://sellalog.com/northwind/?p=Qm9vb3N0ZXJMaW5rVG9rZW4","catalogId":null,"catalog":null,"clientName":"Tienda Fer","clientPhone":"+5491155550000","externalRef":"venta-8812","minutes":1440,"expiresAt":"2026-10-23T15:00:00.000Z","createdAt":"2026-10-22T15:00:00.000Z","createdBy":"API","showStock":null,"firstOpenedAt":"2026-10-22T15:04:10.000Z","lastOpenedAt":"2026-10-22T18:30:00.000Z","opens":2,"active":true,"visitors":1,"productsViewed":7,"orderCount":1,"lastOrder":{"id":"clo9","number":1042,"total":18500,"currency":"MXN","status":"RECEIVED","paymentStatus":null,"createdAt":"2026-10-22T18:41:00.000Z"},"cartTotal":18500,"cartUpdatedAt":"2026-10-22T18:39:00.000Z"}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["PriceLinks"],"summary":"Create a temporary price link","description":"Crea un token aleatorio válido por `minutes`. Si no se envía, usa\n`settings.priceLinkMinutes` del tenant y, en su defecto, 15 minutos.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"minutes":{"type":"integer","minimum":1,"maximum":259200,"example":15,"description":"Duration in minutes (1 to 259200 = 180 days). Presets — 1440 = 24 h, 21600 = 15 days, 43200 / 129600 / 259200 = 1 / 3 / 6 months"},"remember":{"type":"boolean","description":"Save this duration as the tenant's default"},"showStock":{"type":"boolean","nullable":true,"description":"Fuerza mostrar (`true`) u ocultar (`false`) el stock en este link.\nAusente o `null` hereda `settings.hideStock` del tenant.\n"},"catalogId":{"type":"string","nullable":true,"description":"Catalog the link opens (`/c/{slug}?p=`, or the root for the default catalog) and the ONLY one\nwhere it reveals prices / applies its stock choice. Must be an active catalog of the store\n(400 PRICE_LINK_CATALOG). Absent or null = unscoped (default catalog, grants everywhere).\n"},"clientName":{"type":"string","nullable":true,"example":"Tienda Fer","description":"Who the link is for (trimmed, max 80). Shown in the links list and the bot."},"clientPhone":{"type":"string","nullable":true,"example":"+5491155550000","description":"Client's phone. Normalized to E.164 (national numbers use the store's country); 400\nPRICE_LINK_PHONE when it isn't a phone. Copied onto orders placed through the link when the\nbuyer leaves the phone empty.\n"},"externalRef":{"type":"string","nullable":true,"example":"venta-8812","description":"Your own id for this link (e.g. the sale id in your CRM), max 120. Filter with GET ?externalRef="},"quick":{"type":"boolean","description":"One-tap link. `catalogId` / `showStock` not sent → the store's quick-link defaults\n(`settings.priceLinkCatalogId`, else the default catalog; `settings.botStock`). Duration →\n`settings.priceLinkMinutes` as always.\n"},"sellerName":{"type":"string","nullable":true,"example":"Laura","description":"Who sends the link (max 80), shown as \"Vendedor\" in the opens history. Dashboard default = the user's name."},"sellerId":{"type":"string","nullable":true,"description":"Send it on behalf of one of the store's app sellers (`GET /sellers`): the link carries their id and\ncurrent name (overrides `sellerName`), so orders through it are credited to them and it counts in\ntheir `links`. 404 SELLER_NOT_FOUND when the id is not a seller of this store.\n"}}}}}},"responses":{"201":{"description":"Link generado","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"token":{"type":"string"},"minutes":{"type":"integer"},"expiresAt":{"type":"string","format":"date-time"},"catalogId":{"type":"string","nullable":true},"catalog":{"type":"object","nullable":true,"description":"{ id, name, slug, active } — null when unscoped (or the catalog was deleted)"},"clientName":{"type":"string","nullable":true},"clientPhone":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"sellerName":{"type":"string","nullable":true},"shareText":{"type":"string","description":"Ready-to-send message (settings.priceLinkMessage or the default) with the link"},"whatsappUrl":{"type":"string","description":"https://wa.me/<clientPhone>?text=… (or https://wa.me/?text=… without phone)"}}}}}},"400":{"description":"PRICE_LINK_DURATION | PRICE_LINK_CATALOG | PRICE_LINK_PHONE | VALIDATION"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"SELLER_NOT_FOUND (sellerId)"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/price-links/product":{"post":{"tags":["PriceLinks"],"summary":"Share ONE product — single-product pass (reused when an identical one exists)","description":"\"Compartir\" in the panel. A price link scoped to ONE product (`productId`) in ONE catalog (`catalogId`): the\nrecipient opens `{catalogUrl}/p/{productId}?p=<token>` and sees only that product — photos, sizes, colors,\ndescription, code; price when `showPrices`, stock when `showStock` — even in a lead/private catalog, and can\norder it. Every other product, list, PDF or catalog answers as without the link (gate / hidden prices). Link\npreviews show the product photo and name (`noindex`). **No expiry**: `expiresAt` null, `noExpiry` true; revoke\nwith `DELETE /price-links/{id}`. An identical live pass (same product, catalog, showPrices, showStock) is\nreturned again (`reused: true`, 200) instead of creating a duplicate (201). Opens are tracked like any price link\n(`GET /price-links?kind=product`, `/price-links/opens`, webhooks). Not listed by `GET /price-links` by default.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productId"],"properties":{"productId":{"type":"string"},"catalogId":{"type":"string","nullable":true,"description":"Active catalog the product is in (home or linked). Absent = its home catalog (else the first one it is linked into)"},"showPrices":{"type":"boolean","default":true},"showStock":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"An identical live pass, reused (`reused: true`)"},"201":{"description":"New pass","content":{"application/json":{"example":{"id":"clp1","kind":"product","productId":"ckp1","catalogId":"may","catalog":{"id":"may","name":"Mayoristas","slug":"mayoristas","active":true},"url":"https://sellalog.com/northwind/p/ckp1?p=Qm9vb3N0ZXJMaW5rVG9rZW4","showPrices":true,"showStock":false,"expiresAt":null,"noExpiry":true,"minutes":0,"opens":0,"active":true,"reused":false,"product":{"id":"ckp1","name":"Vestido Midi","image":"https://res.cloudinary.com/…","active":true}}}}},"400":{"description":"VALIDATION | PRICE_LINK_CATALOG (catalog inactive, another store's or without this product)"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"FORBIDDEN (STAFF) | PLAN_FEATURE_REQUIRED"},"404":{"description":"PRODUCT_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/price-links/opens":{"get":{"tags":["PriceLinks"],"summary":"Opens history — every buyer open of the store's price links, with date and time","description":"Newest first, one row per buyer session that opened a link (the team and bots never count). Each row: `at`,\n`first` (the link's first open), `newVisitor` (false = the same buyer came back), and the link: client,\ncatalog, `sellerName` (who sent it), `active`, `orderCount`, `lastOrder`. The first page also lists\n`sellers` (names, for a filter). Paginate with `cursor` = `nextCursor`.\n","parameters":[{"in":"query","name":"seller","schema":{"type":"string"},"description":"Exact sellerName"},{"in":"query","name":"catalogId","schema":{"type":"string"}},{"in":"query","name":"q","schema":{"type":"string"},"description":"Part of the client name"},{"in":"query","name":"limit","schema":{"type":"integer","default":50,"maximum":200}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"id":"cle1","at":"2026-11-22T21:42:10.000Z","first":false,"newVisitor":false,"link":{"id":"clx1a2b3c","clientName":"Tienda Fer","clientPhone":"+5491155550000","catalogId":"cat1","catalogName":"Mayoristas","sellerName":"Laura","active":true,"orderCount":1,"lastOrder":{"id":"clo9","number":1042,"total":18500,"currency":"ARS","status":"RECEIVED","paymentStatus":null,"createdAt":"2026-11-22T22:01:00.000Z"}}}],"nextCursor":null,"sellers":["Laura","Martín"]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/price-links/{id}":{"delete":{"tags":["PriceLinks"],"summary":"Revoke a link before it expires","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Link revocado","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"Link no encontrado"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"patch":{"tags":["PriceLinks"],"summary":"Extend / renew / edit a link without changing its url (token)","description":"`minutes` sets a new expiry from now (1–259200, i.e. up to 180 days); `expiresAt` sets an exact future moment (≤ 180 days ahead) —\nsend one of them, not both. Works on an expired link too (reactivates it with the same url). A new expiry\nre-arms the `price_link.expired_unopened` webhook. `clientName` / `clientPhone` / `externalRef` /\n`showStock`: null clears. `catalogId` moves a catalog link to another active catalog (same token; a url already sent on\nthe old catalog's own domain is sent to the new one by the catalog app); a product pass keeps its catalog.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"minutes":1440,"clientPhone":"+5491155550000","externalRef":"venta-8812"}}}},"responses":{"200":{"description":"The link (same shape as POST; token and url unchanged)","content":{"application/json":{"example":{"id":"clpl1","url":"https://sellalog.com/northwind/c/tienda-norte?p=pl_8fK2…","minutes":43200,"expiresAt":"2026-12-27T12:00:00.000Z","clientName":"Tienda Norte","externalRef":"link-tienda-norte","catalogId":"clcat01"}}}},"400":{"description":"PRICE_LINK_DURATION | PRICE_LINK_PHONE | PRICE_LINK_CATALOG | VALIDATION"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"PRICE_LINK_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/price-links/{id}/events":{"get":{"tags":["PriceLinks"],"summary":"What the client did with the link (opens, products viewed, cart, orders, timeline)","description":"Buyers only (the store's team and bots never count). `secondsActive` = active seconds reported by the\ncatalog while the link was open (approximate). `cart` = latest cart built through the link, with lines and\nprices as the catalog showed them (informational; orders are priced by the server). Timeline newest first,\npaginated with `cursor` (= `nextCursor` of the previous page). Types: open | view (first view of a product)\n| cart (coalesced within 2 min) | order | paid. `viewedProducts[].code` = the code the store's buyers see (store\nsetting skuSource: own / supplier / both → own); `favorite` = the link's visitor hearted it in the catalog or liked\nit in Choose; `favorites` = how many of the viewed products are favorites.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":50,"maximum":200}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"link":{"id":"clx1a2b3c","url":"https://sellalog.com/northwind/?p=Qm9v...","clientName":"Tienda Fer","clientPhone":"+5491155550000","externalRef":"venta-8812","expiresAt":"2026-10-23T15:00:00.000Z","active":true},"opens":2,"firstOpenedAt":"2026-10-22T15:04:10.000Z","lastOpenedAt":"2026-10-22T18:30:00.000Z","visitors":1,"secondsActive":412,"viewedProducts":[{"productId":"ckp1","sku":"TS-001","code":"TS-001","name":"Playera básica","views":4,"favorite":true}],"favorites":1,"cart":{"lines":[{"productId":"ckp1","sku":"TS-001","name":"Playera básica","packaging":"Caja x12","qty":24,"price":95}],"total":2280,"currency":"MXN","updatedAt":"2026-10-22T18:39:00.000Z"},"timeline":[{"type":"paid","at":"2026-10-22T18:45:00.000Z","orderId":"clo9","number":1042,"total":2280,"currency":"MXN"},{"type":"order","at":"2026-10-22T18:41:00.000Z","orderId":"clo9","number":1042,"total":2280,"currency":"MXN"},{"type":"cart","at":"2026-10-22T18:39:00.000Z","total":2280,"currency":"MXN","lines":1,"units":24},{"type":"view","at":"2026-10-22T15:05:00.000Z","productId":"ckp1","sku":"TS-001","name":"Playera básica"},{"type":"open","at":"2026-10-22T15:04:10.000Z","first":true,"newVisitor":true}],"nextCursor":null,"orders":[{"id":"clo9","number":1042,"total":2280,"currency":"MXN","status":"RECEIVED","paymentStatus":"approved","createdAt":"2026-10-22T18:41:00.000Z"}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"PRICE_LINK_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/reprice":{"post":{"tags":["Products"],"summary":"Recompute prices from cost × margin with the store's current rounding — OWNER/ADMIN","description":"Only products with both `cost` and `margin`. Each price becomes cost × (1 + margin/100), rounded the store's\nway; unchanged prices are skipped. The previous prices are kept for \"Deshacer\" (`POST /products/price-undo`).\nNo body.\n","responses":{"200":{"description":"Result","content":{"application/json":{"example":{"round":10,"scanned":420,"updated":37,"undo":37}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"FORBIDDEN"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/products/round-prices":{"post":{"tags":["Products"],"summary":"Round the prices already stored UP to the store's step (settings.priceRound) — OWNER/ADMIN","description":"One-time catch-up for prices saved before the rounding was set (new writes are rounded on save).\nPrice and compare price of every product of the store (active or not) go UP to the next multiple\nof the step; cost is never touched, products with a cost get their margin recomputed. Linked-catalog\nprices are left alone. `dryRun` defaults to true: only `dryRun: false` writes.\nIdempotent — a second run changes nothing. 400 `PRICE_ROUND_NOT_SET` when the store has no step.\nA real run records the previous values for \"Deshacer\" (`undo` = products it covers; see /products/price-undo).\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dryRun":{"type":"boolean","default":true}}}}}},"responses":{"200":{"content":{"application/json":{"example":{"step":0.5,"dryRun":true,"total":672,"changed":610,"updated":0,"undo":0,"examples":[{"id":"cm…","name":"Bermuda Cargo","sku":"W123","price":46.72,"newPrice":47,"comparePrice":null,"newComparePrice":null}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/products/price-undo":{"get":{"tags":["Products"],"summary":"The store's last bulk price change that can still be undone, or null","description":"Bulk price changes — `POST /products/round-prices` (kind `round`), `POST /products/reprice` (`reprice`) and\n`PATCH /products/bulk` with `updates.price`, `updates.comparePrice` or `pricePercent` (`bulk`) — keep the previous\nprice, compare price and margin of every product they change. Only the LAST change per store is kept (a new\none replaces it); it expires 7 days after it was made. `count` = products changed. `meta`: `{ step }` for\nround/reprice, `{ percent?, price?, comparePrice? }` for bulk.\n","responses":{"200":{"content":{"application/json":{"examples":{"some":{"value":{"kind":"round","count":437,"createdAt":"2026-10-11T14:02:11.000Z","expiresAt":"2026-10-18T14:02:11.000Z","meta":{"step":10}}},"none":{"value":null}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Products"],"summary":"Undo the last bulk price change (\"Deshacer\")","description":"Puts back price, compare price and margin ONLY on products whose price and compare price are still the ones\nthe change wrote; products edited since are left alone (`skipped`), deleted ones are ignored (`missing`).\n`dryRun` defaults to true (only counts); `dryRun: false` writes and then deletes the undo. Undoing `round` /\n`reprice` is OWNER/ADMIN (like making them; API keys act as ADMIN); `bulk` follows PATCH /products/bulk (any role).\n404 `PRICE_UNDO_NOT_FOUND` when there is nothing to undo (none, already undone or older than 7 days).\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dryRun":{"type":"boolean","default":true}}}}}},"responses":{"200":{"content":{"application/json":{"example":{"kind":"round","dryRun":false,"total":437,"restore":436,"restored":436,"skipped":1,"missing":0}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/products":{"get":{"tags":["Products"],"summary":"List products (filters: sku, catalogId, q, externalRef, active, updatedSince; optional pages)","description":"Includes tags and sizes. Color hex values come from the tenant's color library. `catalogId` is the\nproduct's home catalog; `linkedCatalogIds` the other catalogs it is linked into (their prices: GET /catalogs/{id}/products).\nInactive products included (filter with `active`). Products of a catalog in the trash are left out.\n\n**Pages** (optional): with `limit` (1–500) and `offset` the body is still an array, and the headers carry\n`X-Total-Count` (all matches), `X-Limit` and `X-Offset`. Without `limit`: every product, as always.\n","parameters":[{"in":"query","name":"sku","schema":{"type":"string"},"description":"Exact (case-insensitive), own or supplier code"},{"in":"query","name":"catalogId","schema":{"type":"string"},"description":"Home catalog"},{"in":"query","name":"q","schema":{"type":"string"},"description":"Part of the name"},{"in":"query","name":"externalRef","schema":{"type":"string"},"description":"Exact"},{"in":"query","name":"active","schema":{"type":"string","enum":["true","false"]}},{"in":"query","name":"updatedSince","schema":{"type":"string","format":"date-time"},"description":"Changed at or after this instant (400 VALIDATION when not a date)"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500}},{"in":"query","name":"offset","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Products","headers":{"X-Total-Count":{"schema":{"type":"integer"},"description":"Only with ?limit: total matches"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Products"],"summary":"Create a product","description":"To create-or-update by your own id (re-runs without duplicates) use `PUT /products/by-ref/{ref}`. Price fields\nare rounded the store's way. `catalogId` (or `catalogRef` = a catalog's externalRef) = its home catalog; none =\nthe store's main catalog. Counts toward the plan's product limit (403 PLAN_LIMIT_PRODUCTS).\n","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","price"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number","minimum":0},"comparePrice":{"type":"number","nullable":true},"images":{"type":"array","items":{"type":"string"}},"colorItems":{"type":"array","items":{"type":"object"}},"stock":{"type":"integer"},"sale":{"type":"boolean"},"highlighted":{"type":"boolean","description":"Destacado: first in the catalog's default order"},"active":{"type":"boolean"},"dtoCurva":{"type":"integer"},"curvaUnits":{"type":"integer"},"packagingItems":{"type":"array","items":{"type":"object"}},"tagIds":{"type":"array","items":{"type":"string"}},"sizes":{"type":"array","items":{"type":"object","properties":{"sizeId":{"type":"string"},"quantity":{"type":"integer"}}}},"sku":{"type":"string","nullable":true,"maxLength":80},"minQty":{"type":"integer","minimum":1,"default":1},"catalogId":{"type":"string","nullable":true},"catalogRef":{"type":"string","description":"A catalog's externalRef, instead of catalogId (400 CATALOG_INVALID when unknown)"},"externalRef":{"type":"string","nullable":true,"description":"Your own id, unique per store (409 EXTERNAL_REF_TAKEN)"}}},"example":{"name":"White Oxford Shirt","price":18,"sku":"SHIRT-001","externalRef":"art-1001","catalogId":"clcat00","stock":40,"images":["https://res.cloudinary.com/demo/image/upload/shirt.jpg"],"tagIds":["cltag1"],"sizes":[{"sizeId":"clsz1","quantity":1}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"},"example":{"id":"clprd01","name":"White Oxford Shirt","sku":"SHIRT-001","externalRef":"art-1001","price":"18.00","comparePrice":null,"cost":null,"margin":null,"images":["https://res.cloudinary.com/demo/image/upload/shirt.jpg"],"stock":40,"stockStatus":null,"minQty":1,"active":true,"catalogId":"clcat00","colorItems":[],"packagingItems":[],"sizes":[],"tags":[],"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_LIMIT_PRODUCTS"},"409":{"$ref":"#/components/responses/RefConflict"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/by-ref/{ref}":{"get":{"tags":["Products"],"summary":"One product by your own id (externalRef)","description":"Same answer as `GET /products/{id}`. Only the caller's store is searched — another store's ref is a 404.","parameters":[{"$ref":"#/components/parameters/ExternalRef"}],"responses":{"200":{"description":"The product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"EXTERNAL_REF_INVALID"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"PRODUCT_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"put":{"tags":["Products"],"summary":"Create or update a product by your own id (upsert)","description":"The store's product with `externalRef = ref` is updated exactly like `PUT /products/{id}` (partial: only what\nyou send changes) → **200**, `X-Upsert: updated`. None → created like `POST /products` (`name` and `price`\nrequired, plan product limit) → **201**, `X-Upsert: created`. Repeating the call never makes a second product.\nScoped to the caller's store. `catalogRef` (a catalog's externalRef) may replace `catalogId`. A product of a\ncatalog in the trash → 409 PRODUCT_REF_IN_TRASH.\n","parameters":[{"$ref":"#/components/parameters/ExternalRef"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"create":{"summary":"First run (creates)","value":{"name":"Basic tee","price":12.5,"sku":"BT-1001","catalogRef":"base","stock":40,"images":["https://example.com/tee.jpg"]}},"update":{"summary":"Later runs (partial update)","value":{"price":13,"stock":25}}}}}},"responses":{"200":{"description":"Updated (`X-Upsert` header = updated)","headers":{"X-Upsert":{"schema":{"type":"string","enum":["updated"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"201":{"description":"Created (`X-Upsert` header = created)","headers":{"X-Upsert":{"schema":{"type":"string","enum":["created"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"VALIDATION | EXTERNAL_REF_INVALID | EXTERNAL_REF_MISMATCH | CATALOG_INVALID | INVALID_REFERENCE"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_LIMIT_PRODUCTS"},"409":{"description":"PRODUCT_REF_IN_TRASH | EXTERNAL_REF_TAKEN (race)"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/{id}":{"get":{"tags":["Products"],"summary":"One product (same shape as a list item)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"PRODUCT_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"put":{"tags":["Products"],"summary":"Update a product (partial)","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"price":16.5,"stock":12}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"example":{"id":"clprd01","name":"White Oxford Shirt","sku":"SHIRT-001","externalRef":"art-1001","price":"16.50","comparePrice":null,"cost":null,"margin":null,"images":["https://res.cloudinary.com/demo/image/upload/shirt.jpg"],"stock":12,"stockStatus":null,"minQty":1,"active":true,"catalogId":"clcat00","colorItems":[],"packagingItems":[],"sizes":[],"tags":[],"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Products"],"summary":"Delete a product","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"description":"Deletes it for good (its photos stay on the CDN). To hide it instead, `PUT /products/{id}` with `active false`.","responses":{"200":{"description":"Deleted","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/bulk":{"delete":{"tags":["Products"],"summary":"Delete many products at once — OWNER/ADMIN","description":"Deletes for good the store's products in `ids` (ids of other stores are ignored).","requestBody":{"required":true,"content":{"application/json":{"example":{"ids":["clprd01","clprd02"]}}}},"responses":{"200":{"description":"How many were deleted","content":{"application/json":{"example":{"deleted":2}}}},"400":{"description":"IDS_REQUIRED"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"FORBIDDEN"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"patch":{"tags":["Products"],"summary":"Bulk update products","description":"Applies field or tag changes to many products at once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"},"description":"Product ids to change"},"updates":{"type":"object","properties":{"price":{"type":"number"},"comparePrice":{"type":"number","nullable":true},"stock":{"type":"integer"},"active":{"type":"boolean"},"sale":{"type":"boolean"},"highlighted":{"type":"boolean"},"dtoCurva":{"type":"integer"},"description":{"type":"string","nullable":true}}},"addTagIds":{"type":"array","items":{"type":"string"}},"removeTagIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Number of updated products","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer"}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/{id}/duplicate":{"post":{"tags":["Products"],"summary":"Duplicate a product","description":"Creates an inactive copy named \"(copy)\" without SKU.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"Copy created","content":{"application/json":{"example":{"id":"clprd02","name":"White Oxford Shirt (copy)","sku":null,"externalRef":null,"price":"18.00","comparePrice":null,"cost":null,"margin":null,"images":["https://res.cloudinary.com/demo/image/upload/shirt.jpg"],"stock":40,"stockStatus":null,"minQty":1,"active":false,"catalogId":"clcat00","colorItems":[],"packagingItems":[],"sizes":[],"tags":[],"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"PRODUCT_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/import":{"post":{"tags":["Products"],"summary":"Import products from XLSX/CSV or JSON rows","description":"Acepta un archivo `.xlsx`/`.xls` (form-data con campo `file`) o un body JSON con `{ rows, imageBaseUrl }`.\n\nColumnas del XLS: SKU, NOMBRE, COSTO, PRECIO, PRECIO_TACHADO, IMAGENES, SECUENCIA, COLORES,\nCANTIDAD_POR_COLOR, DESCRIPCION, COMPOSICION, STOCK, OFERTA, DTO_CURVA,\nACTIVO, ETIQUETAS, TALLES, CANTIDAD_X_TALLE.\n\nCOSTO es privado y nunca se sirve al catálogo; sin él se asume igual a PRECIO. STOCK acepta un\nnúmero o los estados `in_stock` / `pending`. Las unidades de curva y el empaque se derivan de\nCANTIDAD_X_TALLE, así que no tienen columna propia.\n\nLas imágenes se suben a Cloudinary automáticamente. Los colores y talles se crean en el tenant si no existen.\n","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"imageBaseUrl":{"type":"string","description":"Base URL for relative image names in the file"}}}},"application/json":{"schema":{"type":"object","required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object"}},"imageBaseUrl":{"type":"string"}}}}}},"responses":{"201":{"description":"Import finished","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer"},"nombre":{"type":"string"},"error":{"type":"string"}}}}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/products/bulk-import":{"post":{"tags":["Products"],"summary":"Import products from a JSON array","description":"Alternative to /products/import for integrations. Each element must be a valid product as in POST /products (sku, minQty included).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["products"],"properties":{"products":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"201":{"description":"Import finished","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer"}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/products/undo-import":{"get":{"tags":["Products"],"summary":"Preview the products an undo would delete","description":"Lists products created in the last N minutes (nothing is deleted).","parameters":[{"in":"query","name":"minutes","schema":{"type":"integer","default":30,"minimum":1,"maximum":1440}}],"responses":{"200":{"description":"Recent products","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"minutes":{"type":"integer"},"products":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Products"],"summary":"Undo an import — delete recent products","description":"Deletes every product created in the last N minutes.","parameters":[{"in":"query","name":"minutes","schema":{"type":"integer","default":30,"minimum":1,"maximum":1440}}],"responses":{"200":{"description":"Number of deleted products","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"integer"}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/stock-import":{"post":{"tags":["Products"],"summary":"Update stock from an XLSX/CSV (SKU + STOCK columns)","description":"Acepta un archivo `.xlsx`/`.xls` con columnas ARTICULO y Disponible.\nBusca por `sourceSku` primero, luego por nombre. Devuelve cuántos se actualizaron y cuáles se saltaron.\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer"},"skipped":{"type":"array","items":{"type":"object","properties":{"articulo":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/products/catalog-prices":{"get":{"tags":["Products"],"summary":"Each product's price in the other catalogs it is linked into","description":"`{ productId: { catalogId: price } }` — the price buyers see in that catalog (link rule % + rounding, or the\nfixed price), computed by the same function as the public catalog. Only linked catalogs: the home catalog and\ncatalogs where the product isn't (or lives as an independent copy) are left out; products linked nowhere are\nabsent. Inactive products included. Without `ids`, every product of the store.\n","parameters":[{"in":"query","name":"ids","schema":{"type":"string"},"description":"Comma-separated product ids (max 5000); others of the store are ignored"}],"responses":{"200":{"description":"Prices per product and catalog","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"description":"The price (stored currency), or { price, currency } when a connected app priced it in the charge currency"}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/products/catalog-view":{"get":{"tags":["Products"],"summary":"Every catalog's members with the price and stock buyers get there (the Products page's catalog tabs)","description":"One entry per catalog of the store (trashed ones left out): `ids` = its products in catalog order (home and\nlinked; inactive included, like `GET /products`), `linked` = for the LINKED ones only, the price there (rule or\nfixed, `currency` when a connected app priced it in the charge currency) and `stockOverride` (null = the\nproduct's own stock, a number = this catalog's stock only, -1 = not tracked). Home members use the product's\nown numbers. `apps` = active connected apps that write this catalog's stock / prices (their registered name).\nSame isMember + priceInCatalog as the public catalog; 5 queries for the whole store, none per row.\n","responses":{"200":{"description":"Members per catalog","content":{"application/json":{"example":{"catalogs":[{"id":"ckhome","ids":["ckp1","ckp2"],"linked":{},"apps":[]},{"id":"ckshow","ids":["ckp2"],"linked":{"ckp2":{"price":14500,"comparePrice":null,"priceMode":"fixed","currency":"ARS","stockOverride":56}},"apps":[{"name":"Point of sale","stock":true,"price":true}]}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/sellers":{"get":{"tags":["Sellers"],"summary":"List the store's sellers","description":"Each seller carries their sales (orders credited to them, `Order.sellerId`): `month` = { orders, amount } this UTC\nmonth and `lastOrderAt`, counting the same orders as the home's \"Monto en pedidos\" (every status but CANCELLED).\n`currency` = the store's currency (amounts are plain sums of order totals, like the home).\n`links` = { total, active }: the price links the seller sent that still exist (passes never count; expired links\nare deleted 7 days after expiring, so `total` is what the links list shows, not a lifetime count).\n`ranking` = this month's podium, the same rows as the home's \"Vendedores del mes\" (GET /tenant/stats\n`sellersMonth`): every seller with counted orders this month — app sellers by id, name-only sellers (a panel\nuser, a removed seller) with `id` null — sorted by amount.\n`app` = where to install the sellers app: `url` = the store's install page `{catalogUrl}/apps` (its custom domain\nwhen it has one); `ios` / `android` = optional direct store links (env), null when unset.\n","responses":{"200":{"content":{"application/json":{"example":{"sellers":[{"id":"cls1","name":"Laura","active":true,"devices":1,"lastUsedAt":"2026-11-22T21:00:00.000Z","codePending":false,"codeExpiresAt":null,"permanentCode":false,"createdAt":"2026-11-20T12:00:00.000Z","month":{"orders":4,"amount":182000},"lastOrderAt":"2026-11-25T18:10:00.000Z","links":{"total":12,"active":3}}],"ranking":[{"id":"cls1","name":"Laura","orders":4,"amount":182000,"lastOrderAt":"2026-11-25T18:10:00.000Z"},{"id":null,"name":"Marta","orders":1,"amount":30000,"lastOrderAt":"2026-11-24T10:00:00.000Z"}],"currency":"ARS","app":{"url":"https://sellalog.com/northwind/apps","ios":null,"android":null}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Sellers"],"summary":"Add a seller and get their one-time pairing code","description":"The code (8 characters, valid 7 days, single use) is shown ONLY in this response. The seller types it in the app.","requestBody":{"content":{"application/json":{"example":{"name":"Laura"}}}},"responses":{"201":{"content":{"application/json":{"example":{"seller":{"id":"cls1","name":"Laura","active":true,"devices":0,"codePending":true},"code":"K7P2-QX9M","expiresAt":"2026-11-30T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/sellers/{id}":{"delete":{"tags":["Sellers"],"summary":"Remove a seller","description":"Signs out every phone of the seller. The links they sent keep working and keep their name in the history.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"SELLER_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"patch":{"tags":["Sellers"],"summary":"Rename, pause/resume a seller, choose their catalogs, commission % or admin pushes","description":"`commissionPct` (0–100, null = no commission): earned on each order credited to them when it is DELIVERED, on\nthe total without shipping, frozen on the order that day (changing it never rewrites delivered orders).\n`isAdmin` + `adminEvents` (opens | orders | access | clients): an admin seller gets those pushes for the WHOLE\nstore and can answer any access request from the app; everyone gets the pushes of their own links and orders.\n`catalogIds`: the catalogs the seller can share in the app — null or [] = \"Todos\" (every active catalog, the\ndefault); else ids of this store's catalogs (400 SELLER_CATALOGS otherwise). Enforced in the sellers-app API: the\napp only receives those catalogs, and a link (or scan) in another one → 403 SELLER_CATALOG_FORBIDDEN. A catalog\nthat goes to the trash or is deactivated drops out by itself (and comes back when restored); a list with none left\nmeans no catalogs, never \"Todos\".\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"active":true,"catalogIds":["cat1","cat2"],"commissionPct":5,"isAdmin":true,"adminEvents":["orders","access"]}}}},"responses":{"200":{"description":"The seller","content":{"application/json":{"example":{"id":"cls1","name":"Laura","active":true,"devices":1,"lastUsedAt":"2026-11-27T12:00:00.000Z","codePending":false,"codeExpiresAt":null,"permanentCode":false,"catalogIds":["clcat01"],"commissionPct":5,"isAdmin":false,"adminEvents":[],"pushDevices":1,"createdAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"SELLER_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/sellers/{id}/commissions":{"get":{"tags":["Sellers"],"summary":"A seller's commissions of a month — earned / paid / pending + the per-order list","description":"Orders credited to the seller that were DELIVERED in that UTC month (`month` YYYY-MM, default this month), with\nthe commission frozen that day (base = total without shipping). Cancelled orders never count. Toggle each one with\n`PUT /orders/{id}/commission-paid`.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"month","schema":{"type":"string","example":"2026-11"}}],"responses":{"200":{"content":{"application/json":{"example":{"month":"2026-11","prevMonth":"2026-10","nextMonth":null,"pct":5,"totals":[{"currency":"ARS","earned":9100,"paid":3500,"pending":5600,"orders":3}],"orders":[]}}}},"400":{"description":"VALIDATION"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"SELLER_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/sizes":{"get":{"tags":["Sizes"],"summary":"List sizes","description":"Sorted by `order`, with product counts.","responses":{"200":{"description":"Sizes","content":{"application/json":{"example":[{"id":"clsz1","tenantId":"clten1","name":"M","order":2,"active":true,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Sizes"],"summary":"Create a size","description":"Without `order`, it is derived from the canonical order (XS/S/M/L/XL/2XL…).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":20},"order":{"type":"integer"},"active":{"type":"boolean"}}},"example":{"name":"M"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"example":{"id":"clsz1","tenantId":"clten1","name":"M","order":2,"active":true,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/sizes/reorder":{"patch":{"tags":["Sizes"],"summary":"Reorder sizes","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","order"],"properties":{"id":{"type":"string"},"order":{"type":"integer"}}}},"example":{"ids":["clsz0","clsz1","clsz2"]}}}},"responses":{"200":{"description":"Orden actualizado","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/sizes/{id}":{"put":{"tags":["Sizes"],"summary":"Update a size","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"order":{"type":"integer"},"active":{"type":"boolean"}}},"example":{"name":"Medium"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"example":{"id":"clsz1","tenantId":"clten1","name":"Medium","order":2,"active":true,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Sizes"],"summary":"Delete a size","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tags":{"get":{"tags":["Tags"],"summary":"List tags","description":"Tags with product counts, featured first, then by order.","responses":{"200":{"description":"Tags","content":{"application/json":{"example":[{"id":"cltag1","tenantId":"clten1","name":"Shirts","featured":true,"order":1,"active":true,"group":null,"carousel":false,"kind":"garment","badge":null,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}]}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"post":{"tags":["Tags"],"summary":"Create a tag","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":60},"featured":{"type":"boolean"},"order":{"type":"integer"},"active":{"type":"boolean"},"group":{"type":"string","nullable":true,"maxLength":40,"description":"Catalog heading for regular tags (Tipo, Material…); null or empty = no group"},"carousel":{"type":"boolean","description":"Regular tag shown as a product carousel above the catalog grid"}}},"example":{"name":"Shirts","featured":true}}}},"responses":{"201":{"description":"Tag creado","content":{"application/json":{"example":{"id":"cltag1","tenantId":"clten1","name":"Shirts","featured":true,"order":1,"active":true,"group":null,"carousel":false,"kind":"garment","badge":null,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"apiKey":[]}]}},"/tags/{id}":{"put":{"tags":["Tags"],"summary":"Update a tag","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"featured":{"type":"boolean"},"order":{"type":"integer"},"active":{"type":"boolean"},"group":{"type":"string","nullable":true,"maxLength":40},"carousel":{"type":"boolean"}}},"example":{"name":"Shirts","featured":false}}}},"responses":{"200":{"description":"Tag actualizado","content":{"application/json":{"example":{"id":"cltag1","tenantId":"clten1","name":"Shirts","featured":false,"order":1,"active":true,"group":null,"carousel":false,"kind":"garment","badge":null,"createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Tags"],"summary":"Delete a tag","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tag eliminado","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tags/reorder":{"patch":{"tags":["Tags"],"summary":"Reorder tags","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","order"],"properties":{"id":{"type":"string"},"order":{"type":"integer"}}}},"example":{"ids":["cltag2","cltag1"]}}}},"responses":{"200":{"description":"Orden actualizado","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tenant/me":{"get":{"tags":["Tenant"],"summary":"Current tenant (with currency, locale, country, timezone, features and catalogUrl)","responses":{"200":{"description":"Tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tenant/settings":{"put":{"tags":["Tenant"],"summary":"Patch catalog customization (merged over the stored settings)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"primaryColor":{"type":"string","example":"#ff8a3d"},"accentGradFrom":{"type":"string"},"accentGradTo":{"type":"string"},"logoUrl":{"type":"string"},"font":{"type":"string"},"businessName":{"type":"string"},"whatsapp":{"type":"string"},"headerTag":{"type":"string"},"season":{"type":"string"},"darkMode":{"type":"boolean"},"transferDiscount":{"type":"number","minimum":0,"maximum":100},"bgColor":{"type":"string","example":"#0a0a0f"},"refCurrency":{"type":"object","nullable":true,"description":"Reference / charge currency (lib/refCurrency.js, lib/salePricing.js). The whole object replaces the stored one,\nexcept `autoRate`: absent = keep the stored choice. `autoRate` (charge mode only) = the stored rate follows a\nfetched source (ar_blue | ar_oficial | ar_mep | market — the ones covering base → code), refreshed every\n15 min by services/autoRate.service.js (> 20 % jumps held). With it on, the typed `rate` is ignored (only a\nfallback while the source has no rate); the response carries the source's `rate`, `rateAt`, `rateSource`.\n400 REF_SOURCE_UNSUPPORTED when the source doesn't cover the pair.\n","example":{"enabled":true,"code":"ARS","source":"fixed","rate":1600,"mode":"charge","round":500,"autoRate":"ar_blue"}},"costSource":{"type":"string","enum":["feed","connectedApp"],"description":"Cost of the products a connected app sends: from the supplier feed (default) or from the app's push. Private; ignored from API keys."},"template":{"type":"string","enum":["classic","editorial"],"nullable":true,"deprecated":true,"description":"Retired 2026-11-26: the buyer catalog has one design (Editorial). Accepted from old clients and ignored — never saved, never served."}}},"example":{"showPrices":false,"minOrderEnabled":true,"minOrderAmount":3000}}}},"responses":{"200":{"description":"Updated settings","content":{"application/json":{"example":{"showPrices":false,"minOrderEnabled":true,"minOrderAmount":3000,"hideStock":false}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tenant/swipe-stats":{"get":{"tags":["Tenant"],"summary":"Choose-mode decisions aggregated per product (most rejected first)","description":"`hearts` = favorites turned on with the heart in the grid / product sheet (buyers only); `favorites` = yes + hearts\n(the buyer's one favorites list). `seen` and `rejectRate` count swipes only.\n","parameters":[{"in":"query","name":"days","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}}],"responses":{"200":{"description":"{ days, rows: [{ product, yes, no, later, hearts, favorites, seen, rejectRate }] }","content":{"application/json":{"example":{"days":30,"rows":[{"product":{"id":"clprd01","name":"White Oxford Shirt","images":[],"sku":"SHIRT-001"},"yes":12,"no":30,"later":4,"hearts":2,"favorites":14,"seen":46,"rejectRate":0.65}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tenant/profile":{"put":{"tags":["Tenant"],"summary":"Update business name and regional settings","description":"Any subset of the fields. The slug is not changed here (it would break shared links).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"currency":{"type":"string","example":"MXN"},"locale":{"type":"string","enum":["en","es"]},"country":{"type":"string","example":"MX"},"timezone":{"type":"string","example":"America/Mexico_City"}}},"example":{"name":"Northwind Apparel","tagline":"Wholesale basics"}}}},"responses":{"200":{"description":"{ id, name, slug, currency, locale, country, timezone }","content":{"application/json":{"example":{"id":"clten1","slug":"northwind","name":"Northwind Apparel","currency":"MXN","locale":"es","settings":{"tagline":"Wholesale basics"}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/tenant/stats":{"get":{"tags":["Tenant"],"summary":"Dashboard stats (orders, views, revenue, leads, visitors, top products…)","responses":{"200":{"description":"Stats","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"integer"},"catalogs":{"type":"integer"},"orders":{"type":"integer"},"orderSeries":{"type":"array","items":{"type":"integer"},"description":"14 UTC days, index 13 = today"},"viewSeries":{"type":"array","items":{"type":"integer"}},"revenueSeries":{"type":"array","items":{"type":"number"}},"leadSeries":{"type":"array","items":{"type":"integer"},"description":"New leads per UTC day (14 days)"},"seriesStart":{"type":"string","example":"2026-09-24","description":"UTC date of index 0"},"leads":{"type":"integer"},"leadsNew30d":{"type":"integer"},"leadsMonth":{"type":"integer","description":"New clients this month (KPI \"Clientes nuevos\"): buyers who left contact details, team and blocked out"},"leadsPrevMonth":{"type":"integer"},"ordersNew":{"type":"integer","description":"Orders nobody on the team has opened yet (Order.viewedAt null) — home \"N pedidos nuevos\" and the sidebar badge"},"clientsNew":{"type":"integer","description":"New clients since THIS user last opened Visitantes → Clientes (User.seen.leadsAt; never opened = last 30 days)"},"clientsNewSince":{"type":"string","format":"date-time"},"pendingRequests":{"type":"integer"},"visitors30d":{"type":"integer"},"liveNow":{"type":"integer"},"sellersMonth":{"type":"array","description":"Home \"Vendedores del mes\": sellers ranked by order value this UTC month — the same orders as revenueMonth (every status but CANCELLED). Empty = no order this month has a seller.","items":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"null = a name only (dashboard user link, removed seller, API caller)"},"name":{"type":"string"},"orders":{"type":"integer"},"amount":{"type":"number"},"lastOrderAt":{"type":"string","format":"date-time"}}}}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/upload":{"post":{"tags":["Upload"],"summary":"Upload images (max 20 per request, 10 MB each)","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"}}}}}}},"responses":{"200":{"description":"Cloudinary URLs","content":{"application/json":{"schema":{"type":"object","properties":{"urls":{"type":"array","items":{"type":"string"}}}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/visitors":{"get":{"tags":["Visitors"],"summary":"List visitors","description":"Buyers only: the store's team never appears (see the tag). `clients` = identified visitors (name, email or\nphone) who are not blocked, most active first (temperature hot → warm → cold, then the latest visit); every other filter is newest\nactivity first. `counts` use the same rule, so `requests` matches the panel's badge.\n","parameters":[{"in":"query","name":"filter","schema":{"type":"string","enum":["all","clients","leads","requests","approved","blocked","live"],"default":"all"}},{"in":"query","name":"q","schema":{"type":"string"},"description":"Search name/email/phone/company/city"},{"in":"query","name":"page","schema":{"type":"integer","default":1}},{"in":"query","name":"limit","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"content":{"application/json":{"example":{"visitors":[{"id":"ckx","name":"Lupita Hernández","email":"lupita@example.com","company":"Boutique Lupita","isLead":true,"accessStatus":"APPROVED","temperature":"hot","viewingNow":false,"visits":4,"productViews":23,"timeSpentSec":940,"percentViewed":30,"distinctProductsViewed":24,"reactions":{"yes":5,"no":2,"later":1,"hearts":1},"lastProduct":{"id":"ckp","name":"Vestido Midi Floral Amalfi","image":"https://..."},"lastSeenAt":"2027-03-01T18:00:00Z"}],"total":25,"page":1,"limit":50,"counts":{"all":25,"clients":14,"leads":14,"requests":4,"blocked":1,"live":1,"anonymousMonth":447}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/visitors/live":{"get":{"tags":["Visitors"],"summary":"Visitors active in the last 2 minutes, with the product they're on (poll every ~15s)","responses":{"200":{"content":{"application/json":{"example":{"visitors":[{"id":"ckx","name":null,"city":"Guadalajara","viewingNow":true,"temperature":"warm","lastProduct":{"id":"ckp","name":"Jeans Clásico Corte Recto","image":"https://..."}}],"count":1}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (visitorAnalytics)"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/visitors/export.csv":{"get":{"tags":["Visitors"],"summary":"CSV export (UTF-8 with BOM, opens in Excel). Same filter/q as the list (buyers only, newest first).","parameters":[{"in":"query","name":"filter","schema":{"type":"string","enum":["all","clients","leads","requests","approved","blocked"],"default":"leads"}},{"in":"query","name":"q","schema":{"type":"string"}}],"responses":{"200":{"description":"text/csv","content":{"text/csv":{"schema":{"type":"string"},"example":"﻿name,email,phone,company,city,…\r\nAna Gómez,ana@example.com,+5215555550000,Tienda Norte,Monterrey,…\r\n"}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/visitors/{id}":{"get":{"tags":["Visitors"],"summary":"Visitor detail — product timeline with reactions, percentViewed, notSeen top-10, orders","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"id":"ckx","name":"Lupita Hernández","temperature":"hot","percentViewed":30,"views":[{"product":{"id":"ckp","name":"Vestido Midi Floral Amalfi","image":"https://...","sku":"NW-VES-101","price":689},"views":3,"yes":1,"no":0,"later":0,"hearts":1,"lastAt":"2027-03-01T18:00:00Z"}],"notSeen":[{"id":"ckq","name":"Abrigo Camel Lisboa","image":"https://...","sku":"NW-HOM-202","price":2190}],"orderList":[{"id":"cko","number":1003,"total":15400,"currency":"MXN","status":"RECEIVED","createdAt":"2027-03-01T18:00:00Z"}],"analyticsLocked":false,"interests":[{"id":"ckint","status":"new","createdAt":"2027-03-01T18:05:00Z","contactedAt":null,"note":"Las quiero en negro","contact":{"name":"Lupita Hernández","phone":"+525512345678","email":null,"company":null,"phoneVerified":false},"items":[{"productId":"ckp","name":"Vestido Midi Floral Amalfi","code":"NW-VES-101","image":null}],"visitorId":"ckx","priceLinkId":null,"catalog":{"id":"ckc","name":"Mayoreo"},"seller":null}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"VISITOR_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"put":{"tags":["Visitors"],"summary":"Approve / reject / block, add a note, or grant timed access","description":"`accessDays` grants APPROVED access for N days (accessExpiresAt = now + N days); `null`\nremoves the expiry. REJECTED acts as a block list (the visitor can't browse any catalog).\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"example":{"accessStatus":"APPROVED","accessDays":30,"note":"Pays by wire transfer"}}}},"responses":{"200":{"description":"Updated visitor","content":{"application/json":{"example":{"id":"clv1","name":"Ana Gómez","email":"ana@example.com","phone":"+5215555550000","company":"Tienda Norte","city":"Monterrey","isLead":true,"accessStatus":"APPROVED","storedAccessStatus":"APPROVED","isTeam":false,"temperature":"hot","viewingNow":false,"lastProduct":null,"reactions":{"yes":12,"no":3,"later":2,"hearts":4},"distinctProductsViewed":40,"percentViewed":35,"orders":1,"phoneVerified":false,"firstSeenAt":"2026-11-27T12:00:00.000Z","lastSeenAt":"2026-11-27T12:00:00.000Z","note":"Wants the spring line"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Visitors"],"summary":"Delete a visitor and their product views","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ ok: true }","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"The store's webhook (null when none) and the events it can subscribe to","responses":{"200":{"content":{"application/json":{"example":{"webhook":{"id":"clw1","url":"https://hooks.example.com/sellalog/webhook","events":["price_link.opened","price_link.cart_updated","price_link.expired_unopened","order.created","order.paid"],"scope":"price_links","active":true,"secretHint":"…x9Qa","createdAt":"2026-10-22T15:00:00.000Z","updatedAt":"2026-10-22T15:00:00.000Z"},"events":["price_link.opened","price_link.cart_updated","price_link.expired_unopened","order.created","order.paid"],"scopes":["price_links","all"]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"put":{"tags":["Webhooks"],"summary":"Create or update the store's webhook","description":"Create: `url` required; `events` defaults to all, `scope` to `price_links` (order.* only for orders placed\nthrough a price link; `all` = every order), `active` to true. The signing **secret is returned ONCE** on\ncreate (`secret`) — store it; later it is only shown again by rotating it. Update: send only what changes.\n`url` must be https and resolve to a public address (no private/loopback/link-local IPs).\n","requestBody":{"required":true,"content":{"application/json":{"example":{"url":"https://hooks.example.com/sellalog/webhook","events":["price_link.opened","price_link.cart_updated","price_link.expired_unopened","order.created","order.paid"],"scope":"price_links","active":true}}}},"responses":{"200":{"description":"Updated: { webhook }","content":{"application/json":{"example":{"webhook":{"id":"clwh1","url":"https://example.com/hooks/sellalog","events":["order.created","price_link.opened"],"scope":"store","active":true,"secretHint":"…9f3a","createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"}}}}},"201":{"description":"Created: { webhook, secret } (secret shown only now)","content":{"application/json":{"example":{"webhook":{"id":"clwh1","url":"https://example.com/hooks/sellalog","events":["order.created","price_link.opened"],"scope":"store","active":true,"secretHint":"…9f3a","createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"},"secret":"whsec_shown_once…"}}}},"400":{"description":"WEBHOOK_URL_INVALID | WEBHOOK_URL_INSECURE | WEBHOOK_URL_PRIVATE | VALIDATION"},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (apiKeys) | FORBIDDEN"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]},"delete":{"tags":["Webhooks"],"summary":"Remove the store's webhook (pending deliveries are dropped)","responses":{"200":{"description":"{ ok: true }","content":{"application/json":{"example":{"ok":true}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"WEBHOOK_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/webhooks/rotate-secret":{"post":{"tags":["Webhooks"],"summary":"Generate a new signing secret (returned ONCE; the old one stops working immediately)","responses":{"200":{"description":"{ webhook, secret }","content":{"application/json":{"example":{"webhook":{"id":"clwh1","url":"https://example.com/hooks/sellalog","events":["order.created","price_link.opened"],"scope":"store","active":true,"secretHint":"…9f3a","createdAt":"2026-11-27T12:00:00.000Z","updatedAt":"2026-11-27T12:00:00.000Z"},"secret":"whsec_shown_once…"}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"WEBHOOK_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/webhooks/test":{"post":{"tags":["Webhooks"],"summary":"Send a signed `ping` event now and return the result of that attempt","description":"Sent even while the webhook is paused. A failed ping is retried like any event.","responses":{"200":{"content":{"application/json":{"example":{"delivery":{"id":"0b7c…","eventId":"5f1e…","type":"ping","status":"delivered","attempts":1,"lastStatus":200,"lastError":null,"nextAttemptAt":null,"deliveredAt":"2026-10-22T15:01:00.000Z","createdAt":"2026-10-22T15:01:00.000Z"}}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"404":{"description":"WEBHOOK_NOT_FOUND"},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}},"/webhooks/deliveries":{"get":{"tags":["Webhooks"],"summary":"Last 100 deliveries, newest first","description":"status: pending (waiting for an attempt / retry at nextAttemptAt) | sending | delivered | failed (gave up after ~24 h)","responses":{"200":{"description":"{ deliveries: [{ id, eventId, type, status, attempts, lastStatus, lastError, nextAttemptAt, deliveredAt, createdAt }] }","content":{"application/json":{"example":{"deliveries":[{"id":"cldl1","eventId":"evt_01","type":"order.created","status":"delivered","attempts":1,"lastStatus":200,"lastError":null,"nextAttemptAt":null,"deliveredAt":"2026-11-27T12:00:00.000Z","createdAt":"2026-11-27T12:00:00.000Z"}]}}}},"401":{"description":"AUTH_REQUIRED | API_KEY_INVALID (missing, wrong or revoked key)","content":{"application/json":{"example":{"error":"Invalid or revoked API key","code":"API_KEY_INVALID"}}}},"403":{"description":"PLAN_FEATURE_REQUIRED (the plan lost API access) | FORBIDDEN | PLAN_LIMIT_*","content":{"application/json":{"example":{"error":"This feature needs a higher plan","code":"PLAN_FEATURE_REQUIRED","feature":"apiKeys"}}}},"429":{"description":"RATE_LIMITED — wait `Retry-After` seconds","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the window resets"},"RateLimit":{"schema":{"type":"string"},"description":"draft-7: limit=1200, remaining=0, reset=42"}},"content":{"application/json":{"example":{"error":"Too many requests for this API key. Wait the Retry-After seconds and try again.","code":"RATE_LIMITED"}}}}},"x-public":true,"security":[{"apiKey":[]}]}}}}