{"openapi":"3.0.0","servers":[{"url":"https://api.5sayer.com/v1","description":"Default endpoint"},{"url":"https://searchcdn.leadrive.me/v1","description":"Endpoint for Leadrive"}],"info":{"description":"Documentation of [5sayer.com](https://5sayer.com) and [searchcdn.leadrive.me](https://searchcdn.leadrive.me) API.\n<!-- ReDoc-Inject: <security-definitions> -->\n","version":"1.0.2","title":"5sayer API","contact":{"name":"API Support","email":"api@5sayer.com"}},"tags":[{"name":"Autocomplete","description":"Get autocomplete suggestions"},{"name":"Search","description":"Search for query"},{"name":"Manage","description":"Manage API"}],"x-tagGroups":[{"name":"General","tags":["Autocomplete","Search","Manage"]}],"paths":{"/autocomplete":{"get":{"tags":["Autocomplete"],"summary":"Get autocomplete suggestions","description":"Returns array of suggestions","operationId":"autocomplete","parameters":[{"name":"q","in":"query","description":"Query to search","required":true,"example":"Roca","schema":{"type":"string"}},{"name":"category_id","in":"query","description":"Limit search to this category","example":123,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AutocompleteResult"}}}}}},"security":[{"apiKey":[]}]}},"/search":{"get":{"tags":["Search"],"summary":"Search for query with facet filters","description":"Returns search results","operationId":"search","parameters":[{"name":"q","in":"query","description":"Query to search","example":"Roca","schema":{"type":"string"}},{"name":"sortName","in":"query","description":"Field name for sorting","example":"name","schema":{"type":"string","default":"relevance","enum":["relevance","name","price","date_first_created","reviews","rating","price_discount_pct"]}},{"name":"sortDir","in":"query","description":"Sort direction","example":"asc","schema":{"type":"string","default":"desc","enum":["asc","desc"]}},{"name":"limit","in":"query","description":"Rows count in result","example":10,"schema":{"type":"integer","default":20}},{"name":"offset","in":"query","description":"Offset from beginning","example":100,"schema":{"type":"integer","default":0}},{"name":"category_id","in":"query","description":"Limit results to this category","example":100227,"schema":{"type":"string"}},{"name":"brand_id","in":"query","description":"Limit results to this brand","example":332,"schema":{"type":"string"}},{"name":"price","in":"query","description":"Filter by price","example":"100;","schema":{"type":"string"}},{"name":"properties.XXX","in":"query","description":"Filter results by various properties, i.e.: \"properties.width\"\n","example":101,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}}},"security":[{"apiKey":[]}]}},"/customer/start-full-load":{"post":{"tags":["Manage"],"summary":"Start to import data by request","operationId":"startFullLoadByCustomer","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GeneralResponse"}}}}}},"security":[{"apiControlKey":[]}]}},"/customer/delete-items":{"post":{"tags":["Manage"],"summary":"Delete items by id","operationId":"deleteItems","parameters":[{"name":"id","in":"query","description":"Id of items, joined by comma","example":"156,235","schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"integer","description":"Rows deleted","example":1}}}}}}},"security":[{"apiControlKey":[]}]}},"/customer/update-items":{"post":{"tags":["Manage"],"summary":"Update items by id","operationId":"updateItems","requestBody":{"description":"Update items","required":true,"content":{"application/json":{"schema":{"type":"array","description":"Rows with items","items":{"oneOf":[{"$ref":"#/components/schemas/UpdateItem"},{"$ref":"#/components/schemas/UpdateItemRegions"}]}}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","description":"Rows updated","example":1}}}}}}},"security":[{"apiControlKey":[]}]}},"/customer/add-to-index":{"post":{"tags":["Manage"],"summary":"Add or update few items to index","operationId":"addToIndex","requestBody":{"description":"Items feed data","required":true,"content":{"application/json":{"schema":{"type":"object","description":"Feed JSON"}},"application/xml":{"schema":{"type":"string","description":"Feed XML"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"res":{"type":"integer","description":"0 - success, something else - error code","example":0},"msg":{"type":"string","description":"OK - success, something else - error message","example":"OK"},"stats":{"type":"object","description":"Statistics","properties":{"cats":{"$ref":"#/components/schemas/AddToIndexStatsRow"},"items":{"$ref":"#/components/schemas/AddToIndexStatsRow"}}}}}}}}},"security":[{"apiControlKey":[]}]}}},"components":{"schemas":{"AutocompleteResult":{"type":"object","properties":{"id":{"description":"ID","type":"string","example":"brand_page_326"},"type":{"$ref":"#/components/schemas/PageType"},"page_type_inner_id":{"description":"Id of object","type":"string","example":"123"},"name":{"description":"Name","type":"string","example":"Dali"},"nameHl":{"description":"Name with highlighted query substring","type":"string","example":"<b>DALI</b>"},"popularity_index":{"description":"Popularity index. Bigger value - more popular.","type":"integer","example":800},"score":{"description":"Relevancy score","type":"number","example":15.0},"url":{"description":"Url to redirect on click","example":"/goods/326"}}},"SearchResult":{"type":"object","properties":{"cats":{"description":"Categories that fit query","type":"object","properties":{"data":{"type":"array","description":"Rows","items":{"$ref":"#/components/schemas/SearchResultCat"}},"offset":{"description":"Rows offset","type":"integer","example":0},"size":{"description":"Rows count","type":"integer","example":5},"total":{"description":"Total matched rows count","type":"integer","example":815}}},"items":{"description":"Items that fit query","type":"object","properties":{"aggregations":{"type":"object","description":"Aggregations over items. Fields with \"number\" type will have \"XXX_min\" and \"XXX_max\" in response.\n","properties":{"brand_id":{"type":"array","description":"Rows count by brand","items":{"$ref":"#/components/schemas/AggregationRow"}},"category_id":{"type":"array","description":"Rows count by category","items":{"$ref":"#/components/schemas/AggregationRow"}},"properties.XXX":{"type":"array","description":"Rows count by properties.XXX field","items":{"$ref":"#/components/schemas/AggregationRow"}},"price_min":{"type":"number","description":"Price minimum value","example":15},"price_max":{"type":"number","description":"Price maximum value","example":100}}},"data":{"type":"array","description":"Rows","items":{"$ref":"#/components/schemas/SearchResultItem"}},"offset":{"description":"Rows offset","type":"integer","example":10},"size":{"description":"Rows count","type":"integer","example":5},"total":{"description":"Total matched rows count","type":"integer","example":815}}}}},"SearchResultCat":{"type":"object","properties":{"id":{"description":"ID","type":"string","example":"brand_page_326"},"id_in_cat":{"description":"ID in category","type":"string","example":326},"type":{"$ref":"#/components/schemas/PageType"},"name":{"description":"Name","type":"string","example":"Dali"}}},"SearchResultItem":{"type":"object","properties":{"id":{"description":"ID","type":"string","example":"30698"},"name":{"description":"Item name","type":"string","example":"Shure BLX288E/PG58 M17"}}},"UpdateItem":{"type":"object","description":"Common item","properties":{"id":{"description":"ID","type":"string","example":"30698"},"price":{"description":"Price","type":"number","example":58500},"oldprice":{"description":"Price before discount","type":"number","example":68500},"delivery":{"description":"Delivery costs","type":"number","example":570}}},"UpdateItemRegions":{"type":"object","description":"Item with price by region","properties":{"id":{"description":"ID","type":"string","example":"30698"},"regions":{"description":"Item name","type":"array","items":{"type":"object","properties":{"id":{"description":"Region ID","type":"integer","example":1},"price":{"description":"Price","type":"number","example":58500},"oldprice":{"description":"Price before discount","type":"number","example":68500},"delivery":{"description":"Delivery costs","type":"number","example":570}}}}}},"PageType":{"type":"string","description":"Page type","enum":["brand_page","rootcat","category_page","brand_category_page","tags_page","singer_page","series_page","item"],"example":"brand_page"},"AggregationRow":{"type":"object","description":"Rows count per id","properties":{"id":{"type":"string","description":"Id","example":"332"},"count":{"type":"integer","description":"Rows count","example":5}}},"GeneralResponse":{"type":"object","description":"Rows count per id","properties":{"res":{"type":"integer","description":"Response code. 0 - successful execution. 1 - import data is in progress.\n","example":"0"},"msg":{"type":"string","description":"Message","example":"OK"}}},"AddToIndexStatsRow":{"type":"object","description":"Stats data","properties":{"changed":{"type":"integer","description":"Rows changed","example":1},"notChanged":{"type":"integer","description":"Rows not changed","example":20},"deleted":{"type":"integer","description":"Rows deleted","example":3},"newRows":{"type":"integer","description":"Rows added","example":5},"allCount":{"type":"integer","description":"All rows count","example":1000}}}},"securitySchemes":{"apiKey":{"description":"Supply api key as GET or POST parameter.","type":"apiKey","name":"apiKey","in":"query"},"apiControlKey":{"description":"Can be also provided as GET or POST parameter apiControlKey(www-form-urlencoded).","type":"apiKey","name":"x-api-control-key","in":"header"}}}}