{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "ekonomi.virtualrestaurants.se", "description": "The API for https://www.ekonomi.virtualrestaurants.se/", "contact": { "name": "ScriptSector AB" } }, "host": "www.ekonomi.virtualrestaurants.se", "basePath": "/api", "schemes": [ "https" ], "securityDefinitions": { "Bearer": { "type": "apiKey", "name": "Authorization", "in": "header", "description": "Enter your bearer token in the format **Bearer **" } }, "security": [ { "Bearer": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "paths": { "/authenticate": { "post": { "description": "Validates if the customer login is correct.", "operationId": "authenticate", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "formData", "description": "The users customerNumber", "required": true, "type": "string" }, { "name": "password", "in": "formData", "description": "The users password", "required": true, "type": "string" } ], "responses": { "200": { "description": "authenticate response", "schema": { "type": "object", "properties": { "authenticated": { "type": "boolean" } } } } } } }, "/set-expo-push-token": { "post": { "description": "Set the active expo push token for the customer.", "operationId": "setExpoPushToken", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "formData", "description": "The users customerNumber", "required": true, "type": "string" }, { "name": "token", "in": "formData", "description": "The expo push token", "required": true, "type": "string" } ], "responses": { "200": { "description": "setExpoPushToken response", "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } } } } } }, "/get-settings": { "get": { "description": "Returns global settings.", "operationId": "getSettings", "produces": [ "application/json" ], "parameters": [], "responses": { "200": { "description": "getSettings response", "schema": { "type": "object", "properties": { "globalBannerText": { "type": "string" } } } } } } }, "/get-portal-messages": { "get": { "description": "Returns all the active portal messages.", "operationId": "getPortalmessages", "produces": [ "application/json" ], "parameters": [], "responses": { "200": { "description": "getPortalmessages response", "schema": { "type": "array", "items": { "$ref": "#/definitions/PortalMessage" } } } } } }, "/get-customer": { "get": { "description": "Return data for a customer.", "operationId": "getCustomer", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "format": "string" } ], "responses": { "200": { "description": "getCustomer response", "schema": { "$ref": "#/definitions/Customer" } } } } }, "/get-quality-controls": { "get": { "description": "Returns all the customers quality controls.", "operationId": "getQualityControls", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "format": "string" } ], "responses": { "200": { "description": "getQualityControls response", "schema": { "type": "array", "items": { "$ref": "#/definitions/QualityControl" } } } } } }, "/submit-quality-control": { "post": { "description": "Submits a quality control.", "operationId": "submitQualityControl", "produces": [ "application/json" ], "parameters": [ { "name": "quality_control_id", "in": "formData", "description": "The quality control ID", "required": true, "format": "integer" }, { "name": "image", "in": "formData", "description": "The image to upload", "required": true, "format": "array" } ], "responses": { "200": { "description": "submitQualityControl response", "schema": { "type": "array", "items": {} } } } } }, "/get-concepts": { "get": { "description": "Returns all the concepts.", "operationId": "getConcepts", "produces": [ "application/json" ], "parameters": [], "responses": { "200": { "description": "getConcepts response", "schema": { "type": "array", "items": { "$ref": "#/definitions/Concept" } } } } } }, "/get-invoices": { "get": { "description": "Returns all the invoices connected to a customer.", "operationId": "getInvoices", "produces": [ "application/json" ], "parameters": [ { "name": "isSent", "in": "query", "description": "Whether or not to fetch send invoices.", "required": true, "type": "integer", "format": "int32" }, { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" } ], "responses": { "200": { "description": "getInvoices response", "schema": { "type": "array", "items": { "$ref": "#/definitions/Invoice" } } } } } }, "/get-customer-orders": { "get": { "description": "Returns all the orders connected to a customer.", "operationId": "getCustomerOrders", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" } ], "responses": { "200": { "description": "getCustomerOrders response", "schema": { "type": "array", "items": { "$ref": "#/definitions/Order" } } } } } }, "/get-products-v2": { "get": { "descriptions": "Returns all products.", "operationId": "getProductsV2", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" } ], "responses": { "200": { "description": "getProductsV2 response", "schema": { "type": "array", "items": { "$ref": "#/definitions/SimpleProductV2" } } } } } }, "/get-products": { "get": { "description": "Returns all products.", "operationId": "getProducts", "produces": [ "application/json" ], "parameters": [ { "name": "lastUpdate", "in": "query", "description": "Datetime for last update.", "required": false, "type": "string" } ], "responses": { "200": { "description": "getProducts response", "schema": { "type": "array", "items": { "$ref": "#/definitions/SimpleProduct" } } } } } }, "/get-pricelist": { "get": { "description": "", "operationId": "getPricelist", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" } ], "responses": { "200": { "description": "getPricelist response", "schema": { "type": "array", "items": { "$ref": "#/definitions/PriceList" } } } } } }, "/get-lessons": { "get": { "description": "", "operationId": "getLessons", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" } ], "responses": { "200": { "description": "getLessons response", "schema": { "type": "array", "items": { "$ref": "#/definitions/Lesson" } } } } } }, "/set-video-done": { "post": { "description": "Mark a video as watched.", "operationId": "setVideoDone", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "formData", "description": "The users customerNumber", "required": true, "type": "string" }, { "name": "videoID", "in": "formData", "description": "The ID of the video.", "required": true, "type": "integer" } ], "responses": { "200": { "description": "setVideoDone response", "schema": { "type": "array", "items": {} } } } } }, "/create-order": { "post": { "description": "Create a new order.", "operationId": "createOrder", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "formData", "description": "The users customerNumber", "required": true, "type": "string" }, { "name": "orderItems", "in": "formData", "description": "JSON string containing an array of CreateOrderItem models.", "required": true, "type": "string" } ], "responses": { "200": { "description": "getPricelist response", "schema": { "type": "array", "items": {} } } } } }, "/concept-interest-alert": { "get": { "description": "Creates a concept intreset alert.", "operationId": "conceptIntrestAlert", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" }, { "name": "concept", "in": "query", "description": "The concept system code.", "required": true, "type": "string" } ], "responses": { "200": { "description": "conceptIntrestAlert response", "schema": { "type": "array", "items": {} } } } } }, "/platform-interest-alert": { "get": { "description": "Creates a platform intreset alert.", "operationId": "platformIntrestAlert", "produces": [ "application/json" ], "parameters": [ { "name": "customerNumber", "in": "query", "description": "The users customerNumber", "required": true, "type": "string" }, { "name": "platform", "in": "query", "description": "The platform system code.", "required": true, "type": "string" } ], "responses": { "200": { "description": "platformIntrestAlert response", "schema": { "type": "array", "items": {} } } } } } }, "definitions": { "LessonVideo": { "type": "object", "properties": { "id": { "type": "integer" }, "list_order": { "type": "integer" }, "title": { "type": "string" }, "description": { "type": "integer" }, "image": { "type": "string" }, "filename": { "type": "string" }, "watched": { "type": "boolean" }, "video_length": { "type": "integer" }, "video_length_pretty": { "type": "string" } } }, "Lesson": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "description": { "type": "string" }, "image": { "type": "string" }, "videos": { "type": "array", "items": { "$ref": "#/definitions/LessonVideo" } } } }, "PriceList": { "type": "object", "properties": { "price": { "type": "number" }, "minQuantity": { "type": "number" }, "isVisible": { "type": "integer" }, "articleNumber": { "type": "string" }, "customerNumber": { "type": "string" } } }, "SimpleProductV2": { "type": "object", "properties": { "id": { "type": "integer" }, "title": { "type": "string" }, "description": { "type": "string" }, "stock": { "type": "integer" }, "stockStatus": { "type": "integer", "enum": [0, 1, 2], "description": "0 = Aktiv, 1 = Kommer snart, 2 = Utgått från sortimentet" }, "unit": { "type": "string" }, "VATRate": { "type": "integer" }, "price": { "type": "number" }, "minQuantity": { "type": "integer" }, "image": { "type": "string" } } }, "QualityControl": { "type": "object", "properties": { "id": { "type": "integer" }, "customer_id": { "type": "integer" }, "account_id": { "type": "integer" }, "status": { "type": "integer" }, "title": { "type": "string" }, "instructions": { "type": "string" }, "image": { "type": "string" }, "created_at": { "type": "string" } } }, "SimpleProduct": { "type": "object", "properties": { "id": { "type": "integer" }, "articleNumber": { "type": "string" }, "title": { "type": "string" }, "stock": { "type": "integer" }, "stockStatus": { "type": "integer" }, "lastUpdate": { "type": "string" }, "image": { "type": "string" }, "description": { "type": "string" }, "unit": { "type": "string" }, "listOrder": { "type": "integer" }, "isDeleted": { "type": "integer" } } }, "Order": { "type": "object", "properties": { "id": { "type": "integer" }, "orderKey": { "type": "string" }, "timeCreated": { "type": "string" }, "customerID": { "type": "integer" }, "customerNumber": { "type": "string" }, "customerFullName": { "type": "string" }, "customerUnit": { "type": "string" }, "isCancelled": { "type": "integer" }, "isDelivered": { "type": "integer" }, "isSentToFortnox": { "type": "integer" }, "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "articleNumber": { "type": "string" }, "title": { "type": "string" }, "quantity": { "type": "integer" }, "price": { "type": "number" }, "unit": { "type": "string" }, "VATRate": { "type": "number" } } } } } }, "CreateOrderItem": { "type": "object", "properties": { "articleNumber": { "type": "string" }, "quantity": { "type": "integer" } } }, "Concept": { "type": "object", "properties": { "id": { "type": "string" }, "system_code": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "image": { "type": "string" }, "banner": { "type": "string" }, "partner_id_column": { "type": "string" }, "menu": { "type": "array", "items": { "type": "object", "properties": { "category_id": { "type": "string" }, "category_title": { "type": "string" }, "item": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "kcal": { "type": "string" } } } } } } } } }, "Customer": { "type": "object", "properties": { "uid": { "type": "integer" }, "customerNumber": { "type": "integer" }, "fullName": { "type": "string" }, "orgNr": { "type": "string" }, "streetRow1": { "type": "string" }, "streetRow2": { "type": "string" }, "zipCode": { "type": "string" }, "city": { "type": "string" }, "vatNumber": { "type": "string" }, "phone": { "type": "string" }, "cellphone": { "type": "string" }, "email": { "type": "string" }, "unit": { "type": "string" }, "feePercent": { "type": "string" }, "bic": { "type": "string" }, "iban": { "type": "string" } } }, "PortalMessage": { "type": "object", "properties": { "id": { "type": "integer" }, "text": { "type": "string" }, "createdAt": { "type": "string" } } }, "Invoice": { "type": "object", "properties": { "uid": { "type": "integer" }, "invoiceID": { "type": "integer" }, "customerID": { "type": "integer" }, "createdAt": { "type": "string" }, "approvedAt": { "type": "string" }, "sentAt": { "type": "string" }, "isSent": { "type": "integer" }, "amount": { "type": "number" }, "invoiceURL": { "type": "string" }, "publicURL": { "type": "string" } } } } }