{"openapi":"3.1.0","info":{"title":"Traffic Free public catalog API","version":"1.0.0","description":"Browse public products. Prices are in Ghanaian cedis (GHS), not minor units. No credentials are required."},"servers":[{"url":"/"}],"components":{"schemas":{"CatalogError":{"type":"object","required":["error","code","hint","docs"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"hint":{"type":"string"},"docs":{"type":"string","const":"/docs/api"}}}}},"paths":{"/api/catalog":{"get":{"operationId":"listCatalogProducts","summary":"Search or browse the public product catalog","parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":100}},{"name":"category","in":"query","schema":{"type":"string","maxLength":180,"pattern":"^[a-zA-Z0-9_-]*$"}},{"name":"brand","in":"query","schema":{"type":"string","maxLength":180,"pattern":"^[a-zA-Z0-9_-]*$"}},{"name":"minPrice","in":"query","schema":{"type":"string","pattern":"^(?:\\d{1,8}(?:\\.\\d{1,2})?)?$"}},{"name":"maxPrice","in":"query","schema":{"type":"string","pattern":"^(?:\\d{1,8}(?:\\.\\d{1,2})?)?$"}},{"name":"stock","in":"query","schema":{"type":"string","enum":["","instock"]}},{"name":"sort","in":"query","schema":{"type":"string","enum":["","newest","price-low","price-high","name","popular"]}},{"name":"filter","in":"query","schema":{"type":"string","enum":["","deals","new"]}},{"name":"page","in":"query","schema":{"type":"string","pattern":"^[1-9]\\d{0,5}$"}},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":50}},{"name":"ids","in":"query","schema":{"type":"string","maxLength":9050}}],"responses":{"200":{"description":"A page of products","content":{"application/json":{"schema":{"type":"object","required":["products","total","pages","page","perPage"],"properties":{"products":{"type":"array","items":{"type":"object","required":["id","slug","name","price","currency","stock"],"properties":{"id":{"type":"string"},"slug":{"type":"string","description":"Use as the path segment in /products/{slug}."},"name":{"type":"string"},"price":{"type":"number"},"currency":{"const":"GHS"},"stock":{"type":"integer","description":"Availability indicator, not exact inventory."}}}},"total":{"type":"integer"},"pages":{"type":"integer"},"page":{"type":"integer"},"perPage":{"type":"integer"}}}}}},"400":{"description":"Invalid search or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogError"}}}},"409":{"description":"Catalog connection is not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogError"}}}},"429":{"description":"Too many searches","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogError"}}}},"502":{"description":"Catalog data could not be loaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogError"}}}}}}},"/api/catalog/status":{"get":{"operationId":"getCatalogStatus","summary":"Check whether the catalog is serving data","responses":{"200":{"description":"Catalog is available"},"503":{"description":"Catalog is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogError"}}}}}}}}}