{
	"openapi": "3.0.3",
	"info": {
		"title": "Облачный сервер Галион-MT - RestAPI 1.0",
		"description": "Описание команд облачного сервера для обмена данными с мобильным приложением MobileTrade Galion.<br> Полезные ссылки:",
		"contact": {
			"name": "Сайт",
			"url": "http://www.galion-it.ru",
			"email": "support@galion-it.ru"
		},
		"license": {
			"name": "ООО \"ГАЛИОН-ИТ\"",
			"url": "http://www.galion-it.ru"
		},
		"version": "1.0.11"
	},
	"servers": [
		{
			"url": "http://77.247.243.177:8200/webapi/v1/MtClient"
		},
		{
			"url": "http://5.149.222.114:7000/webapi/v1/Sync"
		}
	],
	"tags": [
		{
			"name": "Users",
			"description": "команда получения пользователей"
		},
		{
			"name": "PayTypes",
			"description": "работа с формами оплаты"
		},
		{
			"name": "PriceList",
			"description": "работа с прайс-листами"
		},
		{
			"name": "Clients",
			"description": "загрузка данных по клиентам"
		},
		{
			"name": "Goods",
			"description": "информация по товарам"
		},
		{
			"name": "Docums",
			"description": "создание и подтверждение документов"
		},
		{
			"name": "SMS",
			"description": "обмен короткими сообщениями"
		},
		{
			"name": "Reports",
			"description": "Получение отчетов сформированных на сервере"
		}
	],
	"paths": {
		"/Users": {
			"get": {
				"tags": [
					"Users"
				],
				"summary": "списка пользователей, которым разрешено работать в приложении",
				"description": "Будет загружен список пользователей и паролей, если программа зарегистрирована (подключена) к облаку",
				"operationId": "updatePet",
				"parameters": [
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/User"
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации"
					}
				}
			}
		},
		"/PayTypes": {
			"get": {
				"tags": [
					"PayTypes"
				],
				"summary": "список форм оплат, которые доступны в приложении",
				"description": "Будет загружен список форм оплат, чаще всего наличный и без наличный",
				"operationId": "PayTypes",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/PayTypes"
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/PriceList": {
			"get": {
				"tags": [
					"PriceList"
				],
				"summary": "список доступных прайс-листов",
				"description": "Будет загружен список прайс-листов для клиентов",
				"operationId": "PriceList",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"ID": {
														"type": "integer",
														"format": "int64",
														"example": 1
													},
													"OP_EXT_ID": {
														"type": "string",
														"example": 68
													},
													"NAME": {
														"type": "string",
														"example": "Основной"
													},
													"ID_TOV": {
														"example": null
													},
													"ID_PAY": {
														"example": null
													},
													"PRICE": {
														"example": null
													}
												},
												"xml": {
													"name": "PriceList"
												}
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/PriceList/{ID}": {
			"get": {
				"tags": [
					"PriceList"
				],
				"summary": "загрузить прайс-лист по идентификатору",
				"description": "Загружается прайс-лист по идентификатору переданному в списке прайс-листов",
				"operationId": "PriceList/{ID}",
				"parameters": [
					{
						"name": "ID",
						"in": "path",
						"description": "идентификатор прайс-листа",
						"required": true,
						"explode": true,
						"schema": {
							"type": "string",
							"default": "1"
						}
					},
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string",
							"default": "68"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string",
							"default": "123456789012"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список цен по товарам для указанного прайс-листа",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/PriceList"
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/PriceList/CLIENTS": {
			"get": {
				"tags": [
					"PriceList"
				],
				"summary": "загрузить список доступных клиентам прайс-листов",
				"description": "Загружается список клиентов с указанием какие прайс-листы им доступны",
				"operationId": "PriceList/CLIENTS",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string",
							"default": "68"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string",
							"default": "123456789012"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список клиентов с ID доступных прайс-листов",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/PriceListCln"
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Clients": {
			"get": {
				"tags": [
					"Clients"
				],
				"summary": "список доступных к работе клиентов",
				"description": "Будет загружен список клиентов с которыми разрешено работать сотруднику",
				"operationId": "Clients",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Clients"
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Clients/ADDRESS": {
			"get": {
				"tags": [
					"Clients"
				],
				"summary": "список точек клиентов с адресами",
				"description": "Будет загружен список торговых точек клиентов с которыми разрешено работать сотруднику",
				"operationId": "Clients/ADDRESS",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Addresses"
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Clients/DEBET": {
			"get": {
				"tags": [
					"Clients"
				],
				"summary": "получить список долгов клиентов",
				"description": "Будет загружен список долгов по каждому клиенту",
				"operationId": "Clients/DEBET",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Debets"
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Clients/HISTORY": {
			"get": {
				"tags": [
					"Clients"
				],
				"summary": "получить историю продаж по клиентам",
				"description": "Загружаются документы отгрузки по клиентам можно возвращать result = null",
				"operationId": "Clients/HISTORY",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список получен",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Historys"
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Goods": {
			"get": {
				"tags": [
					"Goods"
				],
				"summary": "получение списка товаров",
				"description": "список товаров доступных пользователю",
				"operationId": "Goods",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "удачный ответ сервера",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Goods"
								}
							}
						}
					},
					"400": {
						"description": "Не правильные данные для авторризации"
					},
					"401": {
						"description": "Провайдер не зарегистрирован на сервере"
					},
					"405": {
						"description": "Превышение времени ожидания ответа"
					}
				}
			}
		},
		"/Goods/SHCODE": {
			"get": {
				"tags": [
					"Goods"
				],
				"summary": "получение штрих-кодов товаров",
				"description": "список штрих-кодов доступных пользователю товаров",
				"operationId": "Goods/SHCODE",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "удачный ответ сервера",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ShCodes"
								}
							}
						}
					},
					"400": {
						"description": "Не правильные данные для авторризации"
					},
					"401": {
						"description": "Провайдер не зарегистрирован на сервере"
					},
					"405": {
						"description": "Превышение времени ожидания ответа"
					}
				}
			}
		},
		"/Docums": {
			"post": {
				"tags": [
					"Docums"
				],
				"summary": "Отправка документа в учетную систему.",
				"description": "Отправка четырех типов документов. Табличная часть документа может иметь разный состав полей в зависимости от типа. Описание смотри в схемах.",
				"operationId": "Orders",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"properties": {
									"type": {
										"description": "Тип документа (1- заказ, 2- приход денег, 3 - снятие остатков, 4 - возврат)",
										"type": "integer",
										"example": 1
									},
									"date": {
										"description": "Дата создания документа",
										"type": "string",
										"format": "date-time",
										"example": "01-12-2024 11:00:00"
									},
									"num": {
										"description": "номер документа",
										"type": "integer",
										"example": 12
									},
									"client": {
										"description": "Идентификатор клиента",
										"type": "integer",
										"example": 2705
									},
									"address": {
										"description": "Идентификатор адреса точки клиента",
										"type": "integer",
										"example": 2705
									},
									"pay_type": {
										"description": "Идентификатор типа оплаты",
										"type": "integer",
										"example": 1
									},
									"price": {
										"description": "идентификатор прайс-листа",
										"type": "integer",
										"example": 1
									},
									"comment": {
										"description": "Комментарий",
										"type": "string",
										"example": "проверка"
									},
									"sum": {
										"description": "Общая сумма по документу",
										"type": "number",
										"example": 3000
									},
									"table": {
										"type": "array",
										"description": "Табличная часть может отличаться в зависимости от типа документа",
										"items": {
											"type": "object",
											"properties": {
												"prod": {
													"description": "Уникальный идентификатор товара",
													"type": "integer",
													"example": 15417
												},
												"price": {
													"description": "Цена за единицу товара",
													"type": "number",
													"example": 600
												},
												"kvo": {
													"description": "Количество товара",
													"type": "number",
													"example": 5
												},
												"ostatok": {
													"description": "Отстаток товара на точке",
													"type": "number",
													"example": 0
												}
											},
											"xml": {
												"name": "table"
											}
										}
									}
								},
								"required": [
									"status"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Документ сохранен",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"description": "Ответ сервера по переданным документам",
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"DOC_TYPE": {
														"description": "Тип документа (1- заказ, 2- приход денег, 3 - снятие остатков, 4 - возврат)",
														"type": "integer",
														"format": "int64",
														"example": 1
													},
													"DOC_NUM": {
														"description": "Номер документа",
														"type": "integer",
														"example": 12
													},
													"PROCESSED": {
														"description": "Статус документа (1 - сохранен)",
														"type": "integer",
														"example": 1
													},
													"COMMENT": {
														"description": "Комментарий к документу",
														"type": "string",
														"example": null
													},
													"ID_HEAD": {
														"description": "Уникальный идентификатор документа в ТУС",
														"type": "integer",
														"format": "int64",
														"example": 2634415320724267000
													}
												},
												"xml": {
													"name": "Docum"
												}
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Docums/CONFIRM": {
			"post": {
				"tags": [
					"Docums"
				],
				"summary": "получить подтверждение обработки отправленных документов",
				"description": "передается список документов по которых хотим проверить подтверждения обработки",
				"operationId": "Docums/CONFIRM",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "array",
								"items": {
									"$ref": "#/components/schemas/ConfirmDoc"
								},
								"required": [
									"status"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Список дотверждений по переданным документам. Если нет подтверждений, список будет пустой.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/ConfirmDocAns"
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/SMS": {
			"post": {
				"tags": [
					"SMS"
				],
				"summary": "обмен короткими сообщениями",
				"description": "передается список подготовленных коротких сообщений и в ответ получаем список сообщений с сервера.",
				"operationId": "SMS",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "array",
								"items": {
									"$ref": "#/components/schemas/Sms"
								},
								"required": [
									"status"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Список коротких сообщений от операторов с сервера.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"description": "Короткое сообщение",
												"type": "object",
												"properties": {
													"SMS_DATE": {
														"description": "Дата создания сообщения",
														"type": "string",
														"format": "date-time",
														"example": "02-12-2024 12:00:00"
													},
													"SMS_AUTHOR": {
														"description": "Автор сообщения",
														"type": "string",
														"example": "Server"
													},
													"SMS_SUBJECT": {
														"description": "Заголовок сообщения",
														"type": "string",
														"example": "СМС из ПО Галион"
													},
													"SMS_BODY": {
														"description": "Текст сообщения",
														"type": "string",
														"example": "Сообщения из ПО Галион по операторам пока не поддерживаются"
													}
												}
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		},
		"/Reports": {
			"get": {
				"tags": [
					"Reports"
				],
				"summary": "запрос списока отчетов доступных пользователю",
				"description": "Будет загружен список доступных пользователю отчетов",
				"operationId": "Reports",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Список отчетов",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Report"
											},
											"example": [
												{
													"REPORT_NAME": "План отгрузок",
													"REPORT_TYPE": 1,
													"Fields": [
														{
															"REPORT_FIELD_NAME": "С даты",
															"REPORT_FIELD_TYPE": 1
														},
														{
															"REPORT_FIELD_NAME": "по дату",
															"REPORT_FIELD_TYPE": 1
														}
													]
												},
												{
													"REPORT_NAME": "План отгрузок по клиенту",
													"REPORT_TYPE": 1,
													"Fields": [
														{
															"REPORT_FIELD_NAME": "С даты",
															"REPORT_FIELD_TYPE": 1
														},
														{
															"REPORT_FIELD_NAME": "по дату",
															"REPORT_FIELD_TYPE": 1
														},
														{
															"REPORT_FIELD_NAME": "Клиент",
															"REPORT_FIELD_TYPE": 6
														}
													]
												}
											]
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			},
			"post": {
				"tags": [
					"Reports"
				],
				"summary": "Получение отчета с указанными фильтрами",
				"description": "Отправляем фильтры по отчету и получаем результат отчета с сервера",
				"operationId": "/Reports",
				"parameters": [
					{
						"name": "user",
						"in": "query",
						"description": "идентификатор пользователя",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "PINN",
						"in": "query",
						"description": "Составной идентификатор фирмы (ИНН+КПП)",
						"required": true,
						"style": "form",
						"explode": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ReportQuery"
							},
							"example": {
								"REPORT_NAME": "План отгрузок",
								"REPORT_TYPE": 1,
								"Fields": [
									{
										"REPORT_FIELD_NAME": "С даты",
										"REPORT_FIELD_TYPE": 1,
										"VALUE": "01.10.2024"
									},
									{
										"REPORT_FIELD_NAME": "по дату",
										"REPORT_FIELD_TYPE": 1,
										"VALUE": "25.11.2024"
									}
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Список отчетов",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"Result": {
											"type": "string",
											"description": "Строка с результатом отчета (в виде текста или html страницы)",
											"example": "........Заявка........|...Сумма...\r\n..........РН..........|...Сумма...\r\n---------------------------------\r\n......6749(2024-11-08)|......0.00\r\n---------------------------------\r\n......6750(2024-11-08)|......0.00\r\n---------------------------------\r\n......6751(2024-11-08)|......0.00\r\n---------------------------------\r\n......6752(2024-11-08)|......0.00\r\n---------------------------------\r\n......6753(2024-11-08)|......0.00\r\n---------------------------------\r\n......6754(2024-11-08)|......0.00\r\n---------------------------------\r\n......6755(2024-11-08)|..27110.70\r\n---------------------------------\r\n....СЧ6756(2024-11-08)|..27110.70\r\n---------------------------------\r\n....СЧ6757(2024-11-08)|..27110.70\r\n---------------------------------\r\n....СЧ6758(2024-11-08)|..27110.70\r\n---------------------------------\r\n....СЧ6759(2024-11-12)|..27110.70\r\n---------------------------------\r\n....СЧ6760(2024-11-12)|..13421.00\r\n---------------------------------\r\n....СЧ6761(2024-11-12)|..27110.70\r\n---------------------------------\r\n....СЧ6762(2024-11-12)|..13421.00\r\n---------------------------------\r\n....СЧ6763(2024-11-12)|..27110.70\r\n.....РН302(2024-11-13)|..27110.70\r\n---------------------------------\r\n....СЧ6764(2024-11-12)|..13421.00\r\n---------------------------------\r\n        ВСЕГО заявок: | 230037.90\r\n      ВСЕГО отгрузок: |  27110.70"
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Неверно заданы параметры SQL-запроса"
					},
					"403": {
						"description": "Не задан PINN организации | Не задан ID пользователя | Не правильный польователь"
					},
					"405": {
						"description": "Не правильный формат команды"
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"User": {
				"type": "object",
				"properties": {
					"ID": {
						"type": "integer",
						"format": "int64",
						"example": 68
					},
					"NAME": {
						"type": "string",
						"example": "Воротилов Илья Петрович"
					},
					"OP_EXT_ID": {
						"type": "string",
						"example": 68
					},
					"PASS": {
						"type": "string",
						"example": 111
					},
					"ANKETS": {
						"type": "integer",
						"example": 0
					}
				},
				"xml": {
					"name": "user"
				}
			},
			"PayTypes": {
				"type": "object",
				"properties": {
					"ID": {
						"type": "integer",
						"format": "int64",
						"example": 2708
					},
					"OP_EXT_ID": {
						"type": "string",
						"example": 68
					},
					"NAME": {
						"type": "string",
						"example": "наличные"
					},
					"ICON_ID": {
						"type": "integer",
						"maximum": 2,
						"minimum": 0,
						"example": 1
					}
				},
				"xml": {
					"name": "PayTypes"
				}
			},
			"PriceList": {
				"type": "object",
				"properties": {
					"ID": {
						"type": "integer",
						"format": "int64",
						"example": 1
					},
					"OP_EXT_ID": {
						"type": "string",
						"example": 68
					},
					"NAME": {
						"type": "string",
						"example": "Основной"
					},
					"ID_TOV": {
						"type": "integer",
						"example": 24953
					},
					"ID_PAY": {
						"type": "integer",
						"example": 2708
					},
					"PRICE": {
						"type": "number",
						"example": 50
					}
				},
				"xml": {
					"name": "PriceList"
				}
			},
			"PriceListCln": {
				"type": "object",
				"properties": {
					"ID": {
						"type": "integer",
						"format": "int64",
						"example": 63
					},
					"OP_EXT_ID": {
						"type": "string",
						"example": 68
					},
					"COUNTERPART_ID": {
						"type": "integer",
						"example": 63
					},
					"PRICE_ID": {
						"type": "integer",
						"example": 1
					}
				},
				"xml": {
					"name": "PriceListCln"
				}
			},
			"Clients": {
				"type": "object",
				"properties": {
					"result": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/Client"
						}
					}
				}
			},
			"Client": {
				"type": "object",
				"properties": {
					"ID": {
						"description": "Уникальный идентификатор",
						"type": "integer",
						"format": "int32",
						"example": 63
					},
					"OP_EXT_ID": {
						"description": "идентификатор пользователя",
						"type": "string",
						"example": "68"
					},
					"PARENT": {
						"description": "Идентификатор группы",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"ISGROUP": {
						"description": "Флаг записи (1 - это объект группа, 0 - это клиент)",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"NAME": {
						"description": "Название клиента",
						"type": "string",
						"example": "Юр. лицо"
					},
					"PRICE_LIST_ID": {
						"description": "Прайс-лист с которым можно работать с клиентом",
						"type": "integer",
						"format": "int32",
						"example": 1
					},
					"CLOCKED": {
						"description": "Клиент заблокирован на отгрузку",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"DESCRIPTION": {
						"description": "Описание клиента",
						"type": "string",
						"example": "Комментарий"
					},
					"REST_CONTROL": {
						"description": "Контролировать остаток (устарело)",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"ADDRESS": {
						"description": "Адрес клиента",
						"type": "string",
						"example": "Ген. Острякова 238/4"
					},
					"NAME_LOWER": {
						"description": "Имя клиента в нижнем регистре",
						"type": "string",
						"example": "юр. лицо"
					}
				}
			},
			"Addresses": {
				"type": "object",
				"properties": {
					"result": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/Address"
						}
					}
				}
			},
			"Address": {
				"type": "object",
				"properties": {
					"ID": {
						"description": "Уникальный идентификатор",
						"type": "integer",
						"format": "int32",
						"example": 33
					},
					"OP_EXT_ID": {
						"description": "идентификатор пользователя",
						"type": "string",
						"example": "68"
					},
					"NAME": {
						"description": "Название торговой точки",
						"type": "string",
						"example": "Руднева 8 кв.5"
					},
					"LATITUDE": {
						"description": "Координаты GPS торговой точки",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"LONGITUDE": {
						"description": "Координаты GPS торговой точки",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"DISTANCE": {
						"description": "Радиус круга (метр) погрешности координат",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"CHECKGPS": {
						"description": "Вести контроль GPS координат при создании заказов",
						"type": "integer",
						"format": "int32",
						"example": 0
					}
				}
			},
			"Debets": {
				"type": "object",
				"properties": {
					"result": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/Debet"
						}
					}
				}
			},
			"Debet": {
				"type": "object",
				"properties": {
					"ID": {
						"description": "Уникальный идентификатор",
						"type": "integer",
						"format": "int32",
						"example": 33
					},
					"OP_EXT_ID": {
						"description": "идентификатор пользователя",
						"type": "string",
						"example": "68"
					},
					"COUNTERPART_ID": {
						"description": "Уникальный идентификатор клиента",
						"type": "integer",
						"format": "int32",
						"example": 3
					},
					"ADDRESS_ID": {
						"description": "Уникальный идентификатор торговой точки",
						"type": "integer",
						"format": "int32",
						"example": 3
					},
					"DOC_DATA": {
						"description": "Дата документа или дата долга",
						"type": "string",
						"example": "18.6.2025"
					},
					"DOC_NUM": {
						"description": "Номер документа или тескт определяющий тип долга",
						"type": "string",
						"example": "Общий долг"
					},
					"DOC_SUM": {
						"description": "Сумма документа",
						"type": "number",
						"example": 0
					},
					"DEBT_SUM": {
						"description": "Сумма долга",
						"type": "number",
						"example": -181929083.08
					},
					"TYPE_PAY": {
						"description": "По какой форме оплаты (0 - общий долг)",
						"type": "integer",
						"format": "int32",
						"example": 0
					}
				}
			},
			"Historys": {
				"type": "object",
				"properties": {
					"result": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/History"
						}
					}
				}
			},
			"History": {
				"type": "object",
				"properties": {
					"ID": {
						"description": "Уникальный идентификатор",
						"type": "integer",
						"format": "int32",
						"example": 33
					},
					"OP_EXT_ID": {
						"description": "идентификатор пользователя",
						"type": "string",
						"example": "68"
					},
					"DOC_DATA": {
						"description": "Дата документа",
						"type": "string",
						"example": "18.6.2025"
					},
					"COUNTERPART_ID": {
						"description": "Уникальный идентификатор клиента",
						"type": "integer",
						"format": "int32",
						"example": 3
					},
					"ADDRESS_ID": {
						"description": "Уникальный идентификатор торговой точки",
						"type": "integer",
						"format": "int32",
						"example": 3
					},
					"PROD_ID": {
						"description": "Уникальный идентификатор товара",
						"type": "integer",
						"format": "int32",
						"example": 475
					},
					"KVO": {
						"description": "Количество отгруженного товара",
						"type": "number",
						"example": 1
					}
				}
			},
			"Goods": {
				"type": "object",
				"properties": {
					"result": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/Good"
						}
					}
				}
			},
			"Good": {
				"type": "object",
				"properties": {
					"ID": {
						"description": "Уникальный идентификатор",
						"type": "integer",
						"format": "int32",
						"example": 24960
					},
					"OP_EXT_ID": {
						"description": "идентификатор пользователя",
						"type": "string",
						"example": "68"
					},
					"PARENT": {
						"description": "Идентификатор группы в которую входит товар",
						"type": "integer",
						"format": "int32",
						"example": 24941
					},
					"ISGROUP": {
						"description": "Флаг (1 - это группа, 0 - это товар)",
						"type": "integer",
						"format": "int32",
						"example": 0
					},
					"NAME": {
						"description": "Название товара",
						"type": "string",
						"example": "Апельсиновый фреш с мякотью"
					},
					"ED_IZM": {
						"description": "Единица измерения товара",
						"type": "string",
						"example": "шт"
					},
					"PRICE": {
						"description": "Базовая стоимость товара",
						"type": "number",
						"example": 80
					},
					"OSTATOK": {
						"description": "Остаток товара",
						"type": "number",
						"example": 0
					},
					"MIN_ORDER": {
						"description": "Минимальный заказ, может быть null",
						"type": "integer",
						"format": "int32",
						"example": 3
					},
					"WEIGHT": {
						"description": "Вес единицы товара",
						"type": "number",
						"example": 0
					},
					"VOLUME": {
						"description": "Объем единицы товара",
						"type": "number",
						"example": 0
					},
					"DESCRIPTION": {
						"description": "Описание товара",
						"type": "string",
						"example": "вкусный сок"
					},
					"NAME_LOWER": {
						"description": "Название товара в нижнем регистре",
						"type": "string",
						"example": "апельсиновый фреш с мякотью"
					}
				}
			},
			"ShCodes": {
				"type": "object",
				"properties": {
					"result": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/ShCode"
						}
					}
				}
			},
			"ShCode": {
				"type": "object",
				"properties": {
					"ID": {
						"description": "Уникальный идентификатор записи штрих-кода",
						"type": "integer",
						"format": "int32",
						"example": 25182
					},
					"OP_EXT_ID": {
						"description": "идентификатор пользователя",
						"type": "string",
						"example": "68"
					},
					"ID_GOOD": {
						"description": "Идентификатор товара, которму принадлежит штрих-код",
						"type": "integer",
						"format": "int32",
						"example": 24960
					},
					"SHCODE": {
						"description": "Штрих-код или Код или Артикул",
						"type": "string",
						"example": "2300110016655"
					}
				}
			},
			"Table_Zakaz": {
				"description": "Описание записи табличной части документа Заказ",
				"type": "object",
				"properties": {
					"prod": {
						"description": "Уникальный идентификатор товара",
						"type": "integer",
						"example": 15417
					},
					"price": {
						"description": "Цена за единицу товара",
						"type": "number",
						"example": 600
					},
					"kvo": {
						"description": "Количество товара",
						"type": "number",
						"example": 5
					},
					"ostatok": {
						"description": "Отстаток товара на точке",
						"type": "number",
						"example": 0
					}
				}
			},
			"Table_Pko": {
				"description": "Описание записи табличной части документа Прихода денег",
				"type": "object",
				"properties": {
					"doc": {
						"description": "номер документа отгрузки клиенту",
						"type": "string",
						"example": "РН-154"
					},
					"date": {
						"description": "Дата документа отгрузки",
						"type": "string",
						"example": "18.6.2025"
					},
					"oplata": {
						"description": "Сумма оплаты по накладной",
						"type": "number",
						"example": 3000
					},
					"dolg": {
						"description": "Оставшийся долг по накладной",
						"type": "number",
						"example": 0
					}
				}
			},
			"Table_Ost": {
				"description": "Описание записи табличной части документа Снятие остатков",
				"type": "object",
				"properties": {
					"prod": {
						"description": "Уникальный идентификатор товара",
						"type": "integer",
						"example": 15417
					},
					"price": {
						"description": "Цена за единицу товара",
						"type": "number",
						"example": 600
					},
					"ostatok": {
						"description": "Отстаток товара на точке",
						"type": "number",
						"example": 0
					}
				}
			},
			"Table_Return": {
				"description": "Описание записи табличной части документа Возврат товара",
				"type": "object",
				"properties": {
					"prod": {
						"description": "Уникальный идентификатор товара",
						"type": "integer",
						"example": 15417
					},
					"price": {
						"description": "Цена за единицу товара",
						"type": "number",
						"example": 600
					},
					"kvo": {
						"description": "Количество товара",
						"type": "number",
						"example": 5
					}
				}
			},
			"DocumAns": {
				"description": "ответ сервера на создание документа",
				"type": "object",
				"properties": {
					"DOC_TYPE": {
						"description": "Тип документа (1- заказ, 2- приход денег, 3 - снятие остатков, 4 - возврат)",
						"type": "integer",
						"format": "int64",
						"example": 1
					},
					"DOC_NUM": {
						"description": "Номер документа",
						"type": "integer",
						"example": 15
					},
					"PROCESSED": {
						"description": "Статус документа (1 - сохранен)",
						"type": "integer",
						"example": 1
					},
					"COMMENT": {
						"description": "Комментарий к документу",
						"type": "string",
						"example": null
					},
					"ID_HEAD": {
						"description": "Уникальный идентификатор документа в ТУС",
						"type": "integer",
						"format": "int64",
						"example": 35217107954085650
					}
				}
			},
			"ConfirmDoc": {
				"description": "Данные по созданному в ТУС документу",
				"type": "object",
				"properties": {
					"type": {
						"description": "Тип документа (1- заказ, 2- приход денег, 3 - снятие остатков, 4 - возврат)",
						"type": "integer",
						"format": "int64",
						"example": 1
					},
					"num": {
						"description": "Номер документа",
						"type": "integer",
						"example": 12
					},
					"date": {
						"description": "Дата создания документа",
						"type": "string",
						"format": "date-time",
						"example": "01-12-2024 11:00:00"
					},
					"client": {
						"description": "Идентификатор клиента",
						"type": "integer",
						"example": 2705
					},
					"address": {
						"description": "Идентификатор адреса точки клиента",
						"type": "integer",
						"example": 2705
					},
					"id_head": {
						"description": "Уникальный идентификатор документа в ТУС",
						"type": "integer",
						"format": "int64",
						"example": 2634415320724267000
					}
				}
			},
			"ConfirmDocAns": {
				"description": "Данные по созданному документу",
				"type": "object",
				"properties": {
					"DOC_TYPE": {
						"description": "Тип документа (1- заказ, 2- приход денег, 3 - снятие остатков, 4 - возврат)",
						"type": "integer",
						"format": "int64",
						"example": 1
					},
					"DOC_NUM": {
						"description": "Номер документа",
						"type": "integer",
						"example": 12
					},
					"CONFIRM": {
						"description": "Статус подтверждения документа (1 - сохранен)",
						"type": "integer",
						"example": 1
					},
					"CONFIRM_DOC": {
						"description": "Строка с нмоером и датой документа подтверждения",
						"type": "string",
						"example": "РН 123 от 05.12.2024"
					},
					"DOC_SUM": {
						"description": "Сумма подтержденного документа",
						"type": "number",
						"example": 3000
					}
				}
			},
			"Sms": {
				"description": "Короткое сообщение",
				"type": "object",
				"properties": {
					"SMS_DATE": {
						"description": "Дата создания сообщения",
						"type": "string",
						"format": "date-time",
						"example": "01-12-2024 11:00:00"
					},
					"SMS_AUTHOR": {
						"description": "Автор сообщения",
						"type": "string",
						"example": "БАА"
					},
					"SMS_SUBJECT": {
						"description": "Заголовок сообщения",
						"type": "string",
						"example": "Проверочное СМС"
					},
					"SMS_BODY": {
						"description": "Текст сообщения",
						"type": "string",
						"example": "Текст проверочного сообщения"
					}
				}
			},
			"Report": {
				"type": "object",
				"properties": {
					"REPORT_NAME": {
						"description": "Название отчета",
						"type": "string",
						"example": "План отгрузок"
					},
					"REPORT_TYPE": {
						"description": "Тип отчета (1 - текстовый формат, 2 - HTML формат)",
						"type": "integer",
						"example": 1
					},
					"Fields": {
						"description": "Описание полей для установки фильтров по отчету. Типы полей описаны в схемах.",
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/FieldCln",
							"example": [
								{
									"REPORT_FIELD_NAME": "С даты",
									"REPORT_FIELD_TYPE": 1
								},
								{
									"REPORT_FIELD_NAME": "по дату",
									"REPORT_FIELD_TYPE": 1
								}
							]
						}
					}
				}
			},
			"ReportQuery": {
				"type": "object",
				"properties": {
					"REPORT_NAME": {
						"description": "Название отчета",
						"type": "string",
						"example": "План отгрузок"
					},
					"REPORT_TYPE": {
						"description": "Тип отчета (1 - текстовый формат, 2 - HTML формат)",
						"type": "integer",
						"example": 1
					},
					"Fields": {
						"description": "Поля с установленными фильтрами по отчету.",
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/FieldQuery"
						}
					}
				}
			},
			"Field": {
				"type": "object",
				"description": "Описание полей для фильров в отчете. Данные поля будут доступны для выбора перед формированием отчета",
				"properties": {
					"REPORT_FIELD_NAME": {
						"description": "Название поля",
						"type": "string",
						"example": "С даты"
					},
					"REPORT_FIELD_TYPE": {
						"description": "Тип поля для выбора <br> - 1 - дата <br> - 2 - время <br> - 3 - дата/время <br> - 4 - флаг <br> - 5 - текст <br> - 6 - клиент из справочника <br> - 7 - пользовательский список значений",
						"type": "integer",
						"example": 1
					}
				}
			},
			"FieldCln": {
				"type": "object",
				"description": "Поле выбора клиентов для фильров в отчете. Поле будет доступно для выбора перед формированием отчета",
				"properties": {
					"REPORT_FIELD_NAME": {
						"description": "Название поля",
						"type": "string",
						"example": "Клиент"
					},
					"REPORT_FIELD_TYPE": {
						"description": "Тип поля для выбора<br>  - 1 - дата<br> - 2 - время<br> - 3 - дата/время<br> - 4 - флаг<br> - 5 - текст<br> - 6 - клиент из справочника<br> - 7 - пользовательский список значений",
						"type": "integer",
						"example": 6
					}
				}
			},
			"FieldQuery": {
				"type": "object",
				"description": "Описание полей со значением фильров в отчете.",
				"allOf": [
					{
						"$ref": "#/components/schemas/Field"
					}
				],
				"properties": {
					"value": {
						"description": "Значение фильтра",
						"type": "string"
					}
				}
			}
		},
		"requestBodies": {
			"Users": {
				"description": "fdnjhbpfwbz",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/User"
						}
					}
				}
			}
		}
	}
}