{"openapi":"3.0.3","info":{"title":"Vendre API","version":"1.0.0","description":"Create and manage a Vendre store's products, customers and orders from your own app or website. Authenticate with an API key from Settings → API keys, sent as `Authorization: Bearer vnd_live_…`. Amounts are in Indian rupees."},"servers":[{"url":"https://vendre.in/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Store","description":"The store an API key belongs to"},{"name":"Products","description":"Products, their options and variants"},{"name":"Customers","description":"Customers and their addresses"},{"name":"Orders","description":"Orders, their status and invoices"}],"paths":{"/store":{"get":{"operationId":"getStore","tags":["Store"],"summary":"Check your key","description":"Returns the store your API key belongs to and the permissions it has. Any valid key can call it, so it's the quickest way to confirm your setup.\n\nAny valid key.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"jf9vmOVtx2cS5azPgxT8oBkiukbocEal","name":"Armani","slug":"mh9rwd8v9a","scopes":["products:write","orders:read"]}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"operationId":"listProducts","tags":["Products"],"summary":"List products","description":"The store's products, most recently changed first. Each item is a summary; fetch a product for its variants.\n\nNeeds the `products:read` permission.","x-scope":"products:read","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1 (default 1)","schema":{"type":"integer"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–50 (default 20)","schema":{"type":"integer"}},{"name":"search","in":"query","required":false,"description":"Text to search for","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"draft, active or archived","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"title, createdAt or updatedAt; prefix with - for descending (default -updatedAt)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"id":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","status":"active","category":null,"productType":"T-shirt","imageUrl":null,"variantCount":2,"minPrice":599,"maxPrice":649,"trackQuantity":true,"stock":8,"lowStock":false,"createdAt":"2026-11-19T10:24:00.000Z","updatedAt":"2026-11-19T10:24:00.000Z"}],"pagination":{"page":1,"pageSize":20,"total":1,"pageCount":1}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createProduct","tags":["Products"],"summary":"Create a product","description":"Creates a product. For sizes or colours, send options: a variant is created for every combination, and variants sets the price, stock and SKU of specific ones. A product without options gets a single variant from price, quantity and sku. Opening stock is recorded in the stock history.\n\nNeeds the `products:write` permission.","x-scope":"products:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":150,"description":"Product name","example":"Linen Shirt"},"description":{"type":"string","minLength":1,"maxLength":30000,"description":"HTML (p, h2-h4, strong, em, u, s, ul, ol, li, blockquote, code, pre, a) or plain text, which becomes paragraphs. Other tags are removed. Up to 5000 characters of text","example":"<p>Breathable <strong>pure linen</strong>, relaxed fit.</p><ul><li>Machine wash cold</li></ul>"},"status":{"type":"string","enum":["draft","active","archived"],"description":"draft is hidden from shoppers; new products default to draft","example":"active"},"handle":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"URL part, unique in the store; made from the title when left out","example":"linen-shirt"},"price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price in rupees. Required unless every variant has a price","example":1499},"compareAtPrice":{"nullable":true,"description":"Original price, shown crossed out; must be above price","example":1999,"type":"number","minimum":0,"maximum":10000000},"costPerItem":{"nullable":true,"description":"What it costs you; never shown to customers","type":"number","minimum":0,"maximum":10000000},"chargeTax":{"type":"boolean","description":"Charge tax on this product (default true)"},"sku":{"nullable":true,"description":"SKU for a product without variants","type":"string","maxLength":64},"barcode":{"nullable":true,"description":"ISBN, UPC or GTIN for a product without variants","type":"string","maxLength":32},"trackQuantity":{"type":"boolean","description":"Count stock down as orders come in (default true)"},"quantity":{"type":"integer","minimum":0,"maximum":9999999,"description":"Units in stock, for a product without variants","example":25},"lowStockAt":{"nullable":true,"description":"Show as low stock at or below this number","type":"integer","minimum":0,"maximum":9999999},"continueSelling":{"type":"boolean","description":"Keep selling when stock reaches 0 (default false)"},"options":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"description":"Option name","example":"Size"},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"description":"Its values, up to 20","example":["S","M","L"]}},"required":["name","values"],"additionalProperties":false},"description":"Up to 3 options, like Size and Color. A variant is created for every combination"},"variants":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"options":{"minItems":1,"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"description":"Which variant: one value per option, in option order","example":["M","Black"]},"price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price in rupees; defaults to the product's price","example":649},"quantity":{"type":"integer","minimum":0,"maximum":9999999,"description":"Units in stock","example":12},"sku":{"nullable":true,"description":"Stock-keeping code, unique in the store","example":"TEE-M-BLK","type":"string","maxLength":64}},"required":["options"],"additionalProperties":false},"description":"Price, stock and SKU for specific combinations; others keep or default their values"},"categoryId":{"nullable":true,"description":"Id of one of the store's categories","type":"string","maxLength":64},"productType":{"nullable":true,"description":"Free-text type, like Shirt","type":"string","maxLength":60},"vendor":{"nullable":true,"description":"Brand or maker","type":"string","maxLength":60},"tags":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Up to 30 tags","example":["linen","summer"]},"physical":{"type":"boolean","description":"Needs shipping (default true)"},"weight":{"nullable":true,"description":"Shipping weight, in weightUnit","type":"number","minimum":0,"maximum":999999},"weightUnit":{"type":"string","enum":["kg","g","lb","oz"],"description":"kg (default), g, lb or oz"},"length":{"nullable":true,"description":"Package length in cm","example":30,"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":9999.99},"breadth":{"nullable":true,"description":"Package breadth in cm","example":25,"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":9999.99},"height":{"nullable":true,"description":"Package height in cm","example":4,"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":9999.99},"originCountry":{"nullable":true,"description":"Country of origin","type":"string","maxLength":56},"hsCode":{"nullable":true,"description":"HS code for customs, 6 to 10 digits","type":"string","maxLength":12},"seoTitle":{"nullable":true,"description":"Search engine title","type":"string","maxLength":70},"seoDescription":{"nullable":true,"description":"Search engine description","type":"string","maxLength":160}},"required":["title","description"],"additionalProperties":false},"example":{"title":"Cotton Tee","status":"active","price":599,"options":[{"name":"Size","values":["S","M"]},{"name":"Color","values":["Black"]}],"variants":[{"options":["S","Black"],"quantity":5,"sku":"TEE-S-BLK"},{"options":["M","Black"],"price":649,"quantity":3,"sku":"TEE-M-BLK"}],"tags":["cotton","basics"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"example":{"data":{"id":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","handle":"cotton-tee","status":"active","description":"Soft combed cotton, regular fit.","categoryId":null,"productType":"T-shirt","vendor":"Armani","tags":["cotton","basics"],"chargeTax":true,"trackQuantity":true,"continueSelling":false,"lowStockAt":5,"physical":true,"weight":0.2,"weightUnit":"kg","length":30,"breadth":25,"height":4,"originCountry":"India","hsCode":null,"seoTitle":null,"seoDescription":null,"options":[{"name":"Size","values":["S","M"]},{"name":"Color","values":["Black"]}],"variants":[{"id":"cmwnoy41f000tjwxu1k2v9a7b","title":"S / Black","options":["S","Black"],"price":599,"compareAtPrice":null,"costPerItem":null,"sku":"TEE-S-BLK","barcode":null,"quantity":5,"images":[]},{"id":"cmwnoy41f000ujwxu8h3c2d4e","title":"M / Black","options":["M","Black"],"price":649,"compareAtPrice":null,"costPerItem":null,"sku":"TEE-M-BLK","barcode":null,"quantity":3,"images":[]}],"images":[],"currency":"INR","createdAt":"2026-11-19T10:24:00.000Z","updatedAt":"2026-11-19T10:24:00.000Z"}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is missing or invalid, the handle or a SKU is taken, or a variant isn't a combination of the options","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/{id}":{"get":{"operationId":"getProduct","tags":["Products"],"summary":"Get a product","description":"One product with its options, variants and images.\n\nNeeds the `products:read` permission.","x-scope":"products:read","parameters":[{"name":"id","in":"path","required":true,"description":"The product's id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","handle":"cotton-tee","status":"active","description":"Soft combed cotton, regular fit.","categoryId":null,"productType":"T-shirt","vendor":"Armani","tags":["cotton","basics"],"chargeTax":true,"trackQuantity":true,"continueSelling":false,"lowStockAt":5,"physical":true,"weight":0.2,"weightUnit":"kg","length":30,"breadth":25,"height":4,"originCountry":"India","hsCode":null,"seoTitle":null,"seoDescription":null,"options":[{"name":"Size","values":["S","M"]},{"name":"Color","values":["Black"]}],"variants":[{"id":"cmwnoy41f000tjwxu1k2v9a7b","title":"S / Black","options":["S","Black"],"price":599,"compareAtPrice":null,"costPerItem":null,"sku":"TEE-S-BLK","barcode":null,"quantity":5,"images":[]},{"id":"cmwnoy41f000ujwxu8h3c2d4e","title":"M / Black","options":["M","Black"],"price":649,"compareAtPrice":null,"costPerItem":null,"sku":"TEE-M-BLK","barcode":null,"quantity":3,"images":[]}],"images":[],"currency":"INR","createdAt":"2026-11-19T10:24:00.000Z","updatedAt":"2026-11-19T10:24:00.000Z"}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No product with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateProduct","tags":["Products"],"summary":"Update a product","description":"Changes only the fields you send. Send variants to change the price, stock or SKU of specific combinations; send options to reshape them (variants for removed combinations are deleted). Stock changes are recorded in the stock history.\n\nNeeds the `products:write` permission.","x-scope":"products:write","parameters":[{"name":"id","in":"path","required":true,"description":"The product's id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":150,"description":"Product name","example":"Linen Shirt"},"description":{"type":"string","minLength":1,"maxLength":30000,"description":"HTML (p, h2-h4, strong, em, u, s, ul, ol, li, blockquote, code, pre, a) or plain text, which becomes paragraphs. Other tags are removed. Up to 5000 characters of text","example":"<p>Breathable <strong>pure linen</strong>, relaxed fit.</p><ul><li>Machine wash cold</li></ul>"},"status":{"type":"string","enum":["draft","active","archived"],"description":"draft is hidden from shoppers; new products default to draft","example":"active"},"handle":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"URL part, unique in the store; made from the title when left out","example":"linen-shirt"},"price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price in rupees. Required unless every variant has a price","example":1499},"compareAtPrice":{"nullable":true,"description":"Original price, shown crossed out; must be above price","example":1999,"type":"number","minimum":0,"maximum":10000000},"costPerItem":{"nullable":true,"description":"What it costs you; never shown to customers","type":"number","minimum":0,"maximum":10000000},"chargeTax":{"type":"boolean","description":"Charge tax on this product (default true)"},"sku":{"nullable":true,"description":"SKU for a product without variants","type":"string","maxLength":64},"barcode":{"nullable":true,"description":"ISBN, UPC or GTIN for a product without variants","type":"string","maxLength":32},"trackQuantity":{"type":"boolean","description":"Count stock down as orders come in (default true)"},"quantity":{"type":"integer","minimum":0,"maximum":9999999,"description":"Units in stock, for a product without variants","example":25},"lowStockAt":{"nullable":true,"description":"Show as low stock at or below this number","type":"integer","minimum":0,"maximum":9999999},"continueSelling":{"type":"boolean","description":"Keep selling when stock reaches 0 (default false)"},"options":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"description":"Option name","example":"Size"},"values":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"description":"Its values, up to 20","example":["S","M","L"]}},"required":["name","values"],"additionalProperties":false},"description":"Up to 3 options, like Size and Color. A variant is created for every combination"},"variants":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"options":{"minItems":1,"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"description":"Which variant: one value per option, in option order","example":["M","Black"]},"price":{"type":"number","minimum":0,"maximum":10000000,"description":"Price in rupees; defaults to the product's price","example":649},"quantity":{"type":"integer","minimum":0,"maximum":9999999,"description":"Units in stock","example":12},"sku":{"nullable":true,"description":"Stock-keeping code, unique in the store","example":"TEE-M-BLK","type":"string","maxLength":64}},"required":["options"],"additionalProperties":false},"description":"Price, stock and SKU for specific combinations; others keep or default their values"},"categoryId":{"nullable":true,"description":"Id of one of the store's categories","type":"string","maxLength":64},"productType":{"nullable":true,"description":"Free-text type, like Shirt","type":"string","maxLength":60},"vendor":{"nullable":true,"description":"Brand or maker","type":"string","maxLength":60},"tags":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Up to 30 tags","example":["linen","summer"]},"physical":{"type":"boolean","description":"Needs shipping (default true)"},"weight":{"nullable":true,"description":"Shipping weight, in weightUnit","type":"number","minimum":0,"maximum":999999},"weightUnit":{"type":"string","enum":["kg","g","lb","oz"],"description":"kg (default), g, lb or oz"},"length":{"nullable":true,"description":"Package length in cm","example":30,"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":9999.99},"breadth":{"nullable":true,"description":"Package breadth in cm","example":25,"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":9999.99},"height":{"nullable":true,"description":"Package height in cm","example":4,"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":9999.99},"originCountry":{"nullable":true,"description":"Country of origin","type":"string","maxLength":56},"hsCode":{"nullable":true,"description":"HS code for customs, 6 to 10 digits","type":"string","maxLength":12},"seoTitle":{"nullable":true,"description":"Search engine title","type":"string","maxLength":70},"seoDescription":{"nullable":true,"description":"Search engine description","type":"string","maxLength":160}},"additionalProperties":false},"example":{"status":"active","variants":[{"options":["M","Black"],"quantity":30}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","handle":"cotton-tee","status":"active","description":"Soft combed cotton, regular fit.","categoryId":null,"productType":"T-shirt","vendor":"Armani","tags":["cotton","basics"],"chargeTax":true,"trackQuantity":true,"continueSelling":false,"lowStockAt":5,"physical":true,"weight":0.2,"weightUnit":"kg","length":30,"breadth":25,"height":4,"originCountry":"India","hsCode":null,"seoTitle":null,"seoDescription":null,"options":[{"name":"Size","values":["S","M"]},{"name":"Color","values":["Black"]}],"variants":[{"id":"cmwnoy41f000tjwxu1k2v9a7b","title":"S / Black","options":["S","Black"],"price":599,"compareAtPrice":null,"costPerItem":null,"sku":"TEE-S-BLK","barcode":null,"quantity":5,"images":[]},{"id":"cmwnoy41f000ujwxu8h3c2d4e","title":"M / Black","options":["M","Black"],"price":649,"compareAtPrice":null,"costPerItem":null,"sku":"TEE-M-BLK","barcode":null,"quantity":3,"images":[]}],"images":[],"currency":"INR","createdAt":"2026-11-19T10:24:00.000Z","updatedAt":"2026-11-19T10:24:00.000Z"}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No product with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteProduct","tags":["Products"],"summary":"Delete a product","description":"Deletes the product with its variants and photos. Past orders and stock history keep their copies of the product's name. To hide a product instead, set its status to archived.\n\nNeeds the `products:write` permission.","x-scope":"products:write","parameters":[{"name":"id","in":"path","required":true,"description":"The product's id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnoy41e000sjwxu4adhd9ot","deleted":true}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No product with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers":{"get":{"operationId":"listCustomers","tags":["Customers"],"summary":"List customers","description":"The store's customers, newest first. Search matches name, email, mobile and tags.\n\nNeeds the `customers:read` permission.","x-scope":"customers:read","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1 (default 1)","schema":{"type":"integer"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–50 (default 20)","schema":{"type":"integer"}},{"name":"search","in":"query","required":false,"description":"Text to search for","schema":{"type":"string"}},{"name":"subscribed","in":"query","required":false,"description":"true for customers who agreed to marketing, false for the rest","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"name or createdAt; prefix with - for descending (default -createdAt)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"id":"cmwnp0c2a0012jwxu0q4n5m6p","name":"Asha Rao","email":"asha@example.com","phone":"+919876543210","location":"Mumbai, Maharashtra","subscribed":false,"tags":["vip"],"source":"storefront","createdAt":"2026-11-19T10:30:00.000Z"}],"pagination":{"page":1,"pageSize":20,"total":1,"pageCount":1}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCustomer","tags":["Customers"],"summary":"Create a customer","description":"Adds a customer, for example when someone signs up on your website or app. Needs an email or a mobile number; both are unique in the store. The first address is the default unless another is marked isDefault.\n\nNeeds the `customers:write` permission.","x-scope":"customers:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50,"description":"First name","example":"Asha"},"lastName":{"nullable":true,"description":"Last name","example":"Rao","type":"string","maxLength":50},"email":{"nullable":true,"description":"Email, unique in the store. An email or a phone is required","example":"asha@example.com","type":"string","maxLength":120,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"nullable":true,"description":"10-digit Indian mobile, unique in the store; +91 is optional","example":"9876543210","type":"string","maxLength":16},"emailMarketing":{"type":"boolean","description":"Agreed to marketing emails (default false)"},"smsMarketing":{"type":"boolean","description":"Agreed to SMS and WhatsApp offers (default false)"},"note":{"nullable":true,"description":"Note only your team sees","type":"string","maxLength":1000},"tags":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Up to 30 tags","example":["vip"]},"password":{"type":"string","minLength":8,"maxLength":128,"description":"Lets the customer log in to the store; at least 8 characters"},"addresses":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":40,"description":"On update: an existing address's id, to keep it. Leave out to add a new address"},"name":{"nullable":true,"description":"Recipient; defaults to the customer's name","example":"Asha Rao","type":"string","maxLength":100},"phone":{"nullable":true,"description":"Recipient's 10-digit mobile; defaults to the customer's","example":"9876543210","type":"string","maxLength":16},"company":{"nullable":true,"description":"Company name","type":"string","maxLength":100},"line1":{"type":"string","minLength":1,"maxLength":150,"description":"House, building and street","example":"Flat 4B, Sea View, Carter Road"},"line2":{"nullable":true,"description":"Area or locality","example":"Bandra West","type":"string","maxLength":150},"landmark":{"nullable":true,"description":"Nearby landmark","example":"Near Otters Club","type":"string","maxLength":100},"city":{"type":"string","minLength":1,"maxLength":80,"description":"City","example":"Mumbai"},"state":{"type":"string","enum":["Andaman and Nicobar Islands","Andhra Pradesh","Arunachal Pradesh","Assam","Bihar","Chandigarh","Chhattisgarh","Dadra and Nagar Haveli and Daman and Diu","Delhi","Goa","Gujarat","Haryana","Himachal Pradesh","Jammu and Kashmir","Jharkhand","Karnataka","Kerala","Ladakh","Lakshadweep","Madhya Pradesh","Maharashtra","Manipur","Meghalaya","Mizoram","Nagaland","Odisha","Puducherry","Punjab","Rajasthan","Sikkim","Tamil Nadu","Telangana","Tripura","Uttar Pradesh","Uttarakhand","West Bengal"],"description":"State or union territory, full name","example":"Maharashtra"},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$","description":"6-digit PIN code","example":"400050"},"isDefault":{"type":"boolean","description":"Use as the default address (the first address is the default otherwise)"}},"required":["line1","city","state","pincode"],"additionalProperties":false},"description":"Up to 10 addresses. On update, this replaces the whole list"},"source":{"type":"string","enum":["storefront","checkout","admin"],"description":"Where they came from (default storefront)"}},"required":["firstName"],"additionalProperties":false},"example":{"firstName":"Asha","lastName":"Rao","email":"asha@example.com","phone":"9876543210","addresses":[{"line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","city":"Mumbai","state":"Maharashtra","pincode":"400050"}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"example":{"data":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","firstName":"Asha","lastName":"Rao","email":"asha@example.com","phone":"+919876543210","emailMarketing":false,"smsMarketing":false,"note":null,"tags":["vip"],"source":"storefront","hasPassword":false,"avatarUrl":null,"addresses":[{"id":"cmwnp0c2b0013jwxu7a8b9c0d","name":"Asha Rao","phone":"+919876543210","company":null,"line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN","isDefault":true}],"lastLoginAt":null,"createdAt":"2026-11-19T10:30:00.000Z","updatedAt":"2026-11-19T10:30:00.000Z"}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is invalid, neither email nor phone was sent, or another customer already uses them","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{id}":{"get":{"operationId":"getCustomer","tags":["Customers"],"summary":"Get a customer","description":"One customer with all their saved addresses.\n\nNeeds the `customers:read` permission.","x-scope":"customers:read","parameters":[{"name":"id","in":"path","required":true,"description":"The customer's id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","firstName":"Asha","lastName":"Rao","email":"asha@example.com","phone":"+919876543210","emailMarketing":false,"smsMarketing":false,"note":null,"tags":["vip"],"source":"storefront","hasPassword":false,"avatarUrl":null,"addresses":[{"id":"cmwnp0c2b0013jwxu7a8b9c0d","name":"Asha Rao","phone":"+919876543210","company":null,"line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN","isDefault":true}],"lastLoginAt":null,"createdAt":"2026-11-19T10:30:00.000Z","updatedAt":"2026-11-19T10:30:00.000Z"}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No customer with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCustomer","tags":["Customers"],"summary":"Update a customer","description":"Changes only the fields you send. addresses, when sent, is the full new list: include an existing address's id to keep it, and addresses you leave out are removed. Setting a password signs the customer out of other devices.\n\nNeeds the `customers:write` permission.","x-scope":"customers:write","parameters":[{"name":"id","in":"path","required":true,"description":"The customer's id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50,"description":"First name","example":"Asha"},"lastName":{"nullable":true,"description":"Last name","example":"Rao","type":"string","maxLength":50},"email":{"nullable":true,"description":"Email, unique in the store. An email or a phone is required","example":"asha@example.com","type":"string","maxLength":120,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"nullable":true,"description":"10-digit Indian mobile, unique in the store; +91 is optional","example":"9876543210","type":"string","maxLength":16},"emailMarketing":{"type":"boolean","description":"Agreed to marketing emails (default false)"},"smsMarketing":{"type":"boolean","description":"Agreed to SMS and WhatsApp offers (default false)"},"note":{"nullable":true,"description":"Note only your team sees","type":"string","maxLength":1000},"tags":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Up to 30 tags","example":["vip"]},"password":{"type":"string","minLength":8,"maxLength":128,"description":"Lets the customer log in to the store; at least 8 characters"},"addresses":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":40,"description":"On update: an existing address's id, to keep it. Leave out to add a new address"},"name":{"nullable":true,"description":"Recipient; defaults to the customer's name","example":"Asha Rao","type":"string","maxLength":100},"phone":{"nullable":true,"description":"Recipient's 10-digit mobile; defaults to the customer's","example":"9876543210","type":"string","maxLength":16},"company":{"nullable":true,"description":"Company name","type":"string","maxLength":100},"line1":{"type":"string","minLength":1,"maxLength":150,"description":"House, building and street","example":"Flat 4B, Sea View, Carter Road"},"line2":{"nullable":true,"description":"Area or locality","example":"Bandra West","type":"string","maxLength":150},"landmark":{"nullable":true,"description":"Nearby landmark","example":"Near Otters Club","type":"string","maxLength":100},"city":{"type":"string","minLength":1,"maxLength":80,"description":"City","example":"Mumbai"},"state":{"type":"string","enum":["Andaman and Nicobar Islands","Andhra Pradesh","Arunachal Pradesh","Assam","Bihar","Chandigarh","Chhattisgarh","Dadra and Nagar Haveli and Daman and Diu","Delhi","Goa","Gujarat","Haryana","Himachal Pradesh","Jammu and Kashmir","Jharkhand","Karnataka","Kerala","Ladakh","Lakshadweep","Madhya Pradesh","Maharashtra","Manipur","Meghalaya","Mizoram","Nagaland","Odisha","Puducherry","Punjab","Rajasthan","Sikkim","Tamil Nadu","Telangana","Tripura","Uttar Pradesh","Uttarakhand","West Bengal"],"description":"State or union territory, full name","example":"Maharashtra"},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$","description":"6-digit PIN code","example":"400050"},"isDefault":{"type":"boolean","description":"Use as the default address (the first address is the default otherwise)"}},"required":["line1","city","state","pincode"],"additionalProperties":false},"description":"Up to 10 addresses. On update, this replaces the whole list"}},"additionalProperties":false},"example":{"note":"Prefers evening delivery","addresses":[{"id":"cmwnp0c2b0013jwxu7a8b9c0d","line1":"Flat 4B, Sea View, Carter Road","city":"Mumbai","state":"Maharashtra","pincode":"400050"},{"name":"Asha (office)","line1":"WeWork, BKC","city":"Mumbai","state":"Maharashtra","pincode":"400051","isDefault":true}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","firstName":"Asha","lastName":"Rao","email":"asha@example.com","phone":"+919876543210","emailMarketing":false,"smsMarketing":false,"note":null,"tags":["vip"],"source":"storefront","hasPassword":false,"avatarUrl":null,"addresses":[{"id":"cmwnp0c2b0013jwxu7a8b9c0d","name":"Asha Rao","phone":"+919876543210","company":null,"line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN","isDefault":true}],"lastLoginAt":null,"createdAt":"2026-11-19T10:30:00.000Z","updatedAt":"2026-11-19T10:30:00.000Z"}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No customer with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteCustomer","tags":["Customers"],"summary":"Delete a customer","description":"Removes the customer, their addresses and their store login. Their orders stay, with the name they ordered under.\n\nNeeds the `customers:write` permission.","x-scope":"customers:write","parameters":[{"name":"id","in":"path","required":true,"description":"The customer's id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","deleted":true}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No customer with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"operationId":"listOrders","tags":["Orders"],"summary":"List orders","description":"The store's orders, newest first. Search matches the order number, customer name, email and mobile.\n\nNeeds the `orders:read` permission.","x-scope":"orders:read","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1 (default 1)","schema":{"type":"integer"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–50 (default 20)","schema":{"type":"integer"}},{"name":"search","in":"query","required":false,"description":"Text to search for","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"to_ship, shipped, delivered, unpaid or cancelled (cancelled includes refunded)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"id":"cmwnp2x9k001ajwxu3e4f5g6h","number":1042,"status":"confirmed","paymentStatus":"paid","paymentMethod":"upi","customerId":"cmwnp0c2a0012jwxu0q4n5m6p","customerName":"Asha Rao","itemCount":2,"total":1397,"currency":"INR","createdAt":"2026-11-19T11:02:00.000Z"}],"pagination":{"page":1,"pageSize":20,"total":1,"pageCount":1}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createOrder","tags":["Orders"],"summary":"Create an order","description":"Places an order exactly as the admin does: stock is taken off (and locked so two orders can't sell the last item), the discount code is checked and counted, and an invoice is issued. Prices default to each variant's current price and the address to the customer's default. Send an Idempotency-Key header so a retry never creates a second order.\n\nNeeds the `orders:write` permission.","x-scope":"orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. A unique value per order, like a UUID. Repeating it returns the order it created (200, with Idempotency-Replayed: true)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","minLength":1,"maxLength":40,"description":"The customer placing the order"},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"variantId":{"type":"string","minLength":1,"maxLength":40,"description":"A product variant's id (a product without options has one variant)"},"quantity":{"type":"integer","minimum":1,"maximum":9999,"description":"How many","example":2},"price":{"type":"number","minimum":0,"maximum":10000000,"description":"Unit price in rupees; defaults to the variant's current price"}},"required":["variantId","quantity"],"additionalProperties":false},"description":"What's ordered, up to 100 lines. Each variant once"},"address":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Recipient","example":"Asha Rao"},"phone":{"type":"string","minLength":1,"maxLength":16,"description":"Recipient's 10-digit mobile","example":"9876543210"},"line1":{"type":"string","minLength":1,"maxLength":150,"description":"House, building and street","example":"12 MG Road"},"line2":{"nullable":true,"description":"Area or locality","type":"string","maxLength":150},"landmark":{"nullable":true,"description":"Nearby landmark","type":"string","maxLength":100},"city":{"type":"string","minLength":1,"maxLength":80,"description":"City","example":"Bengaluru"},"state":{"type":"string","enum":["Andaman and Nicobar Islands","Andhra Pradesh","Arunachal Pradesh","Assam","Bihar","Chandigarh","Chhattisgarh","Dadra and Nagar Haveli and Daman and Diu","Delhi","Goa","Gujarat","Haryana","Himachal Pradesh","Jammu and Kashmir","Jharkhand","Karnataka","Kerala","Ladakh","Lakshadweep","Madhya Pradesh","Maharashtra","Manipur","Meghalaya","Mizoram","Nagaland","Odisha","Puducherry","Punjab","Rajasthan","Sikkim","Tamil Nadu","Telangana","Tripura","Uttar Pradesh","Uttarakhand","West Bengal"],"description":"State, full name","example":"Karnataka"},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$","description":"6-digit PIN code","example":"560001"}},"required":["name","phone","line1","city","state","pincode"],"additionalProperties":false,"description":"Shipping address; defaults to the customer's default address"},"saveAddress":{"type":"boolean","description":"Also save a sent address to the customer (default true; duplicates are skipped)"},"shipping":{"type":"number","minimum":0,"maximum":10000000,"description":"Shipping charge in rupees (default 0)","example":99},"discountCode":{"type":"string","maxLength":30,"description":"A discount code to apply","example":"DIWALI20"},"status":{"type":"string","enum":["confirmed","shipped","delivered"],"description":"Starting status (default confirmed)"},"paid":{"type":"boolean","description":"Payment already received (default false). Can't be true with cod"},"paymentMethod":{"type":"string","enum":["cod","upi","card","bank_transfer","cash"],"description":"How the customer pays","example":"upi"},"note":{"nullable":true,"description":"Note only your team sees","type":"string","maxLength":1000}},"required":["customerId","lines","paymentMethod"],"additionalProperties":false},"example":{"customerId":"cmwnp0c2a0012jwxu0q4n5m6p","lines":[{"variantId":"cmwnoy41f000ujwxu8h3c2d4e","quantity":2}],"shipping":99,"paymentMethod":"upi","paid":true}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"example":{"data":{"id":"cmwnp2x9k001ajwxu3e4f5g6h","number":1042,"status":"confirmed","paymentStatus":"paid","paymentMethod":"upi","source":"api","customer":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","name":"Asha Rao","email":"asha@example.com","phone":"+919876543210"},"shippingAddress":{"name":"Asha Rao","phone":"+919876543210","line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN"},"lines":[{"id":"cmwnp2x9m001bjwxu1a2b3c4d","variantId":"cmwnoy41f000ujwxu8h3c2d4e","productId":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","variantTitle":"M / Black","sku":"TEE-M-BLK","imageUrl":null,"price":649,"quantity":2,"total":1298}],"subtotal":1298,"discountTotal":0,"discountCode":null,"shippingTotal":99,"total":1397,"currency":"INR","note":null,"invoice":{"number":"INV-1042","status":"paid"},"createdAt":"2026-11-19T11:02:00.000Z","paidAt":"2026-11-19T11:02:00.000Z","shippedAt":null,"deliveredAt":null,"cancelledAt":null,"refundedAt":null}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field is invalid, a variant is out of stock (fields name the line), the discount doesn't apply, or the customer has no address and none was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"operationId":"getOrder","tags":["Orders"],"summary":"Get an order","description":"One order with its lines, shipping address, totals and invoice.\n\nNeeds the `orders:read` permission.","x-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"description":"The order's id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnp2x9k001ajwxu3e4f5g6h","number":1042,"status":"confirmed","paymentStatus":"paid","paymentMethod":"upi","source":"api","customer":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","name":"Asha Rao","email":"asha@example.com","phone":"+919876543210"},"shippingAddress":{"name":"Asha Rao","phone":"+919876543210","line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN"},"lines":[{"id":"cmwnp2x9m001bjwxu1a2b3c4d","variantId":"cmwnoy41f000ujwxu8h3c2d4e","productId":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","variantTitle":"M / Black","sku":"TEE-M-BLK","imageUrl":null,"price":649,"quantity":2,"total":1298}],"subtotal":1298,"discountTotal":0,"discountCode":null,"shippingTotal":99,"total":1397,"currency":"INR","note":null,"invoice":{"number":"INV-1042","status":"paid"},"createdAt":"2026-11-19T11:02:00.000Z","paidAt":"2026-11-19T11:02:00.000Z","shippedAt":null,"deliveredAt":null,"cancelledAt":null,"refundedAt":null}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No order with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/status":{"post":{"operationId":"updateOrderStatus","tags":["Orders"],"summary":"Change an order's status","description":"Moves the order on: confirmed → shipped → delivered, or to cancelled or refunded. Cancelling or refunding puts the stock back, gives the discount its use back and voids or refunds the invoice. Refunding needs a paid order.\n\nNeeds the `orders:write` permission.","x-scope":"orders:write","parameters":[{"name":"id","in":"path","required":true,"description":"The order's id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["shipped","delivered","cancelled","refunded"],"description":"The new status. Refunded needs a paid order","example":"shipped"}},"required":["status"],"additionalProperties":false},"example":{"status":"shipped"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnp2x9k001ajwxu3e4f5g6h","number":1042,"status":"shipped","paymentStatus":"paid","paymentMethod":"upi","source":"api","customer":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","name":"Asha Rao","email":"asha@example.com","phone":"+919876543210"},"shippingAddress":{"name":"Asha Rao","phone":"+919876543210","line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN"},"lines":[{"id":"cmwnp2x9m001bjwxu1a2b3c4d","variantId":"cmwnoy41f000ujwxu8h3c2d4e","productId":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","variantTitle":"M / Black","sku":"TEE-M-BLK","imageUrl":null,"price":649,"quantity":2,"total":1298}],"subtotal":1298,"discountTotal":0,"discountCode":null,"shippingTotal":99,"total":1397,"currency":"INR","note":null,"invoice":{"number":"INV-1042","status":"paid"},"createdAt":"2026-11-19T11:02:00.000Z","paidAt":"2026-11-19T11:02:00.000Z","shippedAt":"2026-11-20T09:15:00.000Z","deliveredAt":null,"cancelledAt":null,"refundedAt":null}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No order with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The order can't make that move, e.g. delivered → shipped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/mark-paid":{"post":{"operationId":"markOrderPaid","tags":["Orders"],"summary":"Mark an order paid","description":"Records that a pending payment was received, for example cash on delivery. The invoice becomes paid too.\n\nNeeds the `orders:write` permission.","x-scope":"orders:write","parameters":[{"name":"id","in":"path","required":true,"description":"The order's id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"cmwnp2x9k001ajwxu3e4f5g6h","number":1042,"status":"confirmed","paymentStatus":"paid","paymentMethod":"cod","source":"api","customer":{"id":"cmwnp0c2a0012jwxu0q4n5m6p","name":"Asha Rao","email":"asha@example.com","phone":"+919876543210"},"shippingAddress":{"name":"Asha Rao","phone":"+919876543210","line1":"Flat 4B, Sea View, Carter Road","line2":"Bandra West","landmark":null,"city":"Mumbai","state":"Maharashtra","pincode":"400050","country":"IN"},"lines":[{"id":"cmwnp2x9m001bjwxu1a2b3c4d","variantId":"cmwnoy41f000ujwxu8h3c2d4e","productId":"cmwnoy41e000sjwxu4adhd9ot","title":"Cotton Tee","variantTitle":"M / Black","sku":"TEE-M-BLK","imageUrl":null,"price":649,"quantity":2,"total":1298}],"subtotal":1298,"discountTotal":0,"discountCode":null,"shippingTotal":99,"total":1397,"currency":"INR","note":null,"invoice":{"number":"INV-1042","status":"paid"},"createdAt":"2026-11-19T11:02:00.000Z","paidAt":"2026-11-19T11:02:00.000Z","shippedAt":null,"deliveredAt":null,"cancelledAt":null,"refundedAt":null}}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the permission this endpoint needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No order with this id in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The order is already paid, cancelled or refunded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached (120 requests a minute per key). See Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"vnd_live_…","description":"A store API key. Permissions: products:read, products:write, customers:read, customers:write, orders:read, orders:write (write includes read)."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"validation_error"},"message":{"type":"string","example":"Some fields are missing or invalid."},"fields":{"type":"object","additionalProperties":{"type":"string"},"example":{"lines.0.quantity":"Only 3 in stock"}}}}}}}}}