{"openapi":"3.0.0","info":{"title":"1C API","description":"Апі для інтеграції 1C з KeepinCRM","version":"1.0.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/IPHONEVADIM2003/1c_api/1.0.0"},{"url":"http://45.140.122.27/TestHook/hs"}],"tags":[{"name":"Products","description":"Для роботи з товарами"},{"name":"Order","description":"Для роботи з замовленнями"}],"paths":{"/WebExchange/Webhook/":{"post":{"security":[{"basicAuth":[]}],"tags":["Products"],"summary":"Установити вебхук","operationId":"product_webhook_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateWebhook"}}}},"responses":{"201":{"description":"Успішно створено"}},"callbacks":{"ProductChanged":{"{$request.body#/url}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductChanged"}}}},"responses":{"200":{"description":"Прийнято"}}}}}}}},"/orders/create/":{"post":{"security":[{"basicAuth":[]}],"tags":["Order"],"summary":"Створити замовлення","operationId":"order_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"responses":{"200":{"description":"Запит прийнято","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerResponse"}}}}}}},"/orders/edit/{order_id}/":{"post":{"security":[{"basicAuth":[]}],"tags":["Order"],"summary":"Редагувати замовлення","operationId":"order_update","parameters":[{"name":"order_id","in":"path","description":"ID замовлення з KeepinCRM","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"responses":{"200":{"description":"Запит прийнято","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerResponse"}}}}}}},"/orders/delete/{order_id}/":{"post":{"security":[{"basicAuth":[]}],"tags":["Order"],"summary":"Видалити замовлення","operationId":"order_delete","parameters":[{"name":"order_id","in":"path","description":"ID замовлення з KeepinCRM","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Запит прийнято","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerResponse"}}}}}}}},"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"schemas":{"ServerResponse":{"type":"object","properties":{"status":{"type":"string","description":"Статус","enum":["ok","error"]},"data":{"description":"Опис помилки якщо є","type":"string","default":""}},"required":["status","data"]},"Order":{"type":"object","properties":{"id":{"type":"string","description":"ІД замовлення з ЦРМ"},"num_order":{"type":"string","description":"Номер замовлення з ЦРМ"},"date_order":{"type":"string","format":"date","description":"Дата замовлення з ЦРМ"},"customer":{"type":"object","description":"Дані про покупця","properties":{"customer_id":{"type":"string","description":"ІД клієнта з ЦРМ"},"name":{"type":"string","description":"Назва клієнта"},"phone":{"type":"string","description":"Номер телефону"},"isPersonalEmployer":{"type":"boolean","description":"Це фізична особа"},"edrpou":{"type":"string","description":"ЕДРПОУ"}},"required":["customer_id","name","phone","isPersonalEmployer"]},"products":{"type":"array","items":{"type":"object","description":"Список товарів","properties":{"uid":{"type":"string","description":"УІД товару з 1С (має бути в ЦРМ)"},"name":{"type":"string","description":"Назва товару"},"count":{"type":"integer","description":"Кількість товару"},"price":{"type":"number","format":"float","description":"Ціна товару"},"summ":{"type":"number","format":"float","description":"Сума рядку"}}}}},"required":["id","num_order","date_order","customer","products"]},"ProductChanged":{"type":"object","description":"Даня створеного товару","required":["uid","name","full_name","article","comment","manufacturer","height","length","width","guaranty","add_details","price","amount"],"properties":{"uid":{"type":"string","description":"Ідентифікатор товару"},"name":{"type":"string","description":"Назва товару"},"full_name":{"type":"string","description":"Повна назва товару"},"article":{"type":"string","description":"Артикул товару"},"comment":{"type":"string","description":"Коментар до товару"},"manufacturer":{"type":"string","description":"Виробник товару"},"height":{"type":"number","description":"Висота товару в см"},"length":{"type":"number","description":"Довжина товару в см"},"width":{"type":"number","description":"Ширина товару в см"},"guaranty":{"type":"number","description":"Гарантійний срок товару (вроді би в місяцях)"},"add_details":{"type":"array","description":"Додаткові рквізити товару","items":{"type":"object","properties":{"name":{"type":"string","description":"Назва додаткового реквізиту"},"value":{"type":"string","description":"Значеня додаткового реквізиту"}}}},"group":{"type":"string","description":"Група товару"},"unit":{"type":"string","description":"Одиниця виміру товару"},"price":{"type":"number","description":"Ціна товару"},"quantity":{"type":"number","description":"Кількість товару"}}},"ProductCreateWebhook":{"required":["adress"],"type":"object","properties":{"adress":{"type":"string","description":"Адреса вебхуку"}},"description":"Дані для створення вебхуку"}}}}