{"openapi":"3.0.3","info":{"title":"CoolStuff2Buy Product API","version":"1.0.0","description":"Public, read-only product catalogue and shipping quotes for AI agents. Prices in AUD incl. GST. Orders and customer data are not available.","contact":{"email":"sales@cs2b.com.au","url":"https://www.cs2b.com.au"}},"servers":[{"url":"https://www.cs2b.com.au"}],"paths":{"/api/agent/products":{"get":{"operationId":"searchProducts","summary":"Search products","description":"At least one of q, category or brand is required.","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Keywords; every word must match title, brand or SKU"},{"name":"category","in":"query","schema":{"type":"string"},"description":"Category slug from /api/agent/categories"},{"name":"brand","in":"query","schema":{"type":"string"}},{"name":"min_price","in":"query","schema":{"type":"number"},"description":"AUD"},{"name":"max_price","in":"query","schema":{"type":"number"},"description":"AUD"},{"name":"sort","in":"query","schema":{"type":"string","enum":["relevance","price_asc","price_desc","newest"]}},{"name":"include_out_of_stock","in":"query","schema":{"type":"boolean","default":false}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Matching products","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"brand":{"type":"string","nullable":true},"summary":{"type":"string"},"price":{"type":"object","properties":{"amount":{"type":"string","example":"129.95"},"cents":{"type":"integer","example":12995},"currency":{"type":"string","example":"AUD"},"compareAt":{"type":"object","properties":{"amount":{"type":"string","example":"129.95"},"cents":{"type":"integer","example":12995},"currency":{"type":"string","example":"AUD"}},"nullable":true,"description":"Was-price or RRP when higher than the current price"},"onSale":{"type":"boolean"},"saleEndsAt":{"type":"string","format":"date-time","nullable":true},"gstIncluded":{"type":"boolean"}}},"inStock":{"type":"boolean"},"freeShipping":{"type":"boolean"},"image":{"type":"string","nullable":true},"url":{"type":"string","description":"Customer-facing product page"},"detailsUrl":{"type":"string"}}}},"hasMore":{"type":"boolean"},"nextPage":{"type":"string","nullable":true}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/agent/products/{slugOrSku}":{"get":{"operationId":"getProduct","summary":"Get product details","parameters":[{"name":"slugOrSku","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Product details","content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"brand":{"type":"string","nullable":true},"url":{"type":"string"},"description":{"type":"string","description":"Plain text"},"price":{"type":"object","properties":{"amount":{"type":"string","example":"129.95"},"cents":{"type":"integer","example":12995},"currency":{"type":"string","example":"AUD"},"compareAt":{"type":"object","properties":{"amount":{"type":"string","example":"129.95"},"cents":{"type":"integer","example":12995},"currency":{"type":"string","example":"AUD"}},"nullable":true,"description":"Was-price or RRP when higher than the current price"},"onSale":{"type":"boolean"},"saleEndsAt":{"type":"string","format":"date-time","nullable":true},"gstIncluded":{"type":"boolean"}}},"inStock":{"type":"boolean"},"categories":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"}}}},"images":{"type":"array","items":{"type":"string"}},"specs":{"type":"object","properties":{"weightKg":{"type":"number","nullable":true},"lengthCm":{"type":"number","nullable":true},"widthCm":{"type":"number","nullable":true},"heightCm":{"type":"number","nullable":true},"ean":{"type":"string","nullable":true}}},"variants":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"label":{"type":"string"},"price":{"type":"string"},"inStock":{"type":"boolean"},"selected":{"type":"boolean"},"detailsUrl":{"type":"string"}}}},"shipping":{"type":"object","properties":{"freeShipping":{"type":"boolean"},"indicativeRatesByZone":{"type":"array","items":{"type":"object","properties":{"zone":{"type":"string"},"label":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string"}}}},"quoteUrl":{"type":"string"}}}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/agent/categories":{"get":{"operationId":"listCategories","summary":"List the category tree","responses":{"200":{"description":"Category tree with slugs"}}}},"/api/agent/shipping":{"get":{"operationId":"quoteShipping","summary":"Live shipping quote to an Australian postcode or suburb","parameters":[{"name":"postcode","in":"query","schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"suburb","in":"query","schema":{"type":"string"},"description":"Used when postcode is omitted"},{"name":"state","in":"query","schema":{"type":"string","example":"NSW"}},{"name":"items","in":"query","required":true,"schema":{"type":"string","example":"SKU1:1,SKU2:2"},"description":"Comma-separated SKU:quantity pairs, up to 20"}],"responses":{"200":{"description":"Shipping quote","content":{"application/json":{"schema":{"type":"object","properties":{"postcode":{"type":"string"},"resolvedFrom":{"type":"object","nullable":true,"properties":{"suburb":{"type":"string"},"state":{"type":"string"}}},"zone":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"}}},"currency":{"type":"string"},"total":{"type":"string"},"allItemsShippable":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"quantity":{"type":"integer"},"unitCost":{"type":"string","nullable":true},"lineCost":{"type":"string","nullable":true},"freeShipping":{"type":"boolean"},"shippable":{"type":"boolean"},"reason":{"type":"string"}}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"post":{"operationId":"quoteShippingPost","summary":"Live shipping quote (JSON body)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"postcode":{"type":"string"},"suburb":{"type":"string"},"state":{"type":"string"},"items":{"type":"array","maxItems":20,"items":{"type":"object","required":["sku","quantity"],"properties":{"sku":{"type":"string"},"quantity":{"type":"integer","minimum":1,"maximum":99}}}}}}}}},"responses":{"200":{"description":"Same as GET"},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}