{
"openapi" : "3.0.1",
"info" : {
"title" : "Сервис валидации КИЗ"
},
"servers" : [ {
"url"
: "http://ukm5-demo-validator.servplus.ru:8080"
} ],
"security" : [ ],
"tags" : [ {
"name" : "Продажа"
}, {
"name" : "Возврат"
}, {
"name" : "Проверка продажи"
}, {
"name" : "Проверка возврата"
} ],
"paths" : {
"/base64/checkreturn" : {
"post" : {
"tags" : [ "Проверка возврата" ],
"summary" : "Проверка доступности КИЗ в формате base64 для возврата",
"description" : "Если товар с КИЗ можно возвращать, ответ будет списком кодов товаров. Иначе будет возвращено описание ошибки",
"operationId" : "postRet",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ можно возвращать",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ItemsCodes"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
},
"/checkreturn" : {
"post" : {
"tags" : [ "Проверка возврата" ],
"summary" : "Проверка доступности КИЗ для возврата",
"description" : "Если товар с КИЗ можно возвращать, ответ будет списком кодов товаров. Иначе будет возвращено описание ошибки",
"operationId" : "postRet_1",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ можно возвращать",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ItemsCodes"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
},
"example" : "Ошибка"
}
}
}
}
}
},
"/base64/checksell" : {
"post" : {
"tags" : [ "Проверка продажи" ],
"summary" : "Проверка доступности КИЗ в формате base64 для продажи",
"description" : "Если КИЗ доступен для продажи, ответ будет списком кодов товаров. Иначе будет возвращено описание ошибки",
"operationId" : "postMark",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ доступен",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ItemsCodes"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
},
"/checksell" : {
"post" : {
"tags" : [ "Проверка продажи" ],
"summary" : "Проверка доступности КИЗ для продажи",
"description" : "Если КИЗ доступен для продажи, ответ будет списком кодов товаров. Иначе будет возвращено описание ошибки",
"operationId" : "postMark_1",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ доступен для продажи",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ItemsCodes"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
},
"/base64/return" : {
"post" : {
"tags" : [ "Возврат" ],
"summary" : "Возврат КИЗ в формате base64 (проверка и изменение статуса)",
"description" : "Если КИЗ доступен для возврата, ответ будет пустым. Иначе будет возвращено описание ошибки",
"operationId" : "postRet_2",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ возвращён",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
},
"/return" : {
"post" : {
"tags" : [ "Возврат" ],
"summary" : "Возврат КИЗ (проверка и изменение статуса)",
"description" : "Если КИЗ доступен для возврата, ответ будет пустым. Иначе будет возвращено описание ошибки",
"operationId" : "postRet_3",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ возвращён",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
},
"/base64/sell" : {
"post" : {
"tags" : [ "Продажа" ],
"summary" : "Продажа КИЗ в формате base64 (проверка и изменение статуса)",
"description" : "Если КИЗ ещё не продан, его статус будет изменён и вернётся пустой ответ.",
"operationId" : "postSell",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ продан",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
},
"/sell" : {
"post" : {
"tags" : [ "Продажа" ],
"summary" : "Продажа КИЗ (проверка и изменение статуса)",
"description" : "Если КИЗ ещё не продан, его статус будет изменён и вернётся пустой ответ.",
"operationId" : "postSell_1",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/WebReceipt"
}
}
}
},
"responses" : {
"200" : {
"description" : "КИЗ продан",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"409" : {
"description" : "Ошибка (с описанием)",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
},
"500" : {
"description" : "Внутренняя ошибка сервера",
"content" : {
"text/plain(UTF-8)" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
}
},
"components" : {
"schemas" : {
"WebReceiptItem" : {
"required" : [ "item", "mark" ],
"type" : "object",
"properties" : {
"item" : {
"$ref" : "#/components/schemas/WebItem"
},
"mark" : {
"type" : "string",
"description" : "КИЗ"
}
},
"description" : "Позиция чека"
},
"WebItem" : {
"required" : [ "sku" ],
"type" : "object",
"properties" : {
"sku" : {
"type" : "string",
"description" : "Артикул"
},
"barcode" : {
"type" : "string",
"description" : "Штрихкод"
}
},
"description" : "Товар"
},
"SeqString" : {
"required" : [ "traversableAgain" ],
"type" : "array",
"properties" : {
"traversableAgain" : {
"type" : "boolean"
},
"empty" : {
"type" : "boolean"
}
},
"description" : "Список товаров",
"items" : {
"type" : "string",
"description" : "Список товаров"
}
},
"ItemsCodes" : {
"required" : [ "list" ],
"type" : "object",
"properties" : {
"list" : {
"required" : [ "traversableAgain" ],
"type" : "array",
"properties" : {
"traversableAgain" : {
"type" : "boolean"
},
"empty" : {
"type" : "boolean"
}
},
"description" : "Список товаров",
"items" : {
"type" : "string",
"description" : "Список товаров"
}
}
},
"description" : "Коды товаров"
},
"WebReceipt" : {
"required" : [ "items", "receiptId", "storeId" ],
"type" : "object",
"properties" : {
"storeId" : {
"type" : "integer",
"description" : "Идентификатор магазина",
"format" : "int64"
},
"receiptId" : {
"type" : "string",
"description" : "Номер чека"
},
"items" : {
"required" : [ "traversableAgain" ],
"type" : "array",
"properties" : {
"traversableAgain" : {
"type" : "boolean"
},
"empty" : {
"type" : "boolean"
}
},
"description" : "Список позиций чека, содержащих КИЗ",
"items" : {
"$ref" : "#/components/schemas/WebReceiptItem"
}
}
},
"description" : "Чек"
}
}
}
}
|