openapi: 3.0.0 info: version: 1.0.0 title: User API description: | Вы можете использовать наше API для следующих действий: * Выставление статуса заказу * Обновление настроек района(ов) * Обновление параметров товара(ов) Для всех действий требуется аутентификация (api-key) У каждого филиала свой api-key servers: - url: https://ru.foodsoul.pro/api/user/v1/ description: Россия - url: https://kz.foodsoul.pro/api/user/v1/ description: Казахстан - url: https://az.foodsoul.pro/api/user/v1/ description: Азербайджан components: securitySchemes: AuthToken: type: apiKey in: query name: token description: | *** ***Токен можно получить в личном кабинете:*** Настройки - Филиалы - Ключ API *** schemas: set_order_status: type: object required: - action - order_number - status properties: action: type: string enum: - set_order_status description: Изменить статус заказа order_number: type: integer description: Номер заказа status: type: string enum: - confirmed - canceled - wait_to_kitche - in_kitchen - cooked - assembly - wait_remade - ready_to_transit - in_transit - done description: | Статус заказа, возможные значения: *** * confirmed - Подтвержден * canceled - Отменен * wait_to_kitchen - Ожидает отправки на кухню * in_kitchen - На кухне * cooked - Приготовлен * assembly - Комплектовка заказа * wait_remade - Ожидает переделки * ready_to_transit - Ожидает отправки * in_transit - В пути * done - Выполнен *** update_districts: allOf: - type: object required: - action properties: action: type: string enum: - update_districts description: Обновление настроек района(ов) - oneOf: - type: object required: - id properties: id: type: integer description: ID района - type: object required: - ids properties: ids: type: array items: type: integer description: IDs районов - anyOf: - type: object required: - delivery_time properties: delivery_time: type: integer description: Время доставки заказа в минутах - type: object required: - cost_of_delivery properties: cost_of_delivery: type: integer description: Стоимость доставки - type: object required: - minimum_order_amount properties: minimum_order_amount: type: integer description: Минимальная сумма заказа - type: object required: - free_delivery_from properties: free_delivery_from: type: integer description: Бесплатная доставка от суммы update_items: required: - action - items properties: action: type: string enum: - set_order_status description: Обновление параметров товара(ов) items: type: object additionalProperties: $ref: '#/components/schemas/item' description: Массив товаров item: type: object properties: vendor_code: type: string description: Артикул товара (который необходимо обновить) cost: type: integer description: Стоимость товара description_index: type: integer description: Тип (единица измерения товара) description: type: string description: Значение (размер порции товара) new_vendor_code: type: string description: Новый артикул товара success: type: object properties: status: type: string error: type: object properties: error: type: object properties: code: type: integer description: type: string security: # Отправляем токен авторизации во всех запросах - AuthToken: [] paths: /: post: requestBody: required: true content: application/json: schema: oneOf: - $ref: '#/components/schemas/set_order_status' - $ref: '#/components/schemas/update_districts' - $ref: '#/components/schemas/update_items' examples: set_order_status: value: action: set_order_status order_number: 1 status: canceled update_districts: value: action: update_districts id: 1 free_delivery_from: 500 minimum_order_amount: 250 cost_of_delivery: 50 delivery_time: 60 update_items: value: action: update_items items: [ [ vendor_code: 123, cost: 500, description_index: 5, description: 1 ], [ vendor_code: 123, cost: 500, description_index: 5, description: 1 ] ] responses: '200': description: OK content: application/json: schema: oneOf: - $ref: '#/components/schemas/success' - $ref: '#/components/schemas/error' examples: success: value: status: success error: value: error: code: 16 description: Not find order