{"paths":{"/api/v1/settings":{"get":{"summary":"Fetches the settings for the authenticated device.","description":"Each device has settings. Includes language settings.","parameters":[],"responses":{"200":{"description":"The given cabinet device settings.","schema":{"type":"object","properties":{"id":{"type":"string","description":"Device code of the device that settings were fetched for."},"owner":{"type":"string","description":"Name of the owner tenant. Usually the company which owns the cabinet."}},"example":{"id":"<device code>","language":"fi","owner":"fazer"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["settings"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates settings for the selected cabinets.","parameters":[{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of","required":true},{"name":"body","in":"body","description":"The settings to be created.","required":true,"schema":{"example":{"selectedCabinets":[{"deviceCode":"123","id":"123","locationId":"hotel"},{"deviceCode":"456","id":"456","locationId":"airport"}],"settingType":"refillRule","settings":[{"key":"detectTagQuality","value":"true"},{"key":"ignoreBadTags","value":"true"},{"key":"acceptablePercentageOfBadTags","value":"33"},{"key":"chargeUnreplenishedTags","value":"false"},{"key":"chargeSoldTags","value":"true"}]}}}],"responses":{"201":{"description":"Settings created successfully.","schema":{"example":[{"cabinetId":"123","status":"success","updatedSettings":{"owner":"Selfly Demo","digitwin":"true","adaptation":"ipa-cabinet","detectTagQuality":"true","ignoreBadTags":"true","block_cabinet_when_product_expired":"true","payment":"demo","chargeUnreplenishedTags":"false","chargeSoldTags":"true","acceptablePercentageOfBadTags":"33"}},{"cabinetId":"456","status":"success","updatedSettings":{"owner":"Selfly Demo","digitwin":"true","adaptation":"ipa-cabinet","detectTagQuality":"true","ignoreBadTags":"true","block_cabinet_when_product_expired":"true","payment":"demo","chargeUnreplenishedTags":"false","chargeSoldTags":"true","acceptablePercentageOfBadTags":"33"}}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"description":"Creates a new resource with data.","tags":["settings"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/settings/{id}":{"get":{"summary":"Fetches the settings for the given cabinet by ID.","description":"Each device has settings. Includes language settings.","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Target cabinet's device code","required":true}],"responses":{"200":{"description":"The given cabinet device settings.","schema":{"type":"object","properties":{"id":{"type":"string","description":"Device code of the device that settings were fetched for."},"owner":{"type":"string","description":"Name of the owner tenant. Usually the company which owns the cabinet."}},"example":{"id":"<device code>","language":"fi","owner":"fazer"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["settings"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/products":{"get":{"summary":"Fetches available products for the device or the user.","description":"\nBased on authentication realm it fetches the products either for the logged in user by user's tenant or for cabinet device based on device ID from the Device token.\nIt fetches device ID from Authorization: `Device xxxxx` header for device, or User tenant from `groups` property in `Authorization Bearer xxxx` header.\n","parameters":[{"in":"query","name":"locationId","type":"string","description":"Optional argument to provide if user requires to set location price as a `price` and `currency` to the product.","required":false},{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"name":"skip","in":"query","type":"number","description":"Optional argument to skip the specified number of documents.","required":false}],"responses":{"200":{"description":"\n        The list of products for the requested device or user. \n        \n        The status value can be:\n        - `1` as `Draft` which mean the product is created but is not in use,\n        - `2` as `Active` which means it can be used by users \n        - `3` as `Retired` which means it is kept in the system, but cannot be used.\n\n        If the location price value for one of the location prices is not available, the location price of the first ancestor of that location which has a price record will replace it.\n        If no location price found for any of the ancestors of a location, the default price will be used.\n        ","schema":{"type":"object","properties":{"barcode":{"type":"string","description":"Unique barcode of the product."},"barcodeType":{"type":"string","description":"The type of barcode."},"id":{"type":"uuid","description":"Id of a product"},"price":{"type":"number","description":"Price for one item."},"currency":{"type":"string","description":"Currency character to display next to the price."},"name":{"type":"string","description":"Name of the product to display on screen."},"status":{"type":"number","description":"The life cycle status of the product"},"isPrebooked":{"type":"boolean","description":"Whether pre-booking a product is possible"},"isFrozen":{"type":"boolean","description":"Whether a product is frozen (no attribute or isFrozen: true),"},"supplier":{"type":"object","description":"Contains supplier information for the product"},"supplierId":{"type":"string","description":"Supplier Id to identify supplier"},"imageUrl":{"type":"string","description":"URL of the image for product."},"productType":{"type":"string","description":"The type of product packaging"},"owners":{"type":"array","description":"Array of owner company of the product."},"timeToLiveDays":{"type":"number","description":"The number of days that product can last after encoding its tag."},"prices":{"type":"array","description":"All available prices for the product in all locations."},"vatCategoryId":{"type":"string","description":"The ID of the associated VAT category"},"metadata":{"type":"object","description":"A JSON object for product metadata"},"productClass":{"type":"array","description":"Array of ids for the product classes"},"labels":{"type":"array","description":"List of labels associated with the product"},"tagSensitivity":{"type":"number","description":"A value of tag sensitivity. Accepted values are -1, 0, 20, 40, 60, 80, 100"},"enableSurcharge":{"type":"boolean","description":"Whether a product has any surcharge(s) in the price list"},"badge":{"type":"array","description":"Dietary and certification badges"},"allergy":{"type":"array","description":"Allergen information"},"nutrition":{"type":"object","description":"Nutritional information","properties":{"fat":{"type":"number","description":"Fat content"},"salt":{"type":"number","description":"Salt content"},"carbs":{"type":"number","description":"Carbohydrate content"},"sugar":{"type":"number","description":"Sugar content"},"protein":{"type":"number","description":"Protein content"},"calories":{"type":"number","description":"Calorie content"},"amountType":{"type":"string","description":"Measurement basis (per100g, per100ml, perServing)"},"saturatedFat":{"type":"number","description":"Saturated fat content"}}},"ingredients":{"type":"array","description":"List of product ingredients"},"servingSize":{"type":"object","description":"Standard serving size","properties":{"unit":{"type":"string","description":"Unit of measurement"},"value":{"type":"number","description":"Numeric value"}}},"translations":{"type":"object","description":"Translations for product name and ingredients in different languages","additionalProperties":{"type":"object","properties":{"name":{"type":"string","description":"Translated product name"},"ingredients":{"type":"array","items":{"type":"string"},"description":"Translated ingredients list"}}}}},"example":[{"barcode":"0000000003001","barcodeType":"EAN-13","id":"f9ee7f69-8547-409e-b7ac-519540ce19be","price":1.99,"currency":"€","name":"Ice cream","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411401042317_0.png","productType":"G5A_PlasticCupWithPlasticLid","owners":["Selfly"],"timeToLiveDays":3,"prices":[{"id":"1","price":1.99,"locationId":null,"currency":"€","metadata":{},"surcharges":[{"id":"8ddfb048-7b40-4c71-8c38-152fa02445f5","valueType":1,"surchargeType":1,"value":22,"name":"stateTax","appliedOn":"all","order":1}]},{"id":"2","price":2.55,"locationId":"Airport","currency":"€","metadata":{}}],"status":2,"supplier":{"id":"0b08cbe6-8977-44e6-8420-803c745d67d6","name":"TestSupplier1","description":"Test Supplier","organization_Id":"Selfly","payloadJson":null,"status":1},"supplierId":"143ea037-7067-4d64-876c-cb7af663d216","isPrebooked":true,"isFrozen":true,"vatCategory":{"id":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","name":"Finland Category 1","taxValue":24},"metadata":{},"productClass":[1,105,1356],"labels":["Frozen","Ice Cream"],"tagSensitivity":0,"enableSurcharge":true,"badge":["halal","glutenFree"],"allergy":["milk","soy"],"nutrition":{"fat":12.5,"salt":0.8,"carbs":45.2,"sugar":8.3,"protein":6.1,"calories":285,"amountType":"per100g","saturatedFat":7.2},"ingredients":["milk","sugar","cocoa butter"],"servingSize":{"unit":"g","value":50},"translations":{"en":{"name":"Ice cream","ingredients":["milk","sugar","cocoa butter"]},"nl":{"name":"IJs","ingredients":["melk","suiker","cacaoboter"]}}},{"barcode":"6050005558888","barcodeType":"EAN-13","price":1.75,"id":"6985665a-0be2-48c7-b572-75cda86dbf1b","currency":"€","name":"FAZER Puikula 500g 9kpl Täysjyväruis","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411402202208_0.png","productType":"G1-CartonPackageWithDryFood","owners":["Selfly"],"timeToLiveDays":5,"prices":[{"id":"1","price":1.75,"locationId":null,"currency":"€","metadata":{}},{"id":"2","price":2.25,"locationId":"Airport","currency":"€","metadata":{}}],"status":2,"supplier":{"id":"4fe39147-f951-40a8-888c-b50d326f26f9","name":"Mali Tea supplier","description":"Green leaves tea","organization_Id":"Selfly","payloadJson":null,"status":1},"supplierId":"4fe39147-f951-40a8-888c-b50d326f26f9","isPrebooked":false,"vatCategory":{"id":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","name":"Finland Category 1","taxValue":24},"metadata":{},"productClass":[0,0,0],"labels":["Snack"],"tagSensitivity":-1,"enableSurcharge":false},{"barcode":"6050005558887","barcodeType":"EAN-13","price":4.65,"id":"5584b85a-0be2-48c7-b572-75cda86dbf1b","currency":"€","name":"FAZER Runebergintorttu 2 kpl 208g leivos","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411402672803_0.png","productType":"G1-CartonPackageWithDryFood","owners":["Selfly"],"prices":[{"id":"1","price":4.65,"locationId":null,"currency":"€","metadata":{}},{"id":"2","price":5.56,"locationId":"Airport","currency":"€","metadata":{}}],"status":2,"supplier":{"id":"6j989147-f951-40a8-123-b50d0ocd26f9","name":"Indian spice supplier","description":"Saffron main supplier","organization_Id":"Selfly","payloadJson":null,"status":1},"supplierId":"6j989147-f951-40a8-123-b50d0ocd26f9","isPrebooked":false,"vatCategory":{"id":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","name":"Finland Category 1","taxValue":24},"metadata":{},"productClass":[4,122,2354],"enableSurcharge":false},{"barcode":"6050005558886","barcodeType":"EAN-13","price":2.45,"id":"8922345a-0be2-48c7-b572-75cda86dbf1b","currency":"€","name":"Fazer Taloussuklaa 200g tumma suklaa","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411401015168_0.png","productType":"G1-CartonPackageWithDryFood","owners":["Selfly"],"prices":[{"id":"1","price":2.45,"locationId":null,"currency":"€","metadata":{}},{"id":"2","price":3.5,"locationId":"Airport","currency":"€","metadata":{}}],"status":2,"supplier":{"id":"90jec147-f951-40a8-123-b50d0ocdIN66","name":"Thailand rice supplier","description":"Main Asian supplier of rice products","organization_Id":"Selfly","payloadJson":null,"status":1},"supplierId":"90jec147-f951-40a8-123-b50d0ocdIN66","isPrebooked":true,"vatCategory":{"id":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","name":"Finland Category 1","taxValue":24},"metadata":{},"productClass":[1,101,1001],"enableSurcharge":false}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["products"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates new product with the default price.","description":"\nCreates new product based on the given `barcode`. Barcode needs to be a unique database value. If the product with this `barcode` already exists, the BadRequest (400) is returned. The body is validated, if the data is not valid, the BedRequest (400) is returned with the explanation of the error.\n\nIf the barcode type is something other than EAN-13, the beginning of the barcode of the product needs to have zeros added to it so that the barcode will be 13 digits long.\n\nThe price is set as default price for the product with price with location id `null`.\n\n`description` and `imageUrl` are optional arguments.\n    ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"name":"body","in":"body","description":"The new product data.","required":true,"schema":{"example":{"barcode":"0000000003001","barcodeType":"EAN-13","name":"Ice creamr","description":"Ice cream 250g.","price":3.25,"currency":"€","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411401042317_0.png","productType":"G5A_PlasticCupWithPlasticLid","timeToLiveDays":7,"locationPricings":[{"locationId":"Test","price":1,"currency":"€","surcharges":[{"id":"surchargeId2","order":1},{"id":"surchargeId3","order":2}]}],"supplierId":"09KUR45D-f951-40a8-208-b50d0ocdINtr","isFrozen":true,"vatCategoryId":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","metadata":{},"productClass":[1,101,1024],"tagSensitivity":-1,"badge":["kosher","vegan"],"allergy":["nuts","gluten"],"nutrition":{"fat":8.2,"salt":0.3,"carbs":52.1,"sugar":25.8,"protein":4.5,"calories":310,"amountType":"per100g","saturatedFat":3.1},"ingredients":["sugar","cocoa","hazelnuts","soy lecithin"],"servingSize":{"unit":"g","value":30},"translations":{"en":{"name":"New Product","ingredients":["sugar","cocoa","hazelnuts","soy lecithin"]},"nl":{"name":"Nieuw Product","ingredients":["suiker","cacao","hazelnoten","soja lecithine"]}}}}}],"responses":{"201":{"description":"Product was created successfully.","schema":{"example":[{"id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","barcode":"0000000003001","barcodeType":"EAN-13","name":"Ice creamr","description":"Ice cream 250g.","price":3.25,"currency":"€","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411401042317_0.png","productType":"G5A_PlasticCupWithPlasticLid","timeToLiveDays":7,"prices":[{"id":"0178add4-d208-4d8e-9449-6227575165d9","locationId":null,"price":3.25,"currency":"€","product_Id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","metadata":{},"surcharges":[{"id":"8ddfb048-7b40-4c71-8c38-152fa02445f5","valueType":1,"surchargeType":1,"value":22,"name":"stateTax","appliedOn":"all","order":1}]},{"id":"011c91e1-5c03-4a30-a25b-c610349d0963","locationId":"Test","price":1,"currency":"€","product_Id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","metadata":{}}],"status":2,"supplier":{"id":"09KUR45D-f951-40a8-208-b50d0ocdINtr","name":"Pizza supplier","description":"Main supplier of pizza and other Italian foods.","organization_Id":"Selfly Demo","payloadJson":null,"status":1},"supplierId":"09KUR45D-f951-40a8-208-b50d0ocdINtr","isPrebooked":true,"isFrozen":true,"owner":["Selfly Demo"],"vatCategoryId":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","metadata":{},"productClass":[1,101,1024],"tagSensitivity":-1,"enableSurcharge":true,"badge":["kosher","vegan"],"allergy":["nuts","gluten"],"nutrition":{"fat":8.2,"salt":0.3,"carbs":52.1,"sugar":25.8,"protein":4.5,"calories":310,"amountType":"per100g","saturatedFat":3.1},"ingredients":["sugar","cocoa","hazelnuts","soy lecithin"],"servingSize":{"unit":"g","value":30},"translations":{"en":{"name":"New Product","ingredients":["sugar","cocoa","hazelnuts","soy lecithin"]},"nl":{"name":"Nieuw Product","ingredients":["suiker","cacao","hazelnoten","soja lecithine"]}}}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["products"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/products/{id}":{"get":{"summary":"Fetches a single product based on its barcode","description":"\nIt fetches the products for the logged in user by user's tenant.\nIt fetches user tenant from `groups` property in `Authorization Bearer xxxx` header.\n","parameters":[{"name":"barcode","in":"path","type":"string","description":"Barcode of the product","required":true},{"name":"group","in":"query","type":"string","description":"The group for which the product is saved in database","required":false}],"responses":{"200":{"description":"An object containing products information\n        The status value can be:\n        - `1` as `Draft` which mean the product is created but is not in use,\n        - `2` as `Active` which means it can be used by users \n        - `3` as `Retired` which means it is kept in the system, but cannot be used.\n        \n        If the location price value for one of the location prices is not available, the location price of the first ancestor of that location which has a price record will replace it.\n        If no location price found for any of the ancestors of a location, the default price will be used.\n\n        ","schema":{"type":"object","properties":{"id":{"type":"uuid","description":"Id of the product"},"barcode":{"type":"string","description":"Unique barcode of the product."},"barcodeType":{"type":"string","description":"The type of barcode."},"price":{"type":"number","description":"Price for one item."},"currency":{"type":"string","description":"Currency character to display next to the price."},"name":{"type":"string","description":"Name of the product to display on screen."},"status":{"type":"number","description":"The life cycle status of the product"},"isPrebooked":{"type":"boolean","description":"Whether pre-booking a product is possible"},"isFrozen":{"type":"boolean","description":"Whether a product is frozen (no attribute or isFrozen: true),"},"supplier":{"type":"object","description":"Contains supplier information for the product"},"supplierId":{"type":"string","description":"Supplier Id to identify supplier"},"imageUrl":{"type":"string","description":"URL of the image for product."},"productType":{"type":"string","description":"The type of product packaging"},"owners":{"type":"array","description":"Array of owner company of the product."},"timeToLiveDays":{"type":"number","description":"The number of days that product can last after encoding its tag."},"prices":{"type":"array","description":"All available prices for the product in all locations."},"vatCategoryId":{"type":"string","description":"The ID of the associated VAT category"},"metadata":{"type":"object","description":"A JSON object for product metadata"},"productClass":{"type":"array","description":"Array of ids for the product classes"},"labels":{"type":"array","description":"List of labels associated with the product"},"tagSensitivity":{"type":"number","description":"A value of tag sensitivity. Accepted values are -1, 0, 20, 40, 60, 80, 100"},"enableSurcharge":{"type":"boolean","description":"Whether a product has any surcharge(s) in the price list"},"badge":{"type":"array","description":"Dietary and certification badges"},"allergy":{"type":"array","description":"Allergen information"},"nutrition":{"type":"object","description":"Nutritional information","properties":{"fat":{"type":"number","description":"Fat content"},"salt":{"type":"number","description":"Salt content"},"carbs":{"type":"number","description":"Carbohydrate content"},"sugar":{"type":"number","description":"Sugar content"},"protein":{"type":"number","description":"Protein content"},"calories":{"type":"number","description":"Calorie content"},"amountType":{"type":"string","description":"Measurement basis (per100g, per100ml, perServing)"},"saturatedFat":{"type":"number","description":"Saturated fat content"}}},"ingredients":{"type":"array","description":"List of product ingredients"},"servingSize":{"type":"object","description":"Standard serving size","properties":{"unit":{"type":"string","description":"Unit of measurement"},"value":{"type":"number","description":"Numeric value"}}},"translations":{"type":"object","description":"Translations for product name and ingredients in different languages","additionalProperties":{"type":"object","properties":{"name":{"type":"string","description":"Translated product name"},"ingredients":{"type":"array","items":{"type":"string"},"description":"Translated ingredients list"}}}}},"example":{"barcode":"6050005558889","barcodeType":"EAN-13","id":"8922345a-0be2-48c7-b572-75cda86dbf1b","price":5.69,"currency":"€","name":"Fazer Vihreitä kuulia 500g","imageUrl":"https://foodieimages.s3.amazonaws.com/images/entries/180x220/6411401042317_0.png","productType":"G1-CartonPackageWithDryFood","owners":["Selfly"],"timeToLiveDays":3,"prices":[{"id":"1","price":5.69,"locationId":null,"currency":"€","metadata":{},"surcharges":[{"id":"8ddfb048-7b40-4c71-8c38-152fa02445f5","valueType":1,"surchargeType":1,"value":22,"name":"stateTax","appliedOn":"all","order":1}]},{"id":"2","price":6.63,"locationId":"Airport","currency":"€","metadata":{}}],"status":2,"supplier":{"id":"90jec147-f951-40a8-123-b50d0ocdIN66","name":"Thailand rice supplier","description":"Main Asian supplier of rice products","organization_Id":"Selfly","payloadJson":null,"status":1},"supplierId":"90jec147-f951-40a8-123-b50d0ocdIN66","isPrebooked":false,"vatCategory":{"id":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","name":"Finland Category 1","taxValue":24},"metadata":{},"productClass":[2,135,1073],"tagSensitivity":80,"enableSurcharge":true,"badge":["kosher","vegan"],"allergy":["nuts","gluten"],"nutrition":{"fat":8.2,"salt":0.3,"carbs":52.1,"sugar":25.8,"protein":4.5,"calories":310,"amountType":"per100g","saturatedFat":3.1},"ingredients":["sugar","cocoa","hazelnuts","soy lecithin"],"servingSize":{"unit":"g","value":30},"translations":{"en":{"name":"Fazer Green Balls","ingredients":["sugar","cocoa","hazelnuts","soy lecithin"]},"fi":{"name":"Fazer Vihreitä kuulia","ingredients":["sokeri","kaakao","hasselpähkinät","soijalesitiini"]}}}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["products"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates the product with the given barcode. Also updates it's default price.","description":"Expects to receive the full object about the product and updates each field of it.","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"name":"body","in":"body","description":"The product data to update. \n        The status value can be:\n        - `1` as `Draft` which mean the product is created but is not in use,\n        - `2` as `Active` which means it can be used by users \n        - `3` as `Retired` which means it is kept in the system, but cannot be used.\n\n        If the location price value for one of the location prices is not available, the location price of the first ancestor of that location which has a price record will replace it.\n        If no location price found for any of the ancestors of a location, the default price will be used.\n        ","required":true,"schema":{"example":{"name":"Chocolate Bar","barcode":"8222222222226","barcodeType":"EAN-13","description":"Milk chocolate bar 250g.","price":3.25,"currency":"€","imageUrl":"https://cdn.com/image1.jpeg","timeToLiveDays":7,"locationPricings":[{"locationId":"Test","price":1,"currency":"€","surcharges":[{"id":"surchargeId3","order":3}]}],"status":2,"supplierId":"f792c6c-72a0-4aca-b603-3dc063b963ac","vatCategoryId":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","metadata":{},"productClass":[1,101,1024],"tagSensitivity":60,"badge":["lactoseFree","organic"],"allergy":["milk","soy"],"nutrition":{"fat":15.5,"salt":0.5,"carbs":48,"sugar":30,"protein":7.2,"calories":350,"amountType":"per100g","saturatedFat":9.5},"ingredients":["milk chocolate","sugar","cocoa butter","vanilla"],"servingSize":{"unit":"g","value":100},"translations":{"en":{"name":"Chocolate Bar","ingredients":["milk chocolate","sugar","cocoa butter","vanilla"]},"de":{"name":"Schokoladenriegel","ingredients":["Milchschokolade","Zucker","Kakaobutter","Vanille"]}}}}},{"name":"id","in":"path","description":"Barcode of the product, unique ID in the database.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Product was updated successfully.","schema":{"example":[{"barcode":"8222222222226","barcodeType":"EAN-13","name":"Chocolate Bar","description":"Milk chocolate bar 250g.","price":3.25,"currency":"€","imageUrl":"https://cdn.com/image1.jpeg","prices":[{"id":"0178add4-d208-4d8e-9449-6227575165d9","locationId":null,"price":3.25,"currency":"€","product_Id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","metadata":{},"surcharges":[{"id":"8ddfb048-7b40-4c71-8c38-152fa02445f5","valueType":1,"surchargeType":1,"value":22,"name":"stateTax","appliedOn":"all","order":1}]},{"id":"011c91e1-5c03-4a30-a25b-c610349d0963","locationId":"Test","price":1,"currency":"€","product_Id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","metadata":{}}],"supplier":{"id":"f792c6c-72a0-4aca-b603-3dc063b963ac","name":"Ice cream supplier","description":"General sweets supplier","organization_Id":"Selfly Demo","payloadJson":null,"status":1},"supplierId":"f792c6c-72a0-4aca-b603-3dc063b963ac","status":2,"isPrebooked":false,"vatCategory":{"id":"4e1b8e9a-f060-4a5e-88ca-5957e0d63a77","name":"Finland Category 1","taxValue":24},"metadata":{},"productClass":[1,101,1024],"tagSensitivity":60,"enableSurcharge":true,"badge":["lactoseFree","organic"],"allergy":["milk","soy"],"nutrition":{"fat":15.5,"salt":0.5,"carbs":48,"sugar":30,"protein":7.2,"calories":350,"amountType":"per100g","saturatedFat":9.5},"ingredients":["milk chocolate","sugar","cocoa butter","vanilla"],"servingSize":{"unit":"g","value":100},"translations":{"en":{"name":"Chocolate Bar","ingredients":["milk chocolate","sugar","cocoa butter","vanilla"]},"de":{"name":"Schokoladenriegel","ingredients":["Milchschokolade","Zucker","Kakaobutter","Vanille"]}}}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["products"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"patch":{"summary":"Patches the product status with the given barcode.","description":"\nExpects to receive the intended status of the product and products metadata.\nIf metadata is available in the body, it will be replaced the current metadata of the product. \n    ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"name":"body","in":"body","description":"The product data to update.\n        The status value can be:\n        - `1` as `Draft` which mean the product is created but is not in use,\n        - `2` as `Active` which means it can be used by users \n        - `3` as `Retired` which means it is kept in the system, but cannot be used.\n\n        If the location price value for one of the location prices is not available, the location price of the first ancestor of that location which has a price record will replace it.\n        If no location price found for any of the ancestors of a location, the default price will be used.\n        ","required":true,"schema":{"example":{"status":3,"metadata":{"source":"provider 1"}}}}],"responses":{"201":{"description":"Product status changed successfully.","schema":{"example":[{"barcode":"1234567890517","barcodeType":"EAN-13","currency":"€","id":"328af263-7d8c-483a-a174-2beed8593640","imageUrl":null,"name":"sandwich","owners":["Selfly Demo"],"price":7,"prices":[{"id":"12f1276f-7233-4647-aef4-de5cb1b77516","price":7,"currency":"€","locationId":null,"product_Id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","metadata":{},"surcharges":[{"id":"8ddfb048-7b40-4c71-8c38-152fa02445f5","valueType":1,"surchargeType":1,"value":22,"name":"stateTax","appliedOn":"all","order":1}]}],"productType":"G1-CartonPackageWithDryFood","status":3,"supplier":{"id":"f792c6c-72a0-4aca-b603-3dc063b963ac","name":"Salads supplier","description":"Main supplier of vegetables and legumes","organization_Id":"Selfly Demo","payloadJson":null,"status":1},"supplierId":"f792c6c-72a0-4aca-b603-3dc063b963ac","isPrebooked":true,"timeToLiveDays":2,"vatCategory":{"id":"c4ea4444-13e0-4a90-bf5a-ed0773611239","name":"Food","taxValue":10},"metadata":{"source":"provider 1"},"productClass":[1,101,1024],"enableSurcharge":true}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["products"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/supplier":{"get":{"summary":"Fetches available suppliers for the organization.","description":"Based on authentication realm it fetches the product suppliers based on the organization Id.","parameters":[{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of,usually organization name, which is same as Id","required":true}],"responses":{"200":{"description":"\n          The list of product suppliers for the required organization. \n          \n          The status value can be:\n          - `1` as `Active` which means the supplier is active, and being used,\n          - `2` as `Retired` which means the supplier is kept in the system, but not used\n          - `3` as `Deleted` which means the supplier has been deleted by organization.\n          ","schema":{"type":"object","properties":{"id":{"type":"uuid","description":"Id of supplier when created"},"name":{"type":"string","description":"Name of supplier."},"description":{"type":"string","description":"Description of supplier."},"oganization_Id":{"type":"string","description":"Foreign key in table displaying organization name, id."},"payloadJson":{"type":"string","description":"Payload type being retured"},"status":{"type":"number","description":"Status of supplier"}},"example":[{"id":"5984b85a-0be2-48c7-b572-75cda86dbf1b","name":"Demo supplier One","description":"Demo supplier one supplies product for the first month of the year.","organization_Id":"Selfly Demo","status":2,"payloadJson":null}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["supplier"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new supplier for the organization with the provided details.","description":"Name and description are required fields and must not be empty strings, Id is auto generated, while organization_Id is gotten from authentication, an initial status of 1 is set if not provided, payloadJson is initially null or as provided, name has max length of 50 while description 100. ","parameters":[{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of","required":true},{"name":"body","in":"body","description":"The new supplier data.","required":true,"schema":{"example":{"Id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","name":"Ice cream supplier tampere","description":"Milk and chocolate .","organization_Id":"Selfly Demo","payloadJson":null,"status":1}}}],"responses":{"201":{"description":"Supplier was created successfully.","schema":{"example":{"id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","name":"Ice cream supplier tampere ","description":"Milk and chocolate.","organization_Id":"Selfly Demo","payloadJson":null,"status":1}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["supplier"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/supplier/{id}":{"put":{"summary":"Updates the supplier information with the newly given data.","description":"Updates the product supplier name and description","parameters":[{"in":"query","name":"group","type":"string","description":"Argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will fail","required":false},{"name":"body","in":"body","description":"The supplier data to be updated.\n\n          name: must be provided and must not be an empty string.\n          description: can be an empty string.\n          payloadJson: is optional and can be null.\n          ","required":true,"schema":{"example":{"name":"Turkish supplier of olives","description":"Main turkish supplier of olive products"}}}],"responses":{"201":{"description":"Supplier information changed successfully.","schema":{"example":{"id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","name":"Turkish supplier of olives","description":"Main turkish supplier of olive products.","organization_Id":"Selfly Demo","payloadJson":null}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["supplier"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"patch":{"summary":"Patches the supplier status with the newly given status.","description":"Updates the product supplier status","parameters":[{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of","required":false},{"name":"body","in":"body","description":"The supplier status to update.\n            \n          The status value can be:\n          - `1` as `Active` which mean the supplier is active being used,\n          - `2` as `Retired` which means the supplier is kept in the system, but not used\n          - `3` as `Deleted` which means the supplier has been deleted by organization\n\n          ","required":true,"schema":{"example":{"status":3}}}],"responses":{"201":{"description":"Supplier status changed successfully.","schema":{"example":{"id":"b39a2c6c-72a0-4aca-b603-3dc063b963bd","name":"Ice cream supplier tampere ","description":"Milk and chocolate.","organization_Id":"Selfly Demo","payloadJson":null,"status":3}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["supplier"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/payment":{"post":{"summary":"Cabinet uses this method to report about payment from the user.","description":"\nWhen user makes purchase cabinet sends POST request with user purchases.\n\n*Notice! Payment system generates two separate events for payment: `started` and `canceled` according to user's action.*\n\n<br/>\n**Important notice for Mobile Pay: if two or more cabinets registered for the same `PosId` the `cabinetId` will be either of them, as Hemera is load balancing topics based on calls.**\n<br />\n\nThe `\"paymentOption\"` argument is optional. As digitwin can handle multiple payment options at the same time, the api data provides the optional property `\"paymentMethod\"`, if given, prefix the cmd argument for hemera with this.\nusually `\"nayax\"` payment option is always available for digitwin as nayax terminal is installed all (most) of the time.\n\n<br/>\n**Do not include `\"paymentMethod\"` to the body in order to use default QR code-enabled payment**\n    ","parameters":[{"name":"body","in":"body","description":"The purchases list of the user.","required":true,"schema":{"example":{"purchases":[{"barcode":6416453035133,"epc":"303587A114036E4000000001","name":"Fazer Bar","price":3,"currency":"€","image":"https://cdn.selflystore.com/cabinet-products-qa/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg","count":2,"isDiscounted":true,"discountAmount":25,"discountName":"New Year Special"}],"unchargedTags":[{"epc":"303614229C507E80FB263A1B","barcode":"6416453014923","price":1.5,"reason":"sold"}],"totalSum":6,"currency":"€","paymentOption":"nayax"}}}],"responses":{"201":{"description":"Purchase reported successfully to Cabinet payment system."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated. Only device can use this method with Device authentication."},"5XX":{"description":"Unexpected server error."}},"tags":["payment"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/payment/{id}":{"delete":{"summary":"Stops the transaction of the given cabinet.","description":"\nCabinet can call this API only to notify the cloud that the current purchase transaction was stopped by timeout or by some other reason.\n    ","parameters":[{"name":"id","in":"path","type":"string","description":"ID of the cabinet.","required":true}],"responses":{"201":{"description":"Purchase cancel reported successfully to Cabinet payment system."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated. Only device can use this method with Device authentication."},"5XX":{"description":"Unexpected server error."}},"tags":["payment"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/qrcode":{"get":{"summary":"Returns the URL need to be encoded into QR code based on the requesting cabinet payment system.","description":"\n  Payment system is resolved at the digi twin of the cabinet, QR code is generated according to the payment system. If no payment system is configured, BadRequest (400) is returned.\n          ","parameters":[],"responses":{"200":{"description":"Returns the QR code to activate Payment.","example":{"qrCode":"http://payment.com/XXXXXXXXX"}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["qrcode"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Receives post requests containing new QR code from digitwin and relays it to corresponding cabinet backend","description":"\n  Payment system is resolved at the digi twin of the cabinet. New QR code is generated according to the payment system and send to cabinet backend through socketIO to force update the QR code on the cabinet UI.\n  If no payment system is configured, BadRequest (400) is returned.\n          ","parameters":[{"name":"body","in":"body","description":"The QR code to be sent to cabinet backend","required":true,"schema":{"example":{"deviceCode":"5f977be8-6a68-4d9d-84d4-687b43b97667","qrCode":"http://payment.com/XXXXXXXXX"}}}],"responses":{"200":{"description":"Returns success code"},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["qrcode"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/__adhoc/mobilepayv10":{"post":{"summary":"Adhoc endpoint for Danske Bank Mobile Pay V10. Not to be used directly.","description":"\nDanske Bank Mobile Pay calls this POST method when user scans QR code related to Cabinet POS.  It has MerchantPosId, this method resolves deviceCode by PoSID and sends message to the designated cabinet that the user wants to purchase. Cabinet then unlocks the door and user starts purchase. \n\n*Note! This method is not to be used directly, only Danske Bank uses it*\n        ","responses":{"200":{"description":"User scanned QR code correctly. Returns same data as was sent to the method.","example":{"MerchantId":"622d3369-f940-4921-93eb-c8fca0c081b4","MerchantBrandId":"MPPOS12345","MerchantLocationId":"12345","MerchantPosId":"MobilePay Merchant Pos Id","PosId":"7e6acbde-345e-4641-b2f4-d8df0f3a5147"}},"400":{"description":"Error has happened, see error message for details."}},"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/__adhoc"}}],"tags":["__adhoc"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/__adhoc/mobilepay-v10-cancel":{"post":{"summary":"Adhoc endpoint for mobilepay cancel event.","description":"\nDigitwin call this method to cancel the payment event\n        ","responses":{"200":{"description":"User cancel the event","example":{"deviceCode":"5f977be8-6a68-4d9d-84d4-687b43b97667"}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"}},"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/__adhoc"}}],"tags":["__adhoc"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/command":{"post":{"summary":"Command can be sent to cabinet to execute certain action.","description":"\nCabinet listens for `command` `created` event, compares own ID to the given `deviceCode` and executes command.\n\n*Note, User need to be in the role `DeviceAdministrator` to execute commands.*\n      ","parameters":[{"name":"body","in":"body","description":"The command object containing cabinet ID","required":true,"schema":{"example":{"deviceCode":"XXXXXXXXXXXXXXXX","command":"reboot","params":{}}}}],"responses":{"201":{"description":"Command sent successfully to Cabinet."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"403":{"description":"Not authorized to execute commands."},"5XX":{"description":"Unexpected server error."}},"tags":["command"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/advertisements":{"get":{"summary":"Returns an array of media objects that cabinet should display on screen while in idling mode.","description":"\nEach cabinet has a screen that displays advertisement images on the screen while no one is purchasing. This endpoint returns a list of image URLs to be displayed on the screen.\n\nEach company owner of the cabinet has a separate folder in IPA CDN. The images are fetched based on the cabinet owner or a user group if a user is fetching for administration.\n\nNotice, if cabinet is deployed for the same owner in different countries, it needs to have only one owner in the settings. For instance if we have `Selfly-FI` and `Selfly-SE` customers, we need to upload for each of them separate images into CDN and assign cabinet one of them as owner. Folder structure in CDN is flat, no suborders are allowed for owner.\n            ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"Returns an array of media objects.","schema":{"type":"object","properties":{"url":{"type":"url","description":"URL of an advertisement image"},"id":{"type":"uuid","description":"advertisement id"},"activationDate":{"type":"date-time","description":"The date-time when advertisement gets activated"},"deactivationDate":{"type":"date-time","description":"The date-time when advertisement gets deactivated"},"cabinets":{"type":"array","description":"The list of cabinets where the advertisements should be displayed"},"description":{"type":"string","description":"Description of the advertisement"},"individualCabinetsOnly":{"type":"boolean","description":"Whether the advertisement is for only specific cabinets."},"regions":{"type":"array","description":"List of the regions where the advertisement should be displayed"},"title":{"type":"string","description":"Title of the advertisement"}},"example":[{"activationDate":"2020-11-12T22:00:00.000Z","cabinets":["a1b385b0-8cb3-4d93-b7da-5c9b0b68174f","c87da35a-0f70-4b6f-aafd-1ba3a142b8f6"],"deactivationDate":"2020-12-29T22:00:00.000Z","description":"Christmas special","id":"51aff450-25bb-11eb-be63-af61eb263c96.jpeg","individualCabinetsOnly":false,"isActive":true,"regions":["Airport"],"title":"Christmas discount","url":"https://cdn.selflystore.com/advertisements-prod/Selfly Demo/51aff450-25bb-11eb-be63-af61eb263c96.jpeg"},{"activationDate":null,"cabinets":["1-0-10-smoke-test-0665","6e0320ae-cc78-427c-9ba0-d48317d1592d"],"deactivationDate":"2032-01-14T22:00:00.000Z","description":null,"id":"9bc098d0-218c-11ea-b437-d54110e35779.jpeg","individualCabinetsOnly":true,"isActive":true,"regions":[],"title":"ECO tag","url":"https://cdn.selflystore.com/advertisements-prod/Selfly Demo/9bc098d0-218c-11ea-b437-d54110e35779.jpeg"}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisements"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/advertisements/{id}":{"put":{"summary":"Update the advertisement with the given Id","description":"Expects properties to update as body and update the database","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"body","name":"body","type":"string","required":true,"schema":{"example":{"activationDate":"2020-11-12T22:00:00.000Z","cabinets":["a1b385b0-8cb3-4d93-b7da-5c9b0b68174f","c87da35a-0f70-4b6f-aafd-1ba3a142b8f6"],"deactivationDate":"2020-12-29T22:00:00.000Z","description":"Christmas special 50% sales","individualCabinetsOnly":false,"regions":["Airport"],"title":"Christmas discount"}}}],"responses":{"200":{"description":"The advertisement is updated successfully.","schema":{"example":{"id":"51aff450-25bb-11eb-be63-af61eb263c96.jpeg","url":"https://cdn.selflystore.com/advertisements-prod/Selfly Demo/51aff450-25bb-11eb-be63-af61eb263c96.jpeg","activationDate":"2020-11-12T22:00:00.000Z","cabinets":["a1b385b0-8cb3-4d93-b7da-5c9b0b68174f","c87da35a-0f70-4b6f-aafd-1ba3a142b8f6"],"deactivationDate":"2020-12-29T22:00:00.000Z","description":"Christmas special 50% sales","individualCabinetsOnly":false,"regions":["Airport"],"title":"Christmas discount"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisements"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Delete the advertisement with the given Id","description":"Expects an Id of an advertisement and deletes it and its associated image","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"id","name":"id","type":"uuid","description":"Id of an advertisement to delete.","required":true}],"responses":{"200":{"schema":{"example":{"isSuccessful":true,"statusCode":202}},"description":"The advertisement is deleted successfully."},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisements"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/advertisements":{"get":{"summary":"Returns an array of media objects that cabinet should display on screen while in idling mode.","description":"\nEach cabinet has a screen that displays advertisement images on the screen while no one is purchasing. This endpoint returns a list of image URLs to be displayed on the screen.\n\nEach company owner of the cabinet has a separate folder in IPA CDN. The images are fetched based on the cabinet owner or a user group if a user is fetching for administration.\n\nNotice, if cabinet is deployed for the same owner in different countries, it needs to have only one owner in the settings. For instance if we have `Selfly-FI` and `Selfly-SE` customers, we need to upload for each of them separate images into CDN and assign cabinet one of them as owner. Folder structure in CDN is flat, no suborders are allowed for owner.\n            ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"Returns an array of media objects.","schema":{"type":"object","properties":{"url":{"type":"url","description":"URL of an advertisement image"},"id":{"type":"uuid","description":"advertisement id"},"activationDate":{"type":"date-time","description":"The date-time when advertisement gets activated"},"deactivationDate":{"type":"date-time","description":"The date-time when advertisement gets deactivated"},"cabinets":{"type":"array","description":"The list of cabinets where the advertisements should be displayed"},"description":{"type":"string","description":"Description of the advertisement"},"individualCabinetsOnly":{"type":"boolean","description":"Whether the advertisement is for only specific cabinets."},"locations":{"type":"array","description":"List of the locations where the advertisement should be displayed"},"title":{"type":"string","description":"Title of the advertisement"}},"example":[{"activationDate":"2020-11-12T22:00:00.000Z","cabinets":["a1b385b0-8cb3-4d93-b7da-5c9b0b68174f","c87da35a-0f70-4b6f-aafd-1ba3a142b8f6"],"deactivationDate":"2020-12-29T22:00:00.000Z","description":"Christmas special","id":"51aff450-25bb-11eb-be63-af61eb263c96.jpeg","individualCabinetsOnly":false,"isActive":true,"locations":["Airport"],"title":"Christmas discount","url":"https://cdn.selflystore.com/advertisements-prod/Selfly Demo/51aff450-25bb-11eb-be63-af61eb263c96.jpeg"},{"activationDate":null,"cabinets":["1-0-10-smoke-test-0665","6e0320ae-cc78-427c-9ba0-d48317d1592d"],"deactivationDate":"2032-01-14T22:00:00.000Z","description":null,"id":"9bc098d0-218c-11ea-b437-d54110e35779.jpeg","individualCabinetsOnly":true,"isActive":true,"locations":[],"title":"ECO tag","url":"https://cdn.selflystore.com/advertisements-prod/Selfly Demo/9bc098d0-218c-11ea-b437-d54110e35779.jpeg"}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisements"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/advertisements/{id}":{"put":{"summary":"Update the advertisement with the given Id","description":"Expects properties to update as body and update the database","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"body","name":"body","type":"string","required":true,"schema":{"example":{"activationDate":"2020-11-12T22:00:00.000Z","cabinets":["a1b385b0-8cb3-4d93-b7da-5c9b0b68174f","c87da35a-0f70-4b6f-aafd-1ba3a142b8f6"],"deactivationDate":"2020-12-29T22:00:00.000Z","description":"New Year special 25% sales","individualCabinetsOnly":false,"locations":["Airport"],"title":"Christmas discount"}}}],"responses":{"200":{"description":"The advertisement is updated successfully.","schema":{"example":{"id":"51aff450-25bb-11eb-be63-af61eb263c96.jpeg","url":"https://cdn.selflystore.com/advertisements-prod/Selfly Demo/51aff450-25bb-11eb-be63-af61eb263c96.jpeg","activationDate":"2020-11-12T22:00:00.000Z","cabinets":["a1b385b0-8cb3-4d93-b7da-5c9b0b68174f","c87da35a-0f70-4b6f-aafd-1ba3a142b8f6"],"deactivationDate":"2020-12-29T22:00:00.000Z","description":"New Year special 25% sales","individualCabinetsOnly":false,"locations":["Airport"],"title":"Christmas discount"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisements"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Delete the advertisement with the given Id","description":"Expects an Id of an advertisement and deletes it and its associated image","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"id","name":"id","type":"uuid","description":"Id of an advertisement to delete.","required":true}],"responses":{"200":{"schema":{"example":{"isSuccessful":true,"statusCode":202}},"description":"The advertisement is deleted successfully."},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisements"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/product-image":{"post":{"summary":"Uploads image for the product with given ID into blob storage and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container with product images (cabinet-products) in the user group folder, under the product ID file name. It also returns URL of the newly uploaded image so it can be used on product create or update calls.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/cabinet-products-qa/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["product-image"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/advertisement-image":{"post":{"summary":"Uploads advertisement image into blob storage and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container with advertisement images in the user group folder, under the advertisement ID file name. It also returns URL and id of the newly uploaded image so it can be used on advertisement update calls.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/cabinet-products-qa/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg","id":"f3cdede0-4a15-11eb-a712-179c2e10042f.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisement-image"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/advertisement-media":{"post":{"summary":"Uploads advertisement image into blob storage and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container with advertisement images in the user group folder, under the advertisement ID file name. It also returns URL and id of the newly uploaded image so it can be used on advertisement update calls.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."},{"in":"query","name":"group","type":"string","description":"Required organisation Id parameter to perform the action","required":true}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/cabinet-products-qa/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg","id":"f3cdede0-4a15-11eb-a712-179c2e10042f.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["advertisement-media"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/logo-image":{"post":{"summary":"Uploads image for the logo with given ID into blob storage and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container with logo images (logo-images-qa or logo-image-prod) in the user group folder, under the logo ID file name. It also returns URL of the newly uploaded image.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."}],"responses":{"201":{"schema":{"example":{"url":"url: \"https://cdn.selflystore.com/logo-images-qa/test_owner/837f7a10-4a54-11eb-8dc3-2b0ea555e8b4.jpeg\""},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["logo-image"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/inventory/{id}":{"get":{"summary":"Fetches inventory snapshot of cabinet","description":"Cabinet sends regularly inventory snapshots of cabinet inventory. This endpoint is for retrieving those. Requires Bearer authentication","parameters":[{"name":"latest","in":"query","type":"boolean","description":"will fetch 100 snapshots if set to `false` else only latest","required":false,"schema":{"example":"false"}},{"name":"tagsOnly","in":"query","type":"boolean","description":"option to exclude tag product information","required":false,"schema":{"example":"false"}},{"name":"from","in":"query","type":"string","description":"Select inventories after timestamp if latest is false","required":false,"schema":{"example":"2019-05-01T00:00:00.000Z"}},{"name":"to","in":"query","type":"string","description":"Select inventories before timestamp if latest is false","required":false,"schema":{"example":"2019-05-01T00:00:00.000Z"}},{"name":"excludeGhostTags","in":"query","type":"string","description":"Exclude ghost tags","required":false,"schema":{"example":"true"}},{"name":"excludeBadQualityTags","in":"query","type":"string","description":"Exclude tags with bad quality","required":false,"schema":{"example":"true"}},{"name":"includeDiscounts","in":"query","type":"boolean","description":"Includes discounts to the response if any product has discount","required":false,"schema":{"example":true}},{"name":"timezone","in":"query","type":"string","description":"Timezone information","required":false,"schema":{"example":"Europe/Helsinki"}},{"name":"id","in":"path","type":"string","description":"Cabinet ID to fetch the inventory to.","required":true}],"responses":{"200":{"description":"\n          Returns latest cabinet inventory snapshot (unless latest query param is set to false so it returns all). \n        \n          If the location price value for one of the location prices is not available, the location price of the first ancestor of that location which has a price record will replace it.\n          If no location price found for any of the ancestors of a location, the default price will be used.\n        ","schema":{"example":{"deviceCode":"00000001-94A8","organizationId":"organization","readTime":"2020-02-06T11:06:26.167Z","tags":[{"epc":"30393AB2411A86C03E41A571","rssi":203,"barcode":"3222492893077","expiryDate":"2020-09-03T23:59:59.000Z","antenna":1,"quality":"good","userMemory":"03092020","product":{"id":"ce3f48f0-77f3-45bd-b7db-0e46778871e9","name":"Bouton d'Or chips saveur barbecue","imageUrl":"https://cdn.selflystore.com/cabinet-products-prod/stora%20enso%20oyj/6603f720-384b-11ea-9d2a-b7361ec5f6d9.jpeg","productType":"G11-MetallizedLiquidCartonPackage","prices":[{"id":"7a26497c-8694-43ec-b29a-a1d68ad41f3a","price":0.79,"currency":"€","locationId":"Main Central Train Station","metadata":{},"region":"Main Central Train Station"}],"metadata":{},"owners":["Selfly Demo"],"barcode":"3222492893077","price":0.79,"currency":"€","status":2,"timeToLiveDays":null,"sold":"2021-03-26T11:46:30.357Z","replenished":"2021-03-24T11:46:30.357Z"}}],"payloadJson":null,"discountedProducts":[{"productId":"ce3f48f0-77f3-45bd-b7db-0e46778871e9","epc":"30393AB2411A86C03E41A571","barcode":"3222492893077","expiryDate":null,"discountId":"d27589cb-e942-4d3d-b0cf-f9a5c1e748c0","isExpired":false,"isExpiring":false,"minutesToExpiry":null}]}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"403":{"description":"Not authorized to execute commands."},"5XX":{"description":"Unexpected server error."}},"tags":["inventory"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/inventory":{"post":{"summary":"Stores inventory snapshot of cabinet","description":"This endpoint is for cabinets to send inventory snapshots to. Requires device token authorization. Expects application/json array of epcs in body","parameters":[{"name":"body","in":"body","description":"Array of string epc values","required":true,"schema":{"type":"array","items":{"type":"string"},"example":[{"epc":"AAA","barcode":"0000000000000","rssi":200,"antenna":1,"quality":"bad","sold":"2021-03-26T11:46:30.357Z","replenished":"2021-03-24T11:46:30.357Z"},{"epc":"BBB","barcode":"0000000000000","rssi":200,"antenna":1,"quality":"good","replenished":"2021-03-24T11:46:30.357Z"},{"epc":"CCC","barcode":"0000000000000","rssi":200,"antenna":1,"quality":"good","replenished":null}]}},{"name":"record","in":"query","description":"Audit record ID (GUID) to be tied to snapshot payloadJson. Used to fetch `replenishment` snapshots for reporting.","required":false,"schema":{"type":"string","example":"<audit-id>"}},{"name":"type","in":"query","description":"Type of the snapshot to be storedd in payloadJson. \n  Can be:\n  - `replenishment-start` for replenishment started snapshot;\n  - `replenishment-end` for replenishment end snapshot;\n  - null for normal snapshot. Or skip this parameter for normal snapshot.","required":false,"schema":{"type":"string","example":"replenishment-start"}}],"responses":{"201":{"description":"Storing inventory snapshot succeeded"},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"403":{"description":"Not authorized to execute commands."},"5XX":{"description":"Unexpected server error."}},"tags":["inventory"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/transactions":{"get":{"parameters":[{"description":"Number of results to return","in":"query","name":"$limit","type":"integer"},{"description":"Number of results to skip","in":"query","name":"$skip","type":"integer"},{"description":"Property to sort results","in":"query","name":"$sort","type":"string"}],"responses":{"200":{"description":"success","schema":{"$ref":"#/definitions/transactions list"}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Retrieves a list of all resources from the service.","summary":"","tags":["transactions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/transactions/{id}":{"get":{"summary":"Fetches the transaction history per cabinet for the given date range and returns at max 1000 transactions if the provided date range contains more than 1000 records.","description":"\nEach transaction, if payment was sent, is saved to the storage. This method fetches the list of transactions per cabinet for given date range.\n\nEach transaction's status can be updated by the administrator, in this case the transaction record is updated and the new property `statusChanged` added. It contains the old status, new status, time of change and user name who changed the status. See example for details.\n      ","parameters":[{"name":"id","in":"path","type":"string","description":"ID of the cabinet.","required":true},{"name":"from","in":"query","type":"datetime2","description":"Date from what to fetch the transactions. If not given, queries for last week.","required":false},{"name":"to","in":"query","type":"datetime2","description":"Date to what to fetch the transactions. If not given, queries up to current date and time.","required":false},{"name":"status","in":"query","type":"string","description":"If given, will filter transaction only with this status. Allowed values are: `DONE`, `CANCELED`, `PARTIAL`, `FAIL`, `TIMEOUT`, `NEW`, `NO_PURCHASE`.","required":false},{"name":"orderId","in":"query","type":"string","description":"If given, will filter transaction only with this orderId. Other query parameters will be ignored if orderId is given.","required":false},{"name":"skip","in":"query","type":"number","description":"If given, will skip specified number of documents.","required":false}],"responses":{"200":{"description":"List of requested transactions.","schema":{"example":[{"deviceCode":"11f4017a-7077-45c3-9097-5ad9a9def6ed","orderId":"Order-1573478901920","purchases":{"purchase":[{"barcode":"6410220004704","name":"Yosa oat snack vanilla & granola","epc":["30347AB6EC18A50043725CEE"],"price":2,"currency":"€","image":"https://cdn.selflystore.com/cabinet-products/fazer/6410220004704_0.png","count":1,"isDiscounted":true,"discountAmount":20,"discountName":"Christmas"}],"totalSum":2},"unchargedTags":[{"epc":"303614229C507E80FB263A1B","barcode":"6416453014923","price":1.5,"reason":"sold"}],"transactionDetails":{"secondaryOrderId":"Order-121233443542"},"timestamp":"2019-11-11T11:28:22.300Z","customerId":null,"status":"DONE","paymentMethod":null,"locationName":"New area","discountedUserId":"12112","purchasedTags":["30347AB6EC18A50043725CEE"]}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"404":{"description":"Cabinet not found."},"5XX":{"description":"Unexpected server error."}},"tags":["transactions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"patch":{"summary":"Updates properties of the transaction only those that are given.","description":"\nSupports updating the transaction status for manual conflicts resolution. Status can be one of the following: `DONE`, `NO_PURCASE`,`NEW`, `CANCELED`, `PARTIAL`, `TIMEOUT`, `FAIL`.\n    ","parameters":[{"name":"id","in":"path","type":"string","description":"Cabinet ID","required":true},{"name":"orderId","in":"query","type":"string","description":"Order ID to update.","required":true},{"name":"body","in":"body","type":"object","required":true,"example":{"status":"DONE","reason":"The reason why the status need to be changed"}}],"responses":{"201":{"description":"Update happened successfully.","example":{"id":"TEST_CABINET_1","status":"DONE","reason":"The reason why the status need to be changed"}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["transactions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/encoding-instruction":{"get":{"summary":"Gets all available encoding instructions","description":"Gets all available encoding instructions","parameters":[],"responses":{"200":{"description":"Returns all encoding instructions","schema":{"example":[{"productType":"SomeProductType","title":{"en":"Some Product Type","fi":"Joku Tuote Tyyppi"},"tagTypes":["Tag type 1","Tag type 2"],"imageUrls":["http://imagehere","http://anotherhere"],"taggingGuideUrl":"https://cdn.selflystore.com/tagging-guide-qa/G11.PNG","instruction":{"en":"Instruction here","fi":"Ohje tässä"},"packageForFreezer":{"type":"boolean","description":"Whether a package is suitable for freezer (no attribute or packageForFreezer: true)"}}],"type":"object","properties":{"productType":{"type":"string","description":"Product type id"},"title":{"type":"json","description":"Object with title translations in format { en: \"example\", fi: \"esimerkki\"... }"},"tagTypes":{"type":"array","description":"String array of tag types supported"},"imageUrls":{"type":"string","description":"String array of image urls"},"instruction":{"type":"json","description":"Object with instruction translations in format { en: \"example\", fi: \"esimerkki\"... }"},"packageForFreezer":{"type":"boolean","description":"Whether a package is suitable for freezer"}}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["encoding-instruction"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Create a new encoding instruction","description":"Creates a new resource with data.","parameters":[{"name":"body","in":"body","description":"The new encoding instruction data.","required":true,"schema":{"example":{"productType":"SomeProductType","title":{"en":"Some Product Type","fi":"Joku Tuote Tyyppi"},"tagTypes":["Tag type 1","Tag type 2"],"imageUrls":["http://imagehere","http://anotherhere"],"instruction":{"en":"Instruction here","fi":"Ohje tässä"},"packageForFreezer":{"type":"boolean","description":"Whether a package is suitable for freezer (no attribute or packageForFreezer: true)"}}}}],"responses":{"201":{"description":"Encoding instruction was created successfully."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["encoding-instruction"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/encoding-instruction/{id}":{"get":{"summary":"Find encoding instruction by ID","description":"Returns a single encoding instruction","operationId":"getEncodingInstructionById","produces":["application/json"],"parameters":[{"name":"productType","in":"path","description":"ID of encoding instruction to return","required":true}],"responses":{"200":{"description":"successful operation","schema":{"example":{"productType":"SomeProductType","title":{"en":"Some Product Type","fi":"Joku Tuote Tyyppi"},"tagTypes":["Tag type 1","Tag type 2"],"imageUrls":["http://imagehere","http://anotherhere"],"taggingGuideUrl":"https://cdn.selflystore.com/tagging-guide-qa/G11.PNG","instruction":{"en":"Instruction here","fi":"Ohje tässä"},"packageForFreezer":{"type":"boolean","description":"Whether a package is suitable for freezer (no attribute or packageForFreezer: true)"}}}},"400":{"description":"Invalid product type supplied"},"404":{"description":"Encoding instruction not found"}},"tags":["encoding-instruction"],"consumes":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Update an existing encoding instruction","description":"Updates the resource identified by id using data.","parameters":[{"name":"productType","in":"path","description":"Product type encoding instruction to update","required":true},{"name":"body","in":"body","description":"The encoding instruction data.","required":true,"schema":{"example":{"productType":"SomeProductType","title":{"en":"Some Product Type","fi":"Joku Tuote Tyyppi"},"tagTypes":["Tag type 1","Tag type 2"],"imageUrls":["http://imagehere","http://anotherhere"],"instruction":{"en":"Instruction here","fi":"Ohje tässä"},"packageForFreezer":{"type":"boolean","description":"Whether a package is suitable for freezer (no attribute or packageForFreezer: true)"}}}}],"responses":{"201":{"description":"Encoding instruction was updated successfully."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["encoding-instruction"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"parameters":[{"description":"ID of encoding-instruction to return","in":"path","required":true,"name":"id","type":"integer"}],"responses":{"200":{"description":"success","schema":{"$ref":"#/definitions/encoding-instruction"}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Removes the resource with id.","summary":"","tags":["encoding-instruction"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/__adhoc/demo":{"post":{"summary":"Adhoc endpoint for Demo Payment Layer. Not to be used directly.","description":"\nDemo payment layer is using this method to signalize about the new demo user was checked in.\n  \n*Note! This method is not to be used directly, only Demo Cabinets use it*\n          ","parameters":[{"name":"body","in":"body","description":"The demo payment body. Indicates cabinet ID and if payment started or canceled.\n\n`checkOut` is optional, by default it is `false` making user check in to the cabinet. In case of checking out explicitly set it to `true`.\n","required":true,"schema":{"example":{"deviceCode":"5f977be8-6a68-4d9d-84d4-687b43b97667","checkOut":true}}}],"responses":{"200":{"description":"User scanned QR code correctly. Returns same data as was sent to the method.","example":{"cabinetId":"5f977be8-6a68-4d9d-84d4-687b43b97667","checkOut":true}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"}},"tags":["__adhoc"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/refund/{id}":{"put":{"summary":"Administrator can refund money for mischarged order using this method.","description":"\n  In case of mistake, the refund method can be used to return money to the user.\n\n  Error would be thrown if refund sum is bigger than the purchase sum. Error would be thrown in case if order is older than 3 months. Error would be thrown in case there is no associated user or order was not paid.\n      \n  Audit message is saved to the audit store about who made the transaction refund and with what reason. Reason is mandatory.\n  ","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Cabinet device code that order was made at.","required":true},{"name":"body","in":"body","description":"The order and list of refunds.","required":true,"schema":{"example":{"refundItems":[{"price":1.2,"refundAmount":1,"barcode":"9999999999999","name":"Cookies","currency":"€"}],"orderId":"Order-1551525236524","reason":"The cabinet mischarded the cookies."}}}],"responses":{"201":{"description":"The transaction was updated and refund was made successfully."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated. Only device can use this method with Device authentication."},"5XX":{"description":"Unexpected server error."}},"tags":["refund"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/audit/{id}":{"get":{"summary":"Fetches the audit events for the device","description":"Each command issued to device leaves audit record. This endpoint provides","parameters":[{"name":"command","in":"query","type":"string","description":"Filter audits by command","required":false,"schema":{"example":"doorOpen"}},{"name":"from","in":"query","type":"string","description":"Select audits after timestamp","required":false,"schema":{"example":"2019-05-01T00:00:00.000Z"}},{"name":"to","in":"query","type":"string","description":"Select audits before timestamp","required":false,"schema":{"example":"2019-05-01T00:00:00.000Z"}},{"name":"id","in":"path","type":"string","description":"Cabinet id","required":true}],"responses":{"200":{"description":"Returns list of audits possibly filtered by command.","schema":{"example":[{"id":"40693df4-41ba-4fa9-a804-f87a96753c5b","command":"doorOpen","deviceId":"testDevice-4a91a5cc-1f71-4eef-9b8b-a19ee58d4320","commandParams":{},"timestamp":"2019-04-04T12:37:37.148Z","userName":"test.user"},{"id":"5a202b8e-5127-4483-b564-d90504320be0","command":"doorOpen","deviceId":"testDevice-4a91a5cc-1f71-4eef-9b8b-a19ee58d4320","commandParams":{},"timestamp":"2019-04-04T12:37:37.148Z","userName":"test.user"}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"403":{"description":"Not authorized to execute commands."},"5XX":{"description":"Unexpected server error."}},"tags":["audit"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/cabinets":{"get":{"summary":"Fetches cabinets belonging to group","description":"Fetches cabinets belonging to group","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. If only belongs to 1 group then defaults to using that","required":false}],"responses":{"200":{"description":"The list of cabinets for the requested group","schema":{"type":"object","properties":{"id":{"type":"string","description":"Device id"},"organizationId":{"type":"string","description":"Organization that device belongs to"},"deviceCode":{"type":"string","description":"Device code"},"name":{"type":"string","description":"Device name"},"region":{"type":"string","description":"Region that device belongs to"},"lifeCycleStatus":{"type":"string","description":"Device life cycle status"},"locationId":{"type":"string","description":"Device location ID"},"deviceType":{"type":"string","description":"Type of the device"},"lastSeenOnline":{"type":"dateTime","description":"The last time the device has been online"},"isOnline":{"type":"boolean","description":"If the device is online or offline"},"isDigiTwinOnline":{"type":"boolean","description":"If device digitwin is online or offline"},"rfidStatus":{"type":"string","description":"Status of devices readers. Can be `OK`, `READER_DOWN`, `ANTENNA_DOWN`, `NO_INFO`"}},"example":[{"deviceCode":"04766083-4a07-4c0d-8183-9773109da3a8","id":"04766083-4a07-4c0d-8183-9773109da3a8","name":"shanghai-demo","organizationId":"Selfly Demo","deviceType":"smartCabinet","lastSeenOnline":"2019-05-08T07:52:08.973Z","isOnline":false,"isDigiTwinOnline":false,"LifeCycleStatus":"operational","region":null,"locationId":"test","locationName":"test","rfidStatus":"NO_INFO"},{"deviceCode":"134-0033983--339884","id":"1","name":"Helsinki Headquarter Cabinet #1","organizationId":"Selfly Demo","deviceType":"smartCabinet","lastSeenOnline":"2018-01-03T08:32:13.420Z","isOnline":false,"isDigiTwinOnline":false,"LifeCycleStatus":"operational","region":null,"locationId":"test","locationName":"test","rfidStatus":"OK"}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["cabinets"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/cabinets/{id}":{"get":{"summary":"Fetches a cabinet.","description":"Fetches a cabinet by device code.","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Cabinet device code","required":true}],"responses":{"200":{"description":"Cabinet information","schema":{"type":"object","properties":{"id":{"type":"string","description":"Device id"},"organizationId":{"type":"string","description":"Organization that device belongs to"},"deviceCode":{"type":"string","description":"Device code"},"name":{"type":"string","description":"Device name"},"region":{"type":"string","description":"Region that device belongs to"},"lifeCycleStatus":{"type":"string","description":"Device life cycle status"},"locationId":{"type":"string","description":"Device location ID"},"deviceType":{"type":"string","description":"Type of the device"},"lastSeenOnline":{"type":"dateTime","description":"The last time the device has been online"},"isOnline":{"type":"boolean","description":"If the device is online or offline"},"isDigiTwinOnline":{"type":"boolean","description":"If device digitwin is online or offline"},"rfidStatus":{"type":"string","description":"Status of devices readers. Can be `OK`, `READER_DOWN`, `ANTENNA_DOWN`, `NO_INFO`"}},"example":[{"deviceCode":"04766083-4a07-4c0d-8183-9773109da3a8","id":"04766083-4a07-4c0d-8183-9773109da3a8","name":"shanghai-demo","organizationId":"Selfly Demo","deviceType":"smartCabinet","lastSeenOnline":"2019-05-08T07:52:08.973Z","isOnline":false,"isDigiTwinOnline":false,"LifeCycleStatus":"operational","region":null,"locationId":"test","rfidStatus":"NO_INFO"}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["cabinets"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates a cabinet.","description":"Can update cabinet locationId","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Cabinet device code","required":true},{"name":"body","in":"body","description":"The cabinet data to update.","required":true,"schema":{"example":{"locationId":"XXX"}}}],"responses":{"200":{"description":"Update result"},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["cabinets"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/refill/{id}":{"get":{"summary":"Returns array of refill records with audit data as well as before and after inventory snapshots.","parameters":[{"name":"from","in":"query","type":"string","description":"Select refills after timestamp","required":false,"schema":{"example":"2019-05-01T00:00:00.000Z"}},{"name":"to","in":"query","type":"string","description":"Select refills before timestamp","required":false,"schema":{"example":"2019-05-01T00:00:00.000Z"}},{"name":"deviceCode","in":"path","type":"string","description":"Target cabinet's device code","required":true},{"name":"skip","in":"query","type":"number","description":"If given, will skip specified number of documents.","required":false}],"responses":{"200":{"description":"Returns the refill audit records","schema":{"example":[{"audit":{"id":"test-e1b46900-70a8-4f06-888c-152643961675","command":0,"deviceId":"test-device-5e69f706-ff7b-4a22-91ab-f5e78fb047e0","commandParams":"{}","timestamp":"2019-04-18T23:59:59.500Z","userName":"test.user"},"start":{"deviceCode":"test-device-5e69f706-ff7b-4a22-91ab-f5e78fb047e0","readTime":"2019-04-19T00:00:00.000Z","tags":[{"antenna":9,"barcode":"0040000001607","epc":"30340271000028002A110000","expiryDate":null,"quality":"good","rssi":203,"userMemory":null}],"payload":{"record":"9e9326f2-6767-4ecd-b0a7-6ff0245aa5c0","type":"replenishment-start"}},"end":{"deviceCode":"test-device-5e69f706-ff7b-4a22-91ab-f5e78fb047e0","readTime":"2019-04-19T00:02:00.000Z","tags":[{"antenna":9,"barcode":"0040000001607","epc":"30340271000028002A110000","expiryDate":null,"quality":"good","rssi":203,"userMemory":null},{"antenna":5,"barcode":"2000000000008","epc":"30347A12000000002A814902","expiryDate":null,"quality":"good","rssi":213,"userMemory":null}],"payload":{"record":"9e9326f2-6767-4ecd-b0a7-6ff0245aa5c0","type":"replenishment-end"}}}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"description":"Retrieves a single resource with the given id from the service.","tags":["refill"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/refill/{id}":{"get":{"summary":"Returns array of refill records with audit data as well as before and after inventory snapshots.","parameters":[{"name":"from","in":"query","type":"string","description":"Select refills after timestamp","required":false,"schema":{"example":"2020-11-16T00:00:00.000Z"}},{"name":"to","in":"query","type":"string","description":"Select refills before timestamp","required":false,"schema":{"example":"2020-11-18T00:00:00.000Z"}},{"name":"group","in":"query","type":"string","description":"Select group for refill transaction","required":false,"schema":{"example":"Selfly"}},{"name":"deviceCode","in":"path","type":"string","description":"Target cabinet's device code","required":true}],"responses":{"200":{"description":"Returns the refill audit records","schema":{"example":[{"audit":{"id":"05447113-fefe-46b8-9abb-83782b3b8359","command":0,"deviceId":"623bb422-198c-4818-813b-971906c6522c","commandParams":"{}","timestamp":"2020-11-16T09:07:05.717Z","userName":"example.user@email.com"},"refill":[{"product":{"id":"35582a08-d7c6-4642-b4dc-fc607cc3fc67","name":"Balmain Texturizing Salt Spray 200ml","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/stora%20enso%20demo/482f2d30-ab0c-11ea-a1f3-b34e6074a483.jpeg","price":12.9,"currency":"€","removedItems":{"total":1,"tags":[{"epc":"303614229C507E80FB267E1C","rssi":181,"barcode":"8718503824260","antenna":1,"userMemory":null,"expiryDate":null,"quality":"bad"}]},"addedItems":{"total":0,"tags":[]}}},{"product":{"id":"11137e3d-9e86-4aaa-9853-fce7d6ecee84","name":"Test_PlasticCan_Liquid_Stacked","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/stora%20enso%20international/8de38650-2262-11eb-af2b-ddae62416360.jpeg","price":2.5,"currency":"€","removedItems":{"total":0,"tags":[]},"addedItems":{"total":1,"tags":[{"epc":"30344A87DC0AD9C0B113BB4A","rssi":195,"barcode":"1221111111112","antenna":2,"userMemory":"10112020","expiryDate":"2020-11-10T23:59:59.000Z","quality":"good"}]}}}]}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"description":"Retrieves a single resource with the given id from the service.","tags":["refill"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/cube":{"get":{"summary":"Runs CubeJS query and returns data","description":"Runs CubeJS query in query param.","parameters":[{"in":"query","name":"query","type":"string","description":"Required CubeJS query.","required":true},{"in":"query","name":"group","type":"string","description":"Argument to specify what group to make query on behalf of. If user only belongs to 1 group, not needed.","required":false}],"responses":{"200":{"description":"Transactions data for the requested device.","schema":{"type":"object","properties":{"query":{"type":"object","description":"CubeJS query"},"data":{"type":"array","description":"CubeJS query result data"},"annotation":{"type":"object","description":"CubeJS annotation"}},"example":{"query":{"dimensions":["Device.deviceName"],"timeDimensions":[{"dimension":"Transactions.timestamp","granularity":"day"}],"measures":["Transactions.orderSum"],"filters":[],"timezone":"UTC"},"data":[{"Device.deviceName":"Tampere testi cabinet","Transactions.timestamp":"2019-02-19T00:00:00.000","Transactions.orderSum":20.000000000000004},{"Device.deviceName":"Tampere testi cabinet","Transactions.timestamp":"2019-02-20T00:00:00.000","Transactions.orderSum":14.3},{"Device.deviceName":"Tampere testi cabinet","Transactions.timestamp":"2019-03-06T00:00:00.000","Transactions.orderSum":1.1}],"annotation":{"measures":{"Transactions.orderSum":{"title":"Transactions Order Sum","shortTitle":"Order Sum","type":"number"}},"dimensions":{"Device.deviceName":{"title":"Device Device Name","shortTitle":"Device Name","type":"string"}},"segments":{},"timeDimensions":{"Transactions.timestamp":{"title":"Transactions Timestamp","shortTitle":"Timestamp","type":"time"}}}}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["cube"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/cube-meta":{"get":{"summary":"Returns the meta data information of the cube schema","description":"Fetches the meta data for cube schema","parameters":[],"responses":{"200":{"description":"The meta data for the cube schema","schema":{"type":"object","properties":{"cube":{"type":"array","description":"CubeJS meta data"}},"example":{"cubes":[{"name":"Device","title":"Device","connectedComponent":1,"measures":[{"name":"Device.deviceTypeCount","title":"Device Device Type Count","shortTitle":"Device Type Count","cumulativeTotal":false,"cumulative":false,"type":"number"}],"dimensions":[{"name":"Device.id","title":"Device Id","type":"string","shortTitle":"Id","suggestFilterValues":true}],"segments":[]}]}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authentication."},"5XX":{"description":"Unexpected server error."}},"tags":["cube-meta"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/user-check-in":{"post":{"summary":"Checks user in to the one given cabinet.","description":"Each cabinet is waiting for the user to be checked in. \n\n\nUser check in means the cabinet will unlock the door for purchase.\n\n\nThird party application can check in user. List of checks is performed before unlocking the cabinet door.\nApplication that is calling this method must have an access to the Tenant of the cabinet, as well as to this particular cabinet.\n\n\nThe special header is required to be provided: `'X-Application-Access-Key'`. The cabinet and the application must have those values identical in order to unlock the door.\n","parameters":[{"name":"body","in":"body","description":"The user to be checked in specification and cabinet code to check in.","required":true,"schema":{"example":{"deviceCode":"xxxx-xxxxx-xxxxxx-xxxxx","userId":"yyyy-yyyyyy-yyyyyy-yyyyy","transactionReference":"aaa123-123312aaa"}}}],"responses":{"201":{"description":"The successful response. In that case the cabinet door should be unlocked if cabinet was in 'Waiting for the user' state.","schema":{"example":{"deviceCode":"<device code provided>","userId":"<ID of the user checked in>","transactionReference":"<current transaction reference>"},"type":"object","properties":{"deviceCode":{"type":"string","description":"Device code to which user was checked in."},"userId":{"type":"string","description":"ID of the user who was checked in."},"transactionReference":{"type":"string","description":"reference of current transaction"}}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["user-check-in"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/user-check-out":{"post":{"summary":"Checks user out from the one given cabinet.","description":"Each cabinet is waiting for the user to be checked in, then user may be checked out if purchase was canceled. \n\n\nUser check out means the cabinet will lock the door if, after checking in, it was not yet opened.\n\n\nThird party application can check out user. List of checks is performed before locking the cabinet door.\nApplication that is calling this method must have an access to the Tenant of the cabinet, as well as to this particular cabinet.\n\n\nThe special header is required to be provided: `'X-Application-Access-Key'`. The cabinet and the application must have those values identical in order to lock the door.\n","parameters":[{"name":"body","in":"body","description":"The user to be checked out specification and cabinet code to check out.","required":true,"schema":{"example":{"deviceCode":"xxxx-xxxxx-xxxxxx-xxxxx","userId":"yyyy-yyyyyy-yyyyyy-yyyyy"}}}],"responses":{"201":{"description":"The successful response. In that case the cabinet door should be locked if cabinet was in 'Waiting for door open' state.","schema":{"type":"object","properties":{"deviceCode":{"type":"string","description":"Device code to which user was checked out."},"userId":{"type":"string","description":"ID of the user who was checked out."}},"example":{"deviceCode":"<device code provided>","userId":"<ID of the user checked out>"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["user-check-out"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/notification":{"post":{"summary":"Notification is sent to the cabinet to make it react on certain external event.","description":"\nCabinet listens for `notification` `created` event, compares own ID to the given `deviceCode` and executes command.\n\nNotifications can be sent from user or from the cloud, devices can't send notifications to each other.\n\nDifference between command and notification is the notification is not so critical and do not affect cabinet behaviour, use notifications when you need to schedule cabinet to reload configuration, for example.\nNotifications are scheduled, commands are executed immediately.\n\nSupported notifications:\n\n| Notification | Explanation |\n|---  |--- |\n| `notifySettingsUpdated` | Make cabinet to reload settings as soon as state machine allows it, this notification is sent by the cloud when user updates settings in the database for the device. The settings update may tags for about 30 seconds after user made a change due to scheduling. |\n\n      ","parameters":[{"name":"body","in":"body","description":"The notification object containing device code","required":true,"schema":{"example":{"deviceCode":"XXXXXXXXXXXXXXXX","notification":"notifySettingsUpdated","params":{}}}}],"responses":{"201":{"description":"Notification sent successfully to Cabinet."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"403":{"description":"Not authorized to execute commands."},"5XX":{"description":"Unexpected server error."}},"tags":["notification"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/vat":{"get":{"summary":"Fetches available VAT Categories for the user.","description":"\n        Fetches all of the VAT categories belonging to one organization based on the organization ID passed in the parameters\n    ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"The list of VAT Categories for the requested organization.","schema":{"example":[{"id":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d","name":"Finland Category 1","taxValue":24,"organization_id":"Selfly Demo","isFromProductSurcharge":true},{"id":"91bdac4e-f1e5-46a7-a9ec-00468b29b5da","name":"Finland Category 2","taxValue":14,"organization_id":"Selfly Demo","isFromProductSurcharge":true}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["vat"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates new VAT Category","description":"\n    Creates new VAT category. A VAT category entry should belong to an organization and the organization ID should be passed in the parameters.\n        ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"name":"body","in":"body","description":"The new VAT category data.","required":true,"schema":{"example":{"name":"Finland Category 1","taxValue":24}}}],"responses":{"201":{"description":"VAT category was created successfully.","schema":{"example":{"id":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d","name":"Finland Category 1","taxValue":24,"organization_id":"Selfly Demo"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["vat"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/vat/{id}":{"put":{"summary":"Updates an existing VAT Category","description":"\n    Updates an existing VAT category. A VAT category entry should belong to an organization and the organization ID should be passed in the parameters. Also the VAT category Id should be passed in parameters.\n        ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"path","name":"id","type":"string","description":"The Id of the VAT category to be updated","required":true},{"name":"body","in":"body","description":"The updated VAT category data.","required":true,"schema":{"example":{"name":"Finland Category 1","taxValue":24}}}],"responses":{"201":{"description":"VAT category is updated successfully.","schema":{"example":{"id":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d","name":"Finland Category 1","taxValue":14,"organization_id":"Selfly Demo"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["vat"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Deletes a VAT Category","description":"\n    Deletes a VAT category entry from database based on the VAT category Id. In case the VAT category is associated with any products, the request to delete will be rejected\n    ","parameters":[{"name":"id","in":"path","description":"VAT Category to delete","required":true},{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"VAT category deleted","schema":{"example":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d"}},"400":{"description":"Invalid product type supplied"},"404":{"description":"Encoding instruction not found"},"5XX":{"description":"Unexpected server error."}},"tags":["vat"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/geoinfo/{id}":{"get":{"summary":"Fetch geo information based on client ip","description":"\n     Get detiales geo information, eg, country, region, timezone, etc. Ip needs to be public ip v4 address.\n          ","parameters":[{"name":"id","in":"path","type":"string","description":"client ip","required":true,"schema":{"example":"86.115.71.215"}}],"responses":{"200":{"description":"Details of the geo information","schema":{"example":{"geoInfo":{"range":[1450393600,1450409983],"country":"FI","region":"","eu":"1","timezone":"Europe/Helsinki","city":"Tampere","ll":[60.1708,24.9375],"metro":0,"area":200},"ip":"86.115.71.215"}}},"401":{"description":"Not authorized"},"404":{"description":"Geo location information not found"}},"tags":["geoinfo"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/expiry-events":{"post":{"summary":"Creates new Expiry event ","description":"\n        Creates a new expiry event and its belonging expired products. POST body includes the expired products as an object array.\n            ","parameters":[{"name":"body","in":"body","description":"Expired products as an array of objects","required":true,"schema":{"example":[{"productId":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d","productName":"Kismet chocolate bar, 55g","barcode":"41412273","epc":"324232323432432","price":"2.5","currency":"€","expiryDate":"30102020"}]}}],"responses":{"201":{"description":"created","example":"Sucess"},"400":{"description":"Device cannot be parsed from header."},"401":{"description":"Not authenticated."},"404":{"description":"Device does not exist or payload is empty"},"5XX":{"description":"Unexpected server error."}},"tags":["expiry-events"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/discount-rules":{"get":{"summary":"Returns all the discount rules of an organisation","description":"\n              Get all the discount rules that belong to an organisation.\n                  ","parameters":[{"in":"query","name":"group","type":"string","description":"Required organisation Id parameter to perform the action","required":true}],"responses":{"200":{"description":"Returns the payload that contains an array of discount rule objects.","schema":{"example":[{"ProductIds":null,"OrganisationId":"ci.test.organization","LocationIds":null,"DeviceCodes":null,"Id":"0b7469e0-8a40-4021-9014-ea9099fe6513","discountRuleStops":[]},{"ProductIds":null,"OrganisationId":"ci.test.organization","LocationIds":null,"DeviceCodes":null,"Id":"0b7469e0-8a40-4021-9014-ea9099fe6515","discountRuleStops":[{"Id":"1","MinutesBeforeExpiry":1,"DiscountAmount":50,"DiscountRuleId":"1"},{"Id":"32c7845d-9e72-4064-95c3-6c10ff00ebb0","MinutesBeforeExpiry":15,"DiscountAmount":20,"DiscountRuleId":"1"},{"Id":"d1ac910d-f271-4e3e-a927-b3edc6e202e8","MinutesBeforeExpiry":2,"DiscountAmount":5,"DiscountRuleId":"1"}]}]}},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["discount-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new discount rule ","description":"\n    Organisations can create a discount rules for expiring products or promotional purposes. If the discount rule is created for expiring products, discount rule stops are also necessary to define when the discount will be applied to expiring products.\n                ","parameters":[{"in":"query","name":"group","type":"string","description":"Required organisation Id parameter to perform the action","required":true},{"name":"body","in":"body","description":"In order to apply discounts to products regardless of whether they are expiring or not, you need to first create a discount rule via discount rules endpoint. While creating the discount rule, you can decide where and to which products the discount rule will be visible. This operation is called filtering and done through the parameters in the payload.\n\n        - If locations filter is set to a certain location or locations, the discount will ONLY be visible to a certain location or locations but if set to null, the discount rule is visible to all locations.\n        - If devices filter is set to a certain device or devices, the discount will ONLY be visible to a certain device or devices but if set to null, the discount rule is visible to all devices.\n        - If products filter is set to a certain product or products, the discount will ONLY be visible to a certain product or products but if set to null, the discount rule is visible to all products.\n        \n        ### The use of multiple filters at the same time.\n        \n        You can also create combination of the filters with care. In order to use multiple filters at the same time, you need to keep in mind that you can set either locations or devices filter along with products filter. You cannot use location and device filters at the same time.\n        After setting either locations or devices filter, you can set productIds. For example, if you want a discount rule to be active only for Tampere and for a few products, you can set the locations and productIds filters. On the other hand, if you want a discount to be active for certain cabinets for certain products, you should set devices and products filters.\n        Each discount rule must have a discount rule stop object which indicates when and how the discount is going to be active. A typical discount rule stop contains the discount amount, minutes before expiry (how many minutes before product is expired the discount is applied) and discount type (if MinutesBeforeExpiry is set to null, then it is a promotional/permanent discount). One discount rule can have multiple stops with different discount amounts. For example, users can define 30% discount 5 hours before expiry, 40% discount 3 hours before expiry and 50% discount 1 hour before expiry. In addition to that, if minutes before expiry is set to null then the discount is considered promotional/permanent which applies to products without expiry date as well. A discount rule stop object contains the following fields.\n        ","required":true,"schema":{"example":{"Name":"My discount rule","ProductIds":["426a6e92-f011-4cd2-bd45-422c431c2ea","926a6e92-f011-4cd2-bd45-6dbbc431c443"],"LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"DeviceCodes":null,"discountRuleStops":[{"MinutesBeforeExpiry":30,"DiscountAmount":15}]}}}],"responses":{"200":{"description":"Returns created discount rule"},"401":{"description":"Not authenticated."},"403":{"description":"User is not authorised to perform this action!"},"5XX":{"description":"Unexpected server error."}},"tags":["discount-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/discount-rules/{id}":{"get":{"summary":"Returns a single discount rule record given the id","description":"\n   The discount rule is returned with/without discount rule stops.\n          ","parameters":[{"name":"id","in":"path","type":"string","description":"ID of the discount rule.","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter to perform the action","required":true}],"responses":{"200":{"description":"Returns a signle record of discount rule.","schema":{"example":{"ProductIds":null,"OrganisationId":"ci.test.organization","LocationIds":null,"DeviceCodes":null,"Id":"55141c1e-ede3-48b7-ba2e-156a5cf8e78e","discountRuleStops":{"Id":"b35702d8-40de-419f-9532-3b0b01d366b9","MinutesBeforeExpiry":30,"DiscountAmount":20,"DiscountRuleId":"55141c1e-ede3-48b7-ba2e-156a5cf8e78e"}}}},"401":{"description":"Not authenticated."},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["discount-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Deletes the existing discount rule","description":"\n            Deletes the existing discount rule. Delete operation affects the corresponding discount rule stops in CASCADE fashion.\n                ","parameters":[{"name":"id","in":"path","description":"ID of the discount rule","required":true},{"in":"query","name":"group","type":"string","description":"Required parameter to perform the action","required":true}],"responses":{"200":{"description":"Successful delete operation.","schema":{"example":"Success"}},"401":{"description":"Not authenticated."},"404":{"description":"Resource not found."},"5XX":{"description":"Unexpected server error."}},"tags":["discount-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/discount-rule-stops":{"post":{"summary":"Creates a new discount rule stop ","description":"\n          Creates a new discount rule stop. POST body includes discount rule id that the stop belongs to.\n              ","parameters":[{"in":"query","name":"group","type":"string","description":"Required organisation Id parameter to perform the action","required":true},{"name":"body","in":"body","description":"Discount rule stop as an object ","required":true,"schema":{"example":{"MinutesBeforeExpiry":30,"DiscountAmount":10,"DiscountRuleId":"329cc2de-903a-454a-948d-c54688f34e2d"}}}],"responses":{"200":{"description":"Successful create operation","schema":{"example":{"Id":"109bb632-1237-4ea5-9b4a-bf526e3691ed","MinutesBeforeExpiry":30,"DiscountAmount":10,"DiscountRuleId":"329cc2de-903a-454a-948d-c54688f34e2d"}}},"401":{"description":"Not authenticated."},"403":{"description":"User is not authorised to perform this action!"},"5XX":{"description":"Unexpected server error."}},"tags":["discount-rule-stops"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/discount-rule-stops/{id}":{"delete":{"summary":"Deletes the existing discount rule stop","description":"\n          Deletes the existing discount rule stop.\n              ","parameters":[{"name":"id","in":"path","description":"ID of the discount rule stop","required":true},{"in":"query","name":"group","type":"string","description":"Required parameter to perform the action","required":true}],"responses":{"200":{"description":"Successful delete operation.","schema":{"example":"Sucess"}},"401":{"description":"Not authenticated."},"403":{"description":"User is not authorised to perform this action!"},"5XX":{"description":"Unexpected server error."}},"tags":["discount-rule-stops"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/tag-type":{"get":{"summary":"Fetches all tag types.","description":"Fetches all tag types. Includes printer related information","parameters":[],"responses":{"200":{"description":"The given tag types ","schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of tag type"},"name":{"type":"string","description":"Name of tag types"},"zplTemplate":{"type":"string","description":"ZPL script template"},"zebraPrinterConfig":{"type":"object","description":"Zebra Printer Config"}},"example":[{"id":"Bracket","name":"Bracket","hasUserMemory":false,"zplTemplate":" ^XA   \r\n        ^HL\r\n        ^FO60,80^A0N,35,30^FDfirstLine^FS\r\n        ^FO60,150^A0N,35,20^FDsecondLine^FS\r\n        ^RFW,H,2,epcLength,1^FDepcContent^FS\r\n        ^RFW,H,,4,3^FDuserMemory^FS\r\n        ^XZ","zebraPrinterConfig":{"programPosition":"B7","antenna":"A2","readPower":25}}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["tag-type"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/setting-types":{"get":{"summary":"Returns an array of all the setting types","description":"Fetches a list of all the setting types from database","parameters":[],"responses":{"200":{"description":"The fetch request is successful.","schema":{"example":[{"settingKey":"payment","isRequired":false,"dataType":"string","category":"cabinet","defaultValue":"demo","range":"mobilepay,demo","readAccessLevel":"User","writeAccessLevel":"Admin'","id":"63051c09-0b2e-405f-8a3f-5a90e0abb7da"}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["setting-types"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new setting","description":"A new setting is created in the database","parameters":[{"name":"body","in":"body","description":"Creates a new setting with provided data","required":true,"schema":{"example":{"settingKey":"payment","isRequired":true,"dataType":"string","category":"cabinet","defaultValue":"demo","range":"mobilepay,demo","readAccessLevel":"User","writeAccessLevel":"Admin"}}}],"responses":{"201":{"description":"created"},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"tags":["setting-types"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/setting-types/{id}":{"get":{"summary":"Gets a Setting type for the given settingKey","description":"Fetches the setting type for the provided settingKey in the query.","parameters":[{"name":"id","in":"path","type":"string","description":"Setting Key","required":true}],"responses":{"200":{"description":"The Setting Key is successfully fetched","schema":{"type":"object","properties":{"id":{"type":"uuid","description":"Id of the setting-keys"},"settingKey":{"type":"string","description":"Setting key."},"isRequired":{"type":"boolean","description":"true or false"},"dataType":{"type":"string","description":"Data Type"},"category":{"type":"string","description":"category"},"defaultValue":{"type":"string","description":"Default value"},"range":{"type":"string","description":"range"},"readAccessLevel":{"type":"string","description":"Read Access Level"},"writeAccessLevel":{"type":"string","description":"Write Access Level"}},"example":{"settingKey":"payment","isRequired":false,"dataType":"string","category":"cabinet","defaultValue":"demo","range":"mobilepay,demo","readAccessLevel":"User","writeAccessLevel":"Admin","id":"63051c09-0b2e-405f-8a3f-5a90e0abb7da"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"404":{"description":"Not found. Requested setting key with the settingkey is not found."},"5XX":{"description":"Unexpected server error."}},"tags":["setting-types"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Update Setting-type values for the given setting key","description":"Expects settingKey value in the path and setting-type values in the body and updates the database. The id which is passed in the path is used as settingKey value and the setting type is used based on that.","parameters":[{"in":"path","name":"id","type":"string","description":"Setting Key","required":true},{"in":"body","name":"body","type":"string","required":true,"schema":{"example":{"isRequired":true,"dataType":"string","category":"cabinet","defaultValue":"demo value","range":"mobilepay,demo","readAccessLevel":"User","writeAccessLevel":"Admin'"}}}],"responses":{"200":{"description":"The Setting values are updated successfully.","schema":{"example":{"settingKey":"payment","isRequired":true,"dataType":"string","category":"cabinet","defaultValue":"demo","range":"mobilepay,demo","readAccessLevel":"User","writeAccessLevel":"Admin'","íd":"63051c09-0b2e-405f-8a3f-5a90e0abb7da"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["setting-types"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/release-version":{"get":{"summary":"Returns an array of all the release versions","description":"Fetches a list of all the release versions from database","parameters":[],"responses":{"200":{"description":"The fetch request is successful.","schema":{"example":[{"osVersion":"2.1.1","deviceType":"smartCabinet","deviceSubType":"IF2","releaseTagVersion":"1.0.0","updatedAt":"2021-04-08T08:07:57.853Z","isDefaultReleaseVersion":true,"id":"b7258e34-d726-44c3-b974-11f111a2f5a2","releaseContent":"This is some release notes or URL to the release notes"},{"osVersion":"1.1.1","deviceType":"smartCabinet","deviceSubType":"IF3","releaseTagVersion":"1.0.0","updatedAt":"2021-04-08T08:06:38.603Z","isDefaultReleaseVersion":false,"id":"47437533-05ea-4767-b984-f6e372232958","releaseContent":"This is some release notes or URL to the release notes"}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new release Version","description":"A new release version is created in the database","parameters":[{"name":"body","in":"body","description":"Creates a new release version with provided data","required":true,"schema":{"example":{"osVersion":"1.1.1","deviceType":"smartCabinet","deviceSubType":"IF2","releaseTagVersion":"1.0.0","isDefaultReleaseVersion":false,"releaseContent":"This is some release notes or URL to the release notes"}}}],"responses":{"201":{"description":"created"},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"tags":["release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/release-version/{id}":{"put":{"summary":"Update release version with the given Id","description":"Expects release version as API request body updates the database","parameters":[{"in":"id","name":"id","type":"string","description":"The id of the release version to make update","required":false},{"in":"body","name":"body","type":"string","required":true,"schema":{"example":{"osVersion":"1.0.1","deviceType":"smartCabinet","deviceSubType":"IF2","releaseTagVersion":"1.0.0","isDefaultReleaseVersion":true,"releaseContent":"This is some release notes or URL to the release notes"}}}],"responses":{"200":{"description":"The release version is updated successfully.","schema":{"example":{"osVersion":"1.0.1","deviceType":"smartCabinet","releaseTagVersion":"1.0.0","updatedAt":"2021-04-08T09:35:12.822Z","isDefaultReleaseVersion":true,"id":"b7258e34-d726-44c3-b974-11f111a2f5a2","releaseContent":"This is some release notes or URL to the release notes"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/os/{id}":{"patch":{"summary":"Updates device's OS version ","description":"The OS version of device will be updated","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Target cabinet's device code","required":true},{"in":"body","name":"body","type":"string","required":true,"schema":{"example":{"osVersion":"1.0.2"}}}],"responses":{"200":{"description":"Device OS version is updated successfully","schema":{"example":{"deviceCode":"623bb422-198c-4818-813b-971906c6522c","osVersion":"1.0.2"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["os"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/device-component/{id}":{"get":{"summary":"Returns components in device","description":"Returns only active components by default. Set query param \"includeInactive\" to \"true\" to also fetch components marked as inactive","parameters":[{"name":"id","in":"path","type":"string","description":"Device id","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter if user belongs to multiple organizations","required":true},{"name":"includeInactive","in":"query","type":"string","description":"Set to \"true\" to include also inactive components in response","required":false}],"responses":{"200":{"description":"Returns array of components","schema":{"example":[{"componentId":"abcd","deviceId":"c1840690-93ad-4b6f-baf5-68e4ff65c65d","type":"test","name":"test test","componentInfo":{"a":"aaa","b":666,"c":{"d":"ddd"}},"reportedFrom":"test","active":true,"timestamp":"2021-05-05T07:44:58.000Z"}]}},"401":{"description":"Not authenticated."},"404":{"description":"Device not found."},"5XX":{"description":"Unexpected server error."}},"tags":["device-component"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"patch":{"summary":"Saves device components to database","description":"Performs an upsert of device components in database. In addition, will mark any existing device components of the types that are being updated as inactive if they are not included in request. For example, if request contains components of type \"reader\" and \"temperature_sensor\": any components of device of type \"reader\" and \"temperature_sensor\" will be marked as inactive if componentId is not matched to those in request body (other device componenents with different types will not be affected).","parameters":[{"name":"id","in":"path","type":"string","description":"Device id","required":true},{"name":"body","in":"body","description":"Device components to save. Does not need to contain all components in device in a single request. However, the endpoint does assume that all component types that are updated are accounted for in request. In other words, if you send a component of a specific device type in request then endpoint assumes that any other components of that type that already exist are no longer in device.","required":true,"schema":{"example":[{"componentId":"AAA","type":"test","name":"test 1","componentInfo":{"a":"aaa","b":666,"c":{"d":"ddd"}},"reportedFrom":"test","active":true},{"componentId":"BBB","type":"test","name":"test 2"},{"componentId":"CCC","type":"test_reader"}]}}],"responses":{"200":{"description":"Returns operation result as object. Key \"saved\" contains the components that were saved while \"markedInactive\" contains previous components that were marked inactive as a result of request. In the example, component with id \"abcd\" existed with \"test\" type before request. Components that have been marked inactive earlier will continue to appear in \"markedInactive\"","schema":{"example":{"saved":[{"componentId":"AAA","type":"test","name":"test 1","componentInfo":{"a":"aaa","b":666,"c":{"d":"ddd"}},"reportedFrom":"test","active":true,"deviceId":"c1840690-93ad-4b6f-baf5-68e4ff65c65d","timestamp":"2021-05-05T07:44:23.000Z"},{"componentId":"BBB","type":"test","name":"test 2","deviceId":"c1840690-93ad-4b6f-baf5-68e4ff65c65d","componentInfo":{},"reportedFrom":"unknown","active":true,"timestamp":"2021-05-05T07:44:23.000Z"},{"componentId":"CCC","type":"test_reader","deviceId":"c1840690-93ad-4b6f-baf5-68e4ff65c65d","name":"test_reader","componentInfo":{},"reportedFrom":"unknown","active":true,"timestamp":"2021-05-05T07:44:23.000Z"}]}}},"401":{"description":"Not authenticated."},"404":{"description":"Device not found."},"5XX":{"description":"Unexpected server error."}},"tags":["device-component"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Removes device components","description":"Removes device components or marks them as inactive if onlyMakeInactive query param is set to \"true\"","parameters":[{"name":"id","in":"path","description":"Device id","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter if user belongs to multiple organizations","required":true},{"in":"query","name":"onlyMakeInactive","type":"string","description":"Will make all device components inactive instead of deleting when query param is set to \"true\". Will cause change in returned data schema so it returns in format: { markedInactive: [{ componentId: xxx, deviceId: xxx}...] }","required":false},{"in":"query","name":"removeInactive","type":"string","description":"Will cause all inactive device components to be removed and not active. Query param \"onlyMakeInactive\" overwrites this query param.","required":false}],"responses":{"200":{"description":"Device components removed","schema":{"example":{"removedCount":3}}},"401":{"description":"Not authenticated."},"403":{"description":"Cabinet not found."},"5XX":{"description":"Unexpected server error."}},"tags":["device-component"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/device-release-version":{"get":{"summary":"Returns an array of objects that include device information, current version and newer versions.","description":"Returns an array of objects that include device information, current version and newer versions.","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"Returns an array of device release versions.","schema":{"type":"object","properties":{"deviceId":{"type":"string","description":"Device id"},"deviceName":{"type":"string","description":"Device name"},"deviceType":{"type":"string","description":"Device type"},"deviceOsVersion":{"type":"string","description":"Device OS version"},"deviceSubType":{"type":"string","description":"Device subType"},"currentVersion":{"type":"string","description":"Current version of the device"},"scheduling":{"type":"array","description":"List of scheduled jobs to update device version"},"newerVersions":{"type":"array","description":"List of the newer software versions"},"applicableVersions":{"type":"array","description":"List of the applicable software versions for the device"}},"example":[{"deviceId":"deviceId","deviceName":"deviceName","deviceType":"encodingStation","deviceOsVersion":"1.0.0","deviceSubType":"None","currentVersion":"1.0.0","scheduling":[],"newerVersions":[],"applicableVersions":[]},{"deviceId":"deviceId","deviceName":"deviceName","deviceType":"smartCabinet","deviceOsVersion":"1.0.4","deviceSubType":"None","currentVersion":"1.1.0","scheduling":[],"newerVersions":[{"releaseContent":"https://cdn.selflystore.com/release-notes/Selfly_2023_May_release.pdf","version":"1.1.3","notificationStartTime":"2023-06-15T15:02:02.000Z","notificationEndTime":"2023-10-30T15:02:02.000Z"}],"applicableVersions":[{"releaseContent":null,"version":"1.1.0"},{"releaseContent":null,"version":"1.1.2"},{"releaseContent":"https://cdn.selflystore.com/release-notes/Selfly_2023_May_release.pdf","version":"1.1.3"}]}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["device-release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/device-release-version/{id}":{"get":{"summary":"Returns current release version of the provided deviceId","description":"Retrives an release version from IOT Hub degitwin for the requested deviceId","parameters":[{"name":"id","in":"path","type":"string","description":"Target cabinet's device code","required":true}],"responses":{"200":{"description":"The fetch request is successful.","schema":{"example":{"release":"1.0.1"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["device-release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates device release version for the provided device id","description":"Expects release version in the request body and updates the IOT Hub digitwin","parameters":[{"in":"id","name":"id","type":"string","description":"The deviceId of the cabinet to make update","required":false},{"in":"body","name":"body","type":"string","required":true,"schema":{"example":{"release":"1.0.2"}}}],"responses":{"200":{"description":"The release version is updated successfully.","schema":{"example":{"tags":{"cardPayment":"nayax","release":"1.0.2","deviceType":"smartCabinet","organization":"Fazer"}}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["device-release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Removes the scheduled device task with the given Id","description":"Expects an Id of an scheduled device document and deletes it","parameters":[{"in":"id","name":"id","type":"string","description":"Id of an scheduled device document to delete.","required":true}],"responses":{"200":{"description":"The scheduled device document is deleted successfully.","schema":{"type":"object","properties":{"scheduleId":{"type":"string","description":"Scheduled document id"},"deviceId":{"type":"string","description":"Device id"}},"example":{"scheduleId":"657028d2749fa03d515123d5","deviceId":"if-8-3-2022-b43bbf2"}}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"403":{"description":"User is not authorized to execute command"},"404":{"description":"Scheduling with the provided id not found"},"5XX":{"description":"General server error happened."}},"tags":["device-release-version"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/product-category":{"get":{"summary":"Service for produt categories ","description":"CRUD service for product categories","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"query","name":"all","type":"string","description":"Optional argument to fetch all the (active, deactive) product categories.","required":false,"example":"true"}],"responses":{"200":{"description":"The list of Product Categories for the requested organization.","schema":{"example":[{"id":"24177","name":"Salads","description":"Category for salads","organization_id":"Selfly Demo","status":1},{"id":"24124","name":"Breads","description":"Category for breads","organization_id":"Selfly Demo","status":1}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["product-category"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates new Product Category","description":"\n    Creates new Product category. A Product category entry should belong to an organization and the organization ID should be passed in the parameters.\n        ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"name":"body","in":"body","description":"The new Product category data.","required":true,"schema":{"example":{"name":"Drinks","description":"Category for drinks"}}}],"responses":{"201":{"description":"Product category was created successfully.","schema":{"example":{"id":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d","name":"Drinks","description":"Category for drinks","organization_id":"Selfly Demo"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["product-category"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/product-category/{id}":{"put":{"summary":"Updates an existing Product Category","description":"\n    Updates an existing Product category. A Product category entry should belong to an organization and the organization ID should be passed in the parameters. Also the Product category Id should be passed in parameters.\n        ","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false},{"in":"path","name":"id","type":"string","description":"The Id of the Product category to be updated","required":true},{"name":"body","in":"body","description":"The updated Product category data.","required":true,"schema":{"example":{"name":"Soft drinks","Description":"Category for soft drinks"}}}],"responses":{"201":{"description":"Product category is updated successfully.","schema":{"example":{"id":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d","name":"Soft drinks","description":"Category for soft drinks","organization_id":"Selfly Demo"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["product-category"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Deletes a Product Category","description":"\n    Deletes a Product category entry from database based on the Product category Id. In case the Product category is associated with any products, the request to delete will be rejected\n    ","parameters":[{"name":"id","in":"path","description":"Product Category to delete","required":true},{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"Product category deleted","schema":{"example":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d"}},"400":{"description":"Invalid product type supplied"},"404":{"description":"Encoding instruction not found"},"5XX":{"description":"Unexpected server error."}},"tags":["product-category"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/discounts":{"get":{"summary":"Returns all the v2 discount rules of an organisation","description":"\n              Get all the v2 discount rules that belong to an organisation.\n                  ","parameters":[{"in":"query","name":"group","type":"string","description":"Required organisation Id parameter to perform the action","required":true}],"responses":{"200":{"description":"Returns the payload that contains an array of discount rule objects.","schema":{"example":[{"Type":"bundle","Status":1,"Name":"My bundle rule 2","LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"DeviceCodes":null,"DiscountData":{"pricingType":"item","bundleDiscountData":[{"id":"2020230120024","itemType":"product","bundleDiscountType":"percentage","amount":2,"value":25},{"id":"48845b2f-973f-4ee6-8be8-9d8d0f5bd65f","itemType":"productCategory","amount":1},{"id":"07b0b488-4349-4b82-81b4-a6d6af99180d","amount":1,"itemType":"product"}],"Scheduling":{"startDate":"Thu Apr 21 2022 00:00:00 GMT+0300","endDate":"Thu Apr 26 2022 23:59:00 GMT+0300","startTime":"04:00","endTime":"12:00","recurrenceDays":["Mon","Wed"]}},"isUserRestricted":true,"userIds":["aaa1"]},{"Type":"expiry","Status":1,"Name":"My expiry rule","ProductIds":["426a6e92-f011-4cd2-bd45-422c431c2ea","926a6e92-f011-4cd2-bd45-6dbbc431c443"],"LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"ProductCategoryIds":null,"DeviceCodes":null,"DiscountData":{"discountStops":[{"id":"242ggas-414-gss","discountAmount":33,"minsBeforeExpiry":330},{"id":"242wwwfws22-sssaa","discountAmount":50,"minsBeforeExpiry":180}]}},{"Type":"scheduled","Status":3,"Name":"My discount rule","ProductIds":["426a6e92-f011-4cd2-bd45-422c431c2ea","926a6e92-f011-4cd2-bd45-6dbbc431c443"],"LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"ProductCategoryIds":null,"DeviceCodes":null,"DiscountData":{"discountAmount":33,"startDate":"Thu Apr 21 2022 00:00:00 GMT+0300","endDate":"Thu Apr 26 2022 23:59:00 GMT+0300","startTime":"00:00","endTime":"23:59","recurrenceDays":["Mon","Wed"]}},{"Type":"bundle","Status":1,"Name":"My discount rule","LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"DeviceCodes":null,"DiscountData":{"pricingType":"bundle","bundlePricing":{"type":"percentage","value":22},"bundleDiscountData":[{"id":"07b0b488-4349-4b82-81b","amount":2,"itemType":"productCategory"},{"id":"07b0b488-4349-4b82-81b4-a6d6af99180d","amount":2,"itemType":"product","bundleDiscountType":"fixed","value":10}],"Scheduling":{"startDate":"Thu Apr 21 2022 00:00:00 GMT+0300","endDate":"Thu Apr 26 2022 23:59:00 GMT+0300","startTime":"04:00","endTime":"12:00","recurrenceDays":["Mon","Wed"]}}}]}},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["discounts"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new v2 discount rule ","description":"\n    Organisations can create a discount rules for expiring products or promotional purposes. If the discount rule is created for expiring products, discount rule stops are also necessary to define when the discount will be applied to expiring products.\n                ","parameters":[{"in":"query","name":"group","type":"string","description":"Required organisation Id parameter to perform the action","required":true},{"name":"body","in":"body","description":"In order to apply discounts to products regardless of whether they are expiring or not, you need to first create a discount rule via discount rules endpoint. While creating the discount rule, you can decide where and to which products the discount rule will be visible. This operation is called filtering and done through the parameters in the payload.\n\n        - If locations filter is set to a certain location or locations, the discount will ONLY be visible to a certain location or locations but if set to null, the discount rule is visible to all locations.\n        - If devices filter is set to a certain device or devices, the discount will ONLY be visible to a certain device or devices but if set to null, the discount rule is visible to all devices.\n        - If products filter is set to a certain product or products, the discount will ONLY be visible to a certain product or products but if set to null, the discount rule is visible to all products.\n        - If product category filter is set to a certain product category or products categories, the discount will ONLY be visible to a certain product category or products categories but if set to null, the discount rule is visible to all products.\n        \n        ### The use of multiple filters at the same time.\n        \n        You can also create combination of the filters with care. In order to use multiple filters at the same time, you need to keep in mind that you can set either locations or devices filter along with products and product category filter. Also product and productCategory filter cannot be used same time. You cannot use location and device filters at the same time.\n        After setting either locations or devices filter, you can set productIds. For example, if you want a discount rule to be active only for Tampere and for a few products, you can set the locations and productIds filters. On the other hand, if you want a discount to be active for certain cabinets for certain products, you should set devices and products filters.\n        Each discount rule must have a discount rule stop object which indicates when and how the discount is going to be active. A typical discount rule stop contains the discount amount, minutes before expiry (how many minutes before product is expired the discount is applied) and discount type (if MinutesBeforeExpiry is set to null, then it is a promotional/permanent discount). One discount rule can have multiple stops with different discount amounts. For example, users can define 30% discount 5 hours before expiry, 40% discount 3 hours before expiry and 50% discount 1 hour before expiry. In addition to that, if minutes before expiry is set to null then the discount is considered promotional/permanent which applies to products without expiry date as well. A discount rule stop object contains the following fields.\n        ","required":true,"schema":{"example":{"Type":"bundle","Status":1,"Name":"My discount rule","LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"DeviceCodes":null,"isUserRestricted":true,"userIds":["aaa1"],"DiscountData":{"pricingType":"bundle","bundlePricing":{"type":"percentage","value":22},"bundleDiscountData":[{"id":"07b0b488-4349-4b82-81b","amount":2,"itemType":"productCategory","bundleDiscountType":"free","value":100},{"id":"2020230120024","amount":2,"itemType":"product"},{"id":"07b0b488-4349-4b82-81b4-a6d6af99180d","amount":2,"itemType":"product"}],"Scheduling":{"startDate":"Thu Apr 21 2022 00:00:00 GMT+0300","endDate":"Thu Apr 26 2022 23:59:00 GMT+0300","startTime":"04:00","endTime":"12:00","recurrenceDays":["Mon","Wed"]}}}}}],"responses":{"200":{"description":"Returns created v2 discount rule"},"401":{"description":"Not authenticated."},"403":{"description":"User is not authorised to perform this action!"},"5XX":{"description":"Unexpected server error."}},"tags":["discounts"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/discounts/{id}":{"get":{"summary":"Returns a single v2 discount rule record given the id","description":"\n   The v2 discount rule is returned\n          ","parameters":[{"name":"id","in":"path","type":"string","description":"ID of the discount rule.","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter to perform the action","required":true}],"responses":{"200":{"description":"Returns a single record of v2 discount rule.","schema":{"example":{"Type":"scheduled","Status":1,"ProductIds":null,"OrganisationId":"Selfly Demo","LocationIds":null,"DeviceCodes":null,"ProductCategoryIds":null,"Id":"55141c1e-ede3-48b7-ba2e-156a5cf8e78e","DiscountData":{"DiscountAmount":33,"startDate":"Thu Apr 21 2022 00:00:00 GMT+0300","endDate":"Thu Apr 26 2022 23:59:00 GMT+0300","startTime":"00:00","endTime":"23:59","recurrenceDays":["Mon","Wed"]},"isUserRestricted":true,"userIds":["aaa1"]}}},"401":{"description":"Not authenticated."},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["discounts"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates v2 discount rule ","description":"Updates discount rule with edited data. Can be used for updating discount contents or disabling discount","parameters":[{"name":"id","in":"path","type":"string","description":"ID of the discount rule.","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter to perform the action","required":true},{"name":"body","in":"body","description":"The updated Product category data.","required":true,"schema":{"example":{"Type":"scheduled","Status":3,"Name":"My updated discount rule","ProductIds":["426a6e92-f011-4cd2-bd45-422c431c2ea","926a6e92-f011-4cd2-bd45-6dbbc431c443"],"LocationIds":["999a6e92-f011-4cd2-bd45-6dbbc431c2bb","323r5e92-f011-4cd2-b2f5-y774c431c2rt"],"ProductCategoryIds":null,"DeviceCodes":null,"DiscountData":{"discountAmount":33,"startDate":"Thu Apr 28 2022 00:00:00 GMT+0300","endDate":"Thu Apr 29 2022 23:59:00 GMT+0300","startTime":"06:00","endTime":"13:59","recurrenceDays":["Mon","Wed"]},"isUserRestricted":true,"userIds":[]}}}],"responses":{"200":{"description":"Returns updated v2 discount rule"},"401":{"description":"Not authenticated."},"403":{"description":"User is not authorised to perform this action!"},"5XX":{"description":"Unexpected server error."}},"tags":["discounts"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v2/revenue-italian-market/{id}":{"get":{"summary":"Get revenue of a cabinet.","description":"\n      The endpoint fetches the revenue of the given cabinet for a total and certain period of time.\n              ","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Device code of the cabinet of interest.","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter to perform the action","required":true},{"name":"counterIndex","in":"query","type":"number","description":"Optional parameter to get the revenues in the past by the counter index. If set, the revenue that belongs to the counter index will be returned.","required":false}],"responses":{"200":{"description":"Returns a payload with revenue information of a cabinet.","schema":{"example":{"ActualDataCollectionDate":"2021-09-22T06:07:18.533Z","ActualDataCollectionIdx":5,"PreviousDataCollectionDate":"2021-09-19T06:07:02.287Z","PreviousDataCollectionIdx":4,"MasterSN":"a3d2b72c-83e9-411b-8420-5324b7108f99","ValoriCumulati":{"venduto":2369119,"vendutoContante":0,"vendutoNoContante":2369119,"incassato":0,"incassatoRicarica":0,"incassatoVendita":0,"totaleResoTubiResto":0,"totaleCaricatoTubiResto":0,"totaleResoManualeTubiResto":0,"totaleCaricatoManualeTubiResto":0},"ValoriPeriodo":{"venduto":0,"vendutoContante":0,"vendutoNoContante":0,"incassato":0,"incassatoRicarica":0,"incassatoVendita":0,"totaleResoTubiResto":0,"totaleCaricatoTubiResto":0,"totaleResoManualeTubiResto":0,"totaleCaricatoManualeTubiResto":0}}}},"400":{"description":"Device cannot be parsed from header."},"401":{"description":"Not authenticated."},"403":{"description":" Cabinet is not found in your organization"},"404":{"description":"Device does not exist or payload is empty"},"5XX":{"description":"Unexpected server error."}},"tags":["revenue-italian-market"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions":{"post":{"summary":"Creates a new session for cloud payment.","description":"Creates a new session for the cloud payment provider in the request object.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentSessionsCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsCreateSuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/PaymentSessionsCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentSessionsCreateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentSessionsCreateForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsCreateNotFoundResponse"}}},"tags":["Session Integrator"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/{id}":{"delete":{"summary":"Changes the cloud payment session status as timeout.","description":"Expects a transactionId, deviceCode and paymentProvider in the request parameters. \nIf the payment provider does not return any response in a period of time, then this endpoint updates the transaction status and session status as timeout.","parameters":[{"in":"query","name":"deviceCode","type":"string","description":"Device code of the current cabinet.","required":true},{"in":"query","name":"transactionId","type":"string","description":"Session Id of the current transaction.","required":true},{"in":"query","name":"paymentProvider","type":"string","description":"Payment provider information.","required":true}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsDeleteSuccessResponse"}},"400":{"summary":"Bad Request","schema":{"$ref":"#/definitions/PaymentSessionsDeleteBadRequestResponse"}},"401":{"summary":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentSessionsDeleteNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsDeleteNotFoundResponse"}}},"tags":["Session Cabinet"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/reversal":{"post":{"summary":"Reverses the cloud payment transaction.","description":"Expects deviceCode, transactionId, paymentProvider and some other properties in the body,\nthen cancels the cloud payment transaction, updates current transaction status as no purchase.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentSessionsReversalCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsReversalCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentSessionsReversalCreateBadRequestResponse"}},"401":{"description":"Not Authenticated.","schema":{"$ref":"#/definitions/PaymentSessionsReversalCreateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentSessionsReversalCreateForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsReversalCreateNotFoundResponse"}}},"tags":["Session Integrator"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/capture":{"post":{"summary":"Completes the cloud payment transaction.","description":"Expects some transactional parameters like total price, items and other necessary properties in the body, then completes cloud payment transaction successfully.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","schema":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsCaptureCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentSessionsCaptureCreateBadRequestResponse"}},"401":{"description":"Not Authenticated.","schema":{"$ref":"#/definitions/PaymentSessionsCaptureCreateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentSessionsCaptureCreateForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsCaptureCreateNotFoundResponse"}}},"tags":["Session Integrator"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/items/{id}":{"put":{"summary":"Sends the purchased items information to the payment provider.","description":"Expects some items information like purchase list, total sum and other necessary properties in the body, then sends a new capture request to payment provider.\nIf the capture call is success it returns true, otherwise returns false.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentItemsUpdateRequest"}}],"responses":{"200":{"summary":"Success","description":"Success","schema":{"$ref":"#/definitions/PaymentItemsUpdateSuccessResponse"}},"400":{"summary":"Bad Request","description":"Bad Request","schema":{"$ref":"#/definitions/PaymentItemsUpdateBadRequestResponse"}},"401":{"summary":"Not authenticated","description":"Not authenticated","schema":{"$ref":"#/definitions/PaymentItemsUpdateNotAuthenticatedResponse"}},"404":{"summary":"Not Found","description":"Not Found","schema":{"$ref":"#/definitions/PaymentItemsUpdateNotFoundResponse"}}},"tags":["Session Cabinet"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/failure":{"post":{"summary":"Cancels the cloud payment transaction.","description":"Expects some properties in the body, then updates the related cloud payment transaction record as failed.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentSessionsFailureCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsFailureSuccessResponse"}},"400":{"description":"BadRequest.","schema":{"$ref":"#/definitions/PaymentSessionsFailureBadRequestResponse"}},"401":{"description":"Not Authenticated.","schema":{"$ref":"#/definitions/PaymentSessionsFailureNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentSessionsFailureForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsFailureNotFoundResponse"}}},"tags":["Session Integrator"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/cancel":{"post":{"summary":"Cancels the session by calling payment provider.","description":"It cancels the current cloud session by calling payment provider reversal endpoint and updates the related transaction record status based on the payment provider response. ","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentSessionsCancelCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsCancelCreateSuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/PaymentSessionsCancelCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentSessionsCancelCreateNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsCancelCreateNotFoundResponse"}}},"tags":["Session Cabinet"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/pos":{"post":{"summary":"Send some pre-defined actions to the terminal or pos.","description":"Expects deviceCode, paymentProvider and action in body and send a request to payment provider.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/PaymentPosCreateRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/PaymentPosCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentPosUpdateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentPosUpdateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentPosUpdateForbiddenResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/pos/{id}":{"put":{"summary":"Updates device status based on operation type.","description":"Expects properties in the body, deviceCode in the parameter and updates the cabinet status based on the operation property.","consumes":["application/json","text/json"],"parameters":[{"in":"query","name":"deviceCode","type":"string","description":"Device code to be updated.","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/PaymentPosUpdateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentPosUpdateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentPosUpdateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentPosUpdateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentPosUpdateForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentPosUpdateNotFoundResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/heartBeat":{"post":{"summary":"Updates device heart beat time and status.","description":"Expects some properties in the body and updates the cabinet heart beat status. If the current status of the cabinet is OOS,\nthen it will update cabinet status to normal mode.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentHeartBeatCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentHeartBeatCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentHeartBeatCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentHeartBeatCreateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentHeartBeatCreateForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentHeartBeatCreateNotFoundResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/device":{"post":{"summary":"Gets device-terminal information from payment provider..","description":"Expects deviceCode and paymentProvider in body and send a request to payment provider to fetch terminal information. Then saves this information to the database.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/PaymentDeviceCreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PaymentDeviceCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentDeviceCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentDeviceCreateNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentDeviceCreateNotFoundResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/device/{id}":{"put":{"summary":"Informs payment provider about current cabinet status like: normal, out of service etc.","description":"Expects some properties in the body, deviceCode as a parameter and send this information to payment provider.","consumes":["application/json","text/json"],"parameters":[{"in":"query","name":"deviceCode","type":"string","description":"Device code to be updated.","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/PaymentDevicePutRequest"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PaymentDevicePutSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentDevicePutBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentDevicePutNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentDevicePutNotFoundResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/ping":{"get":{"summary":"Returns the current status of the server.","description":"Returns the current status of the server.","consumes":["application/json","text/json"],"parameters":[],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PaymentPingFindSuccessResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentPingFindNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentPingFindForbiddenResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/remaining-amount":{"post":{"summary":"Charges for remaining amount of cloud payment transaction.","description":"Charges for remaining amount with device code, session id. It updates current session status as remaining amount start.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentRemainingAmountCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentRemainingAmountCreateSuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/PaymentRemainingAmountCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentRemainingAmountCreateNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentRemainingAmountCreateNotFoundResponse"}}},"tags":["Session Cabinet"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/remaining-amount/cancel":{"post":{"summary":"Cancel for remaining amount of cloud payment transaction.","description":"Cancels for remaining amount with device code, transaction id, reference. It updates current session status as canceled.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/RemainingAmountCancelCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/RemainingAmountCancelCreateSuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/RemainingAmountCancelCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/RemainingAmountCancelCreateNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/RemainingAmountCancelCreateNotFoundResponse"}}},"tags":["Session Cabinet"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/reset":{"post":{"summary":"Resets the cloud payment session.","description":"Sends Normal message to payment provider and removes the cloud payment session from the cache for device and payment provider.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/PaymentSessionsResetCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsResetSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentSessionsResetBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/PaymentSessionsResetNotAuthenticatedResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsResetNotFoundResponse"}}},"tags":["Session Cabinet"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/sessions/purchase":{"post":{"summary":"Purchase acknowledgement for remaining amount","description":"Expects some transactional parameters like success, payment provider and other necessary properties in the body, then completes cloud payment transaction successfully.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","schema":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequest"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateBadRequestResponse"}},"401":{"description":"Not Authenticated.","schema":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateForbiddenResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateNotFoundResponse"}}},"tags":["Session Integrator"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/payment-provider":{"get":{"summary":"Fetches all payment provider names","description":"Fetches all payment provider names","consumes":["application/json","text/json"],"parameters":[],"responses":{"200":{"description":"The list of payment providers","schema":{"type":"array","example":["PaymentProvider1","PaymentProvider2","PaymentProvider3"]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["Payment-Provider"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Adds new payment provider information","description":"Expects some properties in the body and creates new payment provider information.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/PostRequestBodyAndSuccessResponse"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PostRequestBodyAndSuccessResponse"}},"400":{"description":"BadRequest"},"401":{"description":"Not Authenticated"}},"tags":["Payment-Provider"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/payment-provider/{id}":{"get":{"summary":"Fetches all payment provider information created by the organization","description":"Fetches all payment provider information created by the organization","parameters":[{"in":"path","name":"organization","type":"string","description":"Id of the organization","required":true}],"responses":{"200":{"description":"Success","schema":{"example":{"Provider1":{"name":"provider1_name","baseUrl":"provider1_baseUrl","apiKey":"provider1_apiKey","organization":"creator organization"},"Provider2":{"name":"provider2_name","baseUrl":"provider2_baseUrl","apiKey":"provider2_apiKey","organization":"creator organization"}}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"}},"tags":["Payment-Provider"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates a payment provider information","description":"Expects some properties in the body and updates the payment provider information.","consumes":["application/json","text/json"],"parameters":[{"in":"path","name":"organization","type":"string","description":"Id of the organization","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/PutRequestBody"}}],"responses":{"201":{"description":"Success","schema":{"$ref":"#/definitions/PutSuccessResponse"}},"400":{"description":"BadRequest"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"tags":["Payment-Provider"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/payment-provider/resources/organizations":{"get":{"summary":"Fetches all organization names that are using the payment provider's payment method in their devices","description":"Fetches all organization names that are using the payment provider's payment method in their devices","consumes":["application/json","text/json"],"parameters":[],"responses":{"200":{"description":"The list of organizations","schema":{"type":"array","example":[{"organizationId":"organization1"},{"organizationId":"organization2"},{"organizationId":"organization3"}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["Payment-Provider"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/payment-provider/resources/devices":{"get":{"summary":"Fetches all device codes that are using the payment provider's payment method","description":"Fetches all device codes  that are using the payment provider's payment method","consumes":["application/json","text/json"],"parameters":[],"responses":{"200":{"description":"The list of devices","schema":{"type":"array","example":[{"deviceCode":"deviceCode1","organizationId":"organizationId1","preAuthCurrency":"EUR","preAuthExponent":2,"preAuthAmount":1000,"terminalReference":"terminalId1"},{"deviceCode":"deviceCode2","organizationId":"organizationId1","preAuthCurrency":"EUR","preAuthExponent":2,"preAuthAmount":1000,"terminalReference":"terminalId2"},{"deviceCode":"deviceCode3","organizationId":"organizationId3","preAuthCurrency":"EUR","preAuthExponent":2,"preAuthAmount":1000,"terminalReference":"terminalId3"}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["Payment-Provider"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/payment/validate-user-key":{"post":{"summary":"Validates a user key used for payment.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/CreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/CreateValidateUserKeySuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/CreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/CreateNotAuthenticatedResponse"}}},"description":"Creates a new resource with data.","tags":["payment"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/consumer-feedback":{"get":{"summary":"Returns all the consumer responses of an organisation","description":"\n                Get all the consumer responses that belong to an organisation. DeviceCode is used to determine wanted organization.\n                    ","parameters":[{"in":"query","name":"deviceCode","type":"string","description":"Required device code parameter to perform the action","required":true}],"responses":{"200":{"description":"Returns the payload that contains an array of consumer feedback objects.","schema":{"example":[{"id":"1242423423-34124fas-12","wish":"Good luck!","rating":"33","deviceCode":"429099ba-57c1-4882-a3cc-e3c010242fb3","orderId":"13213123412124-asffas-2124124","transactionTimestamp":"2022-05-24T13:21:05.055Z","created":"2022-10-24T13:21:05.055Z"},{"id":"325ds-42423423-34124fas-12","wish":"Rock on!","rating":"100","deviceCode":"qa-if-07-07-2021-8741","orderId":"94213122112124-agfffas-2124124","transactionTimestamp":"2022-05-24T13:21:05.055Z","created":"2022-08-24T13:21:05.055Z"}]}},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["consumer-feedback"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new consumer feedback ","description":"Operation to create a new consumer feedback","parameters":[{"name":"body","in":"body","description":"Body of consumer feedback","required":true,"schema":{"example":{"wish":"Rock on!","rating":"100","deviceCode":"qa-if-07-07-2021-8741","timestamp":"1671713512"}}}],"responses":{"200":{"description":"Returns created consumer feedback","schema":{"example":{"id":"1242423423-34124fas-12","wish":"Good luck!","rating":"0","deviceCode":"429099ba-57c1-4882-a3cc-e3c010242fb3","orderId":"13213123412124-asffas-2124124","transactionTimestamp":"2022-05-24T13:21:05.055Z","created":"2022-10-24T13:21:05.055Z"}}},"401":{"description":"Not authenticated."},"403":{"description":"User is not authorised to perform this action!"},"5XX":{"description":"Unexpected server error."}},"tags":["consumer-feedback"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/consumer-feedback/{id}":{"get":{"summary":"Returns a single consumer feedback record given the id","description":"The consumer feedback is returned","parameters":[{"name":"id","in":"path","type":"string","description":"ID of the consumer feedback.","required":true},{"name":"group","in":"query","type":"string","description":"Required organisation Id parameter to perform the action","required":true}],"responses":{"200":{"description":"Returns a single record of consumer feedback","schema":{"example":{"id":"1242423423-34124fas-12","wish":"Good luck!","rating":"66","deviceCode":"429099ba-57c1-4882-a3cc-e3c010242fb3","orderId":"13213123412124-asffas-2124124","transactionTimestamp":"2022-05-24T13:21:05.055Z","created":"2022-10-24T13:21:05.055Z"}}},"401":{"description":"Not authenticated."},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["consumer-feedback"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/encodingDevices":{"get":{"summary":"Fetches encoding devices belonging to group","description":"Fetches encoding devices (Encoding station and selfly encode) belonging to group","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. If only belongs to 1 group then defaults to using that","required":false}],"responses":{"200":{"description":"The list of encoding devices for the requested group","schema":{"type":"object","properties":{"id":{"type":"string","description":"Device id"},"organizationId":{"type":"string","description":"Organization that device belongs to"},"deviceCode":{"type":"string","description":"Device code"},"name":{"type":"string","description":"Device name"},"lifeCycleStatus":{"type":"string","description":"Device life cycle status"},"locationId":{"type":"string","description":"Device location ID"},"deviceType":{"type":"string","description":"Type of the device"},"lastSeenOnline":{"type":"dateTime","description":"The last time the device has been online"},"isOnline":{"type":"boolean","description":"If the device is online or offline"},"isDigiTwinOnline":{"type":"boolean","description":"If the device digitwin is online or offline"}},"example":[{"deviceCode":"04766083-4a07-4c0d-8183-9773109da3a8","id":"04766083-4a07-4c0d-8183-9773109da3a8","name":"Kamppi DES","organizationId":"Selfly Demo","deviceType":"encodingStation","lastSeenOnline":"2019-05-08T07:52:08.973Z","isOnline":false,"LifeCycleStatus":"operational","locationId":"test","isDigiTwinOnline":false},{"deviceCode":"134-0033983--339884","id":"1","name":"Helsinki Headquarter DES","organizationId":"Selfly Demo","deviceType":"encodingStation","lastSeenOnline":"2018-01-03T08:32:13.420Z","isOnline":false,"LifeCycleStatus":"operational","locationId":"test","isDigiTwinOnline":true}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["encodingDevices"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/encodingDevices/{id}":{"get":{"summary":"Fetches an encoding device.","description":"Fetches an encoding device by device code.","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Device code","required":true}],"responses":{"200":{"description":"Encoding Device information","schema":{"type":"object","properties":{"id":{"type":"string","description":"Device id"},"organizationId":{"type":"string","description":"Organization that device belongs to"},"deviceCode":{"type":"string","description":"Device code"},"name":{"type":"string","description":"Device name"},"lifeCycleStatus":{"type":"string","description":"Device life cycle status"},"locationId":{"type":"string","description":"Device location ID"},"deviceType":{"type":"string","description":"Type of the device"},"lastSeenOnline":{"type":"dateTime","description":"The last time the device has been online"},"isOnline":{"type":"boolean","description":"If the device is online or offline"},"isDigiTwinOnline":{"type":"boolean","description":"If the device digitwin is online or offline"}},"example":[{"deviceCode":"04766083-4a07-4c0d-8183-9773109da3a8","id":"04766083-4a07-4c0d-8183-9773109da3a8","name":"Kamppi DES","organizationId":"Selfly Demo","deviceType":"encodingStation","lastSeenOnline":"2019-05-08T07:52:08.973Z","isOnline":false,"LifeCycleStatus":"operational","locationId":"test","isDigiTwinOnline":true}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["encodingDevices"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/enableFAT/{id}":{"put":{"summary":"Sends a request to the cabinet to start the factory acceptance tests.","description":"Expects no request body and starts the factory acceptance tests on the cabinet with the given ID.","parameters":[{"in":"query","name":"group","type":"string","description":"Argument to specify what group to make query on behalf of. If the cabinet has a group assigned to it, it is necessary.","required":false}],"responses":{"200":{"summary":"Success","description":"Success","schema":{"$ref":"#/definitions/EnableFATSuccessResponse"}},"401":{"summary":"Not authenticated","description":"Not authenticated","schema":{"$ref":"#/definitions/EnableFATNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/EnableFATForbiddenResponse"}},"404":{"summary":"Not Found","description":"Not Found","schema":{"$ref":"#/definitions/EnableFATNotFoundResponse"}}},"tags":["provisioning"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/disableFAT/{id}":{"put":{"parameters":[{"description":"ID of disableFAT to return","in":"path","required":true,"name":"id","type":"integer"},{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/provisioning"}}],"responses":{"200":{"description":"success","schema":{"$ref":"#/definitions/provisioning"}},"401":{"description":"not authenticated"},"404":{"description":"not found"},"500":{"description":"general error"}},"description":"Updates the resource identified by id using data.","summary":"","tags":["provisioning"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/reconfigure":{"post":{"summary":"Sends a request to the provisioning service to handle reprovisioning a device","description":"Expects the code, name, organization, description, and reprovision mode of the device in the body and sends a request to the provisioning service. Then saves this information to the database.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/ReconfigureCreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/ReconfigureCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/ReconfigureCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/ReconfigureCreateNotAuthenticatedResponse"}}},"tags":["Device"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/configure/{id}":{"put":{"summary":"Sends a request to the provisioning service to handle provisioning a device","description":"Sends a request to the provisioning service to handle provisioning a device with given configuration in the body","parameters":[{"in":"path","name":"deviceId","type":"string","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/ConfigureUpdateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"id":"device-id"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/replace":{"post":{"summary":"Sends a request to the provisioning service to handle replacing two devices","description":"Sends a request to the provisioning service to handle replacing given target device with the and replacement device","parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/ReplaceCreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"message":"OK"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/retire":{"post":{"summary":"Sends a request to the provisioning service to handle retiring a device","description":"Sends a request to the provisioning service to handle retiring the target device","parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/RetireCreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"message":"OK"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/me":{"get":{"summary":"Gets the configurations of a device","description":"Finds the deviceCode from auth header and returns the configurations for the device","parameters":[],"responses":{"200":{"description":"Success","schema":{"example":{"id":"device-id","deviceName":"device-name","deviceCode":"device-code","deviceType":"device-type","deviceSubType":9,"description":"Device description","connectionString":"connection-string","organization":"organization-id","metadata":{"key":"value"},"lifeCycleStatus":"installed"}}},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/create":{"post":{"summary":"Creates a new device","description":"Given Id and some other configurations, creates a new device","parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/CreateEndpointCreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"id":"device-id"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/register":{"post":{"summary":"Creates a blank device","description":"Creates a blank device with given password and a random id","parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/RegisterCreateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"id":"device-id"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/lifecycle/{id}":{"put":{"summary":"Updates the lifecycle status of a device","description":"Updates the lifecycle status of a device, device is fetched by the deviceCode from the auth header","parameters":[{"in":"path","name":"deviceId","type":"string","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"example":{"status":"operational"}}}],"responses":{"200":{"description":"Success","schema":{"example":{"massage":"OK"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/teststatus/{id}":{"put":{"summary":"Updates the test status of a device","description":"Updates the test status of a device","parameters":[{"in":"path","name":"deviceId","type":"string","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/TeststatusUpdateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"message":"OK"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["Device","Provision"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/discount-image":{"post":{"summary":"Uploads image for the bundle discount with given ID into blob storage and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container with bundle discount image in the user group folder, under the bundle discount ID file name. It also returns URL of the newly uploaded image so it can be used on product create or update calls.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/bundle-discount-images-dev/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["discount-image"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/bundle-discount-image":{"post":{"summary":"Uploads image for the bundle discount with given ID into blob storage and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container with bundle discount image in the user group folder, under the bundle discount ID file name. It also returns URL of the newly uploaded image so it can be used on product create or update calls.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/bundle-discount-images-dev/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["bundle-discount-image"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/saveFATResults":{"post":{"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/saveFATResults"}}],"responses":{"201":{"description":"created"},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Creates a new resource with data.","summary":"","tags":["saveFATResults"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/notification_subscriptions":{"get":{"summary":"Fetches all possible subscriptions for one organization","description":"\n      Fetches all possible subscriptions for one organization from Azure service bus. You need to put orgnizationId in group query parameters.\n    You need to put User tenant from `groups` property in `Authorization Bearer xxxx` header.\n  ","parameters":[{"in":"query","name":"group","type":"string","description":"organizationId which specify what group to make query on behalf of. ","required":true}],"responses":{"200":{"description":"\n            Details about subscription information from Azure service bus\n          ","schema":{"$ref":"#/definitions/NotificationSystemFindSuccessResponse"}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["notification_subscriptions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new subscription from one organization","description":"\n      Creates subscription from one organization from Azure service bus. If \"devicesScope\" added to body then subscription will filter data to only for those devices.\n      Also can filter subscription topics with \"subscriptionField\" in body. Valid subscription fields are:\n\n      \"status\" (alarm),\n\n      \"door\" (opened, closed, locked and unlocked),\n\n      \"cabinetState\" (readyForPurchase, purchaseEnter, purchaseExit, maintenanceModeEnter, maintenanceModeExit, refillStart, refillEnd),\n\n      \"inventoryChange\"\n    ","consumes":["application/json","text/json"],"parameters":[{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new subscription data.","required":true,"schema":{"$ref":"#/definitions/NotificationSystemPostRequest"}}],"responses":{"201":{"description":"Notification is created successfully.","schema":{"$ref":"#/definitions/NotificationSystemPostSuccessResponse"}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["notification_subscriptions"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/notification_subscriptions/{id}":{"get":{"summary":"Fetches cabinet notification topic for one organization","description":"\n      Fetches cabinet notification topic for one organization. You need to put topic name in the request path and organizationId in the request query.\n  ","parameters":[{"in":"path","name":"topicName","type":"string","description":"Name of the topic.","required":true},{"in":"query","name":"group","type":"string","description":"organizationId which specify what group to make query on behalf of. ","required":true}],"responses":{"200":{"description":"\n            Details about cabinet notification topic.\n          ","schema":{"$ref":"#/definitions/NotificationSystemGetSuccessResponse"}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["notification_subscriptions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Deletes a subscription for one organization","description":"Deletes a subscription for one organization from Azure service bus","parameters":[{"in":"query","name":"group","type":"string","description":"organization id","required":true},{"in":"path","name":"id","type":"string","description":"id of subscription","required":true}],"responses":{"201":{"description":"Subscription deleted successfully. Returns the deleted subscription id.","schema":{"properties":{"id":{"type":"string","description":"Id of subscription","example":"7954dcab-6a78-4be4-a875-ac2defd75c95"}}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["notification_subscriptions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/user-keys":{"get":{"summary":"Gets all the user keys for an organization","description":"Expects the organizationId as a query parameter.","consumes":["application/json","text/json"],"parameters":[{"name":"group","in":"query","type":"string","description":"Required organizationId parameter to perform the action","required":true}],"responses":{"200":{"description":"The fetch request is successful.","schema":{"example":[{"_id":"123","organizationId":"Selfly","status":1,"paymentMethod":"demo","allowBalance":true,"balance":"100","currency":"USD","validityTimeStart":"2021-04-08T08:07:57.853Z","validityTimeEnd":"2021-04-08T08:07:57.853Z","validForPurchase":true,"metaData":{"room":"202","userMemo":"msg"},"createdAt":"2021-04-08T08:07:57.853Z","updatedAt":"2021-04-08T08:07:57.853Z"}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not Authenticated"},"5XX":{"description":"General server error happened."}},"tags":["user-keys"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Sends a request to create a new user key","description":"Expects the organizationId as a query parameter and expects status, paymentMethod, balance, currency, validityTimeStart, validityTimeEnd, validForPurchase, metaData in the body and sends a request to create a new user key. Then saves this information to the database.","consumes":["application/json","text/json"],"parameters":[{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/UserKeysCreateRequest"}},{"name":"group","in":"query","type":"string","description":"Required organizationId parameter to perform the action","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/UserKeysCreateSuccessResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/UserKeysCreateBadRequestResponse"}},"401":{"description":"Not Authenticated","schema":{"$ref":"#/definitions/UserKeysCreateNotAuthenticatedResponse"}}},"tags":["user-keys"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/user-keys/{id}":{"get":{"summary":"Gets one user key","description":"Expects the organizationId as a query parameter.","consumes":["application/json","text/json"],"parameters":[{"name":"group","in":"query","type":"string","description":"Required organizationId parameter to perform the action","required":true}],"responses":{"200":{"description":"The fetch request is successful.","schema":{"example":[{"_id":"123","organizationId":"Selfly","status":1,"paymentMethod":"demo","allowBalance":true,"balance":"100","currency":"USD","validityTimeStart":"2021-04-08T08:07:57.853Z","validityTimeEnd":"2021-04-08T08:07:57.853Z","validForPurchase":true,"metaData":{"room":"202","userMemo":"msg"},"createdAt":"2021-04-08T08:07:57.853Z","updatedAt":"2021-04-08T08:07:57.853Z"}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not Authenticated"},"5XX":{"description":"General server error happened."}},"tags":["user-keys"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates a user key","description":"Expects the organizationId as a query parameter.","consumes":["application/json","text/json"],"parameters":[{"name":"group","in":"query","type":"string","description":"Required organizationId parameter to perform the action","required":true}],"required":["status","paymentMethod","allowBalance","validForPurchase"],"schema":{"_id":"123","organizationId":"Selfly","status":1,"paymentMethod":"demo","allowBalance":true,"balance":"100","currency":"USD","validityTimeStart":"2021-04-08T08:07:57.853Z","validityTimeEnd":"2021-04-08T08:07:57.853Z","validForPurchase":true,"metaData":{"room":"202","userMemo":"msg"}},"responses":{"200":{"description":"Returns the updated user key."},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not Authenticated"},"5XX":{"description":"General server error happened."}},"tags":["user-keys"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/refill-rules":{"get":{"summary":"Returns all refill rules","description":"Refill rules are returned","parameters":[{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"Returns refill rules","schema":{"example":[{"deviceCode":"asfafsafs22-22asfas-222","refillRule":{"_id":"4f99dae4-b4fa-4f8e-8acc-8d772df03d13","productData":[{"barcode":"252525252525","targetInvAmount":5,"barcodeType":"EAN-13","refillNote":""},{"barcode":"25252525252","targetInvAmount":5,"barcodeType":"EAN-13","refillNote":""},{"barcode":"25252525252","targetInvAmount":3,"barcodeType":"EAN-13","refillNote":""}]}},{"deviceCode":"bcsafsafs22-22asfas-222","refillRule":{"_id":"113131313afsafs","productData":[{"barcode":"2525252525","targetInvAmount":3,"barcodeType":"EAN-13","refillNote":""},{"barcode":"2525252522","targetInvAmount":6,"barcodeType":"EAN-13","refillNote":""}]}}]}},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates refill rule","description":"Refill rule is created","parameters":[{"name":"body","in":"body","description":"The new refill rule data.","required":true,"schema":{"example":{"deviceCodes":["asfafsafs22-22asfas-222","bcsafsafs22-22asfas-222"],"productData":[{"barcode":"252525252","targetInvAmount":2,"barcodeType":"EAN-13","refillNote":""},{"barcode":"52252525","targetInvAmount":4,"barcodeType":"EAN-8","refillNote":""}]}}}],"responses":{"201":{"description":"Returns msg and data of created rule","schema":{"example":{"msg":"Device(s) refill rules created successfully","data":{"id":"05324746-633a-4dcf-b750-2bc68edb6269","productData":[{"barcode":"25252525252","targetInvAmount":3,"barcodeType":"EAN-13","refillNote":""},{"barcode":"52252525","targetInvAmount":4,"barcodeType":"EAN-8","refillNote":""}]}}}},"400":{"description":"Validation error"},"5XX":{"description":"Unexpected server error."}},"tags":["refill-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/refill-rules/{id}":{"get":{"summary":"Returns single refill rule by device code","description":"Refill rule is returned","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Device code which is used to get correct rule","required":true}],"responses":{"200":{"description":"Refill rule is returned","schema":{"example":{"_id":"64804a9c5938a89a09eb972b","productData":[{"barcode":"4532761390435","targetInvAmount":3,"barcodeType":"EAN-13","refillNote":""},{"barcode":"252525252525","targetInvAmount":5,"barcodeType":"EAN-13","refillNote":""}]}}},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates an existing refill rule","description":"Finds the refill plan with the provided id and updates it with the new data.","parameters":[{"in":"query","name":"id","type":"string","description":"Device code of the cabinet to which update request is sent.","required":true},{"name":"body","in":"body","description":"The updated refill rule data.","required":true,"schema":{"example":{"productData":[{"barcode":"433252525333","targetInvAmount":6,"barcodeType":"EAN-13","refillNote":""},{"barcode":"01256647223","targetInvAmount":5,"barcodeType":"EAN-13","refillNote":""}],"planogram":{"shelvesCount":5,"shelves":[{"shelf":1,"slotCount":5,"productData":[{"slot":1,"prodducts":["productId1","productId3"]},{"slot":3,"prodducts":["productId1"]}]},{"shelf":2,"slotCount":5,"productData":[{"slot":1,"prodducts":["productId1","productId3"]},{"slot":2,"prodducts":["productId1"]},{"slot":3,"prodducts":["productId1","productId2","productId3"]},{"slot":4,"prodducts":[]},{"slot":2,"prodducts":["productId1"]}]},{"shelf":3,"slotCount":5,"productData":[]},{"shelf":4,"slotCount":5,"productData":[{"slot":1,"prodducts":["productId1"]},{"slot":2,"prodducts":["productId1"]},{"slot":3,"prodducts":[]},{"slot":4,"prodducts":[]},{"slot":2,"prodducts":["productId1"]}]},{"shelf":5,"slotCount":5,"productData":["productId1","productId2"]}]}}}}],"responses":{"200":{"description":"Returns msg and data of updated rule","schema":{"example":{"msg":"Device(s) refill rules updated successfully","data":{"id":"05324746-633a-4dcf-b750-2bc68edb6269","productData":[{"barcode":"1523525112412","targetInvAmount":5,"barcodeType":"EAN-13","refillNote":""}]}}}},"400":{"description":"Validation error"},"5XX":{"description":"Unexpected server error."}},"tags":["refill-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Deletes a refill rule","description":"Deletes a refill rule from a device","parameters":[{"name":"id","in":"path","description":"Device code","required":true}],"responses":{"200":{"description":"Refill rule deleted","schema":{"example":{"msg":"Refill rule deleted successfully","deviceCode":"62c4b803-1aa9-43b0-8158-ac8cc4ecc84d"}}},"403":{"description":"Refill rule deletion prohibited, because rule is used within plan"},"404":{"description":"Rule not found"},"5XX":{"description":"Unexpected server error."}},"tags":["refill-rules"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/refill-plans":{"get":{"summary":"Returns all the refill plans by device codes","description":"All the refill plans are returned","parameters":[{"name":"deviceCode","in":"query","type":"string","description":"If you want to fetch refill plan for a device, provide a deviceCode in url. Do not send deviceCode in url if you want to fetch all the refill plans","required":false},{"name":"group","in":"query","type":"string","description":"Organization's id which is used  to get correct plans","required":true}],"responses":{"200":{"description":"Refill plan is returned, grouped by devices","schema":{"example":[{"_id":"64804a9c5938a89a09eb972b","lastUpdated":"2023-08-08T13:34:42+03:00","deviceCode":"e7b5f86c-a7b8-405a-8fde-ffdc5fa72f8a","organizationId":"Selfly Demo","status":"Active","refillRuleId":"2424sfs-241412-sfsf11","productData":[{"barcode":"4532761390435","barcodeType":"EAN-13","refillNote":"dont stack the products","amountToRefill":4,"name":"Avocado","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/stora%20enso%20demo/5e21e0d0-fad5-11ed-bb97-2bafa5561432.jpeg"},{"barcode":"3250390831464","barcodeType":"EAN-13","refillNote":"","amountToRefill":4,"name":"d'Or Tuiles salées","imageUrl":"https://cdn.intelligentpackaging.online/cabinet-products-prod/stora%20enso%20oyj/40e1bd60-384b-11ea-9d2a-b7361ec5f6d9.jpeg"}]}]}},"400":{"description":"Bad Request (e.g. validation error)"},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plans"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Create a refill plan ","description":"Refill plan is created","parameters":[{"name":"group","in":"query","type":"string","description":"Organization's id which is used to create plan for correct organization","required":true},{"name":"body","in":"body","required":true,"schema":{"example":{"deviceCode":{"refillRuleId":"2424sfs-241412-sfsf11","productData":[{"barcode":"4532761390435","barcodeType":"EAN-13","refillNote":"","amountToRefill":6,"minimumInvAmount":0},{"barcode":"3250390831464","amountToRefill":7,"barcodeType":"EAN-13","refillNote":"","minimumInvAmount":5},{"barcode":"0040000001607","amountToRefill":4,"barcodeType":"EAN-13","refillNote":"","minimumInvAmount":0},{"barcode":"7613033132346","amountToRefill":-1,"barcodeType":"EAN-13","refillNote":"","minimumInvAmount":4}]}}}}],"responses":{"200":{"description":"Refill plan is created"},"400":{"description":"Bad Request (e.g. validation error)"},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plans"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/refill-plans/{id}":{"get":{"summary":"Returns single refill plan by device code","description":"Refill plan is returned","parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Device code which is used to get correct plan","required":true},{"in":"query","name":"group","type":"string","description":"Optional argument to specify what group to make query on behalf of. Otherwise, If the user has only one group it will be assigned, and in case of multiple groups the request will be failed","required":false}],"responses":{"200":{"description":"Refill plan is returned","schema":{"example":{"_id":"64804a9c5938a89a09eb972b","lastUpdated":"2023-08-08T13:34:42+03:00","deviceCode":"e7b5f86c-a7b8-405a-8fde-ffdc5fa72f8a","organizationId":"Selfly Demo","status":"Completed","refillRuleId":"2424sfs-241412-sfsf11","productData":[{"barcode":"4532761390435","amountToRefill":4,"name":"Avocado","barcodeType":"EAN-13","refillNote":"","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/stora%20enso%20demo/5e21e0d0-fad5-11ed-bb97-2bafa5561432.jpeg"},{"barcode":"3250390831464","barcodeType":"EAN-13","refillNote":"keep some gap between products","amountToRefill":4,"name":"d'Or Tuiles salées","imageUrl":"https://cdn.intelligentpackaging.online/cabinet-products-prod/stora%20enso%20oyj/40e1bd60-384b-11ea-9d2a-b7361ec5f6d9.jpeg"},{"barcode":"0040000001607","amountToRefill":4,"barcodeType":"EAN-8","refillNote":"","name":"KitKat Chunky Caramel","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/fazer/cf90a780-55ec-11ed-96da-99a494ecc524.jpeg"},{"barcode":"7613033132346","barcodeType":"EAN-13","refillNote":"","amountToRefill":-1,"name":"Pirulo Kaktus","imageUrl":"https://cdn.intelligentpackaging.online/cabinet-products-qa/stora%20enso%20oyj/419fed20-518d-11ea-8fcb-0de40632aa08.jpeg"}],"refillInventoryId":"57205295-f5ac-442d-9f10-6a05a0de9ede","refillOperator":"Toni Matilainen"}}},"400":{"description":"Bad Request (e.g. validation error)"},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plans"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Update refill plan","description":"Finds the refill plan with the given id and updates it with the new data.","parameters":[{"name":"id","in":"path","type":"string","description":"Refill plan id which is used  to update correct plan","required":true},{"name":"group","in":"query","type":"string","description":"Organization's id","required":true},{"name":"body","in":"body","type":"object","description":"new refill plan object data to be updated with","required":true,"schema":{"example":{"deviceCode":"e7b5f86c-a7b8-405a-8fde-ffdc5fa72f8a","status":"Active","productData":[{"barcode":"4532761390435","amountToRefill":6,"name":"Avocado","barcodeType":"EN-13","refillNote":"place this product on the top-most shelf","imageUrl":"https://cdn.selflystore.com/cabinet-products-qa/stora%20enso%20demo/5e21e0d0-fad5-11ed-bb97-2bafa5561432.jpeg"},{"barcode":"3250390831464","amountToRefill":7,"name":"d'Or Tuiles salées","barcodeType":"EN-8","refillNote":"","imageUrl":"https://cdn.intelligentpackaging.online/cabinet-products-prod/stora%20enso%20oyj/40e1bd60-384b-11ea-9d2a-b7361ec5f6d9.jpeg"}],"planogram":{"shelvesCount":5,"shelves":[{"shelf":1,"slotCount":5,"productData":[{"slot":1,"products":["productId1","productId3"]},{"slot":3,"products":["productId1"]}]},{"shelf":2,"slotCount":5,"productData":[{"slot":1,"products":["productId1","productId3"]},{"slot":2,"products":["productId1"]},{"slot":3,"products":["productId1","productId2","productId3"]},{"slot":4,"products":[]},{"slot":2,"products":["productId1"]}]},{"shelf":3,"slotCount":5,"productData":[]},{"shelf":4,"slotCount":5,"productData":[{"slot":1,"products":["productId1"]},{"slot":2,"products":["productId1"]},{"slot":3,"products":[]},{"slot":4,"products":[]},{"slot":2,"products":["productId1"]}]},{"shelf":5,"slotCount":5,"productData":["productId1","productId2"]}]}}}}],"responses":{"200":{"description":"Refill plan is updated"},"400":{"description":"Bad Request (e.g. validation error)"},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plans"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"patch":{"summary":"Updates single refill plans status","description":"Refill plan is updated","parameters":[{"name":"id","in":"path","type":"string","description":"Refill plan id which is used  to update correct plan","required":true},{"name":"group","in":"query","type":"string","description":"Organization's id which is used  to update correct plans","required":false},{"name":"status","in":"query","type":"string","description":"Status of refill plan (Active | Completed | Deleted)","required":true},{"name":"refillOperator","in":"query","type":"string","description":"Refill operators name who completed refill plan if status is updated to completion","required":true}],"responses":{"200":{"description":"Refill plans status is updated"},"400":{"description":"Bad Request (e.g. validation error)"},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plans"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Deletes a refill plan","description":"deletes an active refill plan for the provided device code","parameters":[{"name":"id","in":"path","type":"string","description":"Device code or refill plan Id depending upon planId parameter","required":true},{"name":"group","in":"query","type":"string","description":"Organization id","required":false},{"name":"planId","in":"query","type":"boolean","description":"Include this parameter(planId=true) if you want to delete a refill plan by Id. Omit the parameter if you intend to delete the refill plan using deviceCode instead","required":false}],"responses":{"200":{"description":"Refill plan is deleted","schema":{"example":{"msg":"Refill plan deleted successfully","deviceCode":"e7b5f86c-a7b8-405a-8fde-ffdc5fa72f8a"}}},"400":{"description":"Bad Request (e.g. validation error)"},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plans"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/refill-plan-suggestions":{"post":{"summary":"Returns calculations based on refill rule and sent devices","description":"Suggested amounts for refill are returned","parameters":[{"name":"group","in":"query","type":"string","description":"Required organization id","required":false},{"name":"body","in":"body","required":true,"schema":{"example":{"selectedCabinets":["2407721b-9368-4b50-b266-fdc52c195e1b","1207721b-9368-1c50-b266-fdc52c195e2b"]}}}],"responses":{"200":{"description":"Returns cabinets with suggested refill amounts","schema":{"example":[{"refillRuleId":"2424sfs-241412-sfsf11","amountToRefill":2,"barcode":"335353511","barcodeType":"EAN-8","refillNote":"","deviceCode":"asfas214s-asfasfas-11ss121","imageUrl":null,"name":"Example product 1"},{"refillRuleId":"2424sfs-241412-sfsf11","amountToRefill":5,"barcode":"775325511","barcodeType":"EAN-8","refillNote":"","deviceCode":"22knmw214s-ghjasfas-11ss121","imageUrl":null,"name":"Example product 2"}]}},"404":{"description":"NotFound."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-plan-suggestions"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/cabinet-state/{id}":{"get":{"summary":"Gets the status of a device","description":"Expects the deviceCode as the id","consumes":["application/json","text/json"],"parameters":[{"name":"deviceCode","in":"path","type":"string","description":"If you want to fetch the status for a device, provide a deviceCode in the url.","required":true},{"name":"group","in":"query","type":"string","description":"Organization's id of the device","required":true}],"responses":{"200":{"description":"Success","schema":{"example":{"cabinetState":"refillStart","reportedTimestamp":"2023-11-22T12:17:21.679Z"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found","schema":{"example":"Cabinet with given code is not in the database."}},"5XX":{"description":"General server error happened."}},"tags":["cabinet-state"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/theme-images":{"post":{"summary":"Uploads image and returns URL of the image.","description":"\nThe image is uploaded to the blob storage to the container specific to the user group folder. It also returns URL of the newly uploaded image.\n        ","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData of an image."}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/themse-images-dev/test_owner/8a5d9f30-4a07-11eb-8414-75ed9505054a.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["theme-images"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/product-class":{"get":{"summary":"Returns all the product class records.","description":"Returns all the product class records.","parameters":[{"in":"query","name":"layer","type":"integer","description":"Optional argument to fetch the product classes for a specific layer.","required":false}],"consumes":["application/json","text/json"],"responses":{"200":{"description":"The fetch request is successful.","schema":{"example":[{"id":1065,"name":"Product class name","parentId":105,"layer":3}]}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not Authenticated"},"5XX":{"description":"General server error happened."}},"tags":["product-class"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/product-label":{"get":{"summary":"Fetches available product labels within the organization.","description":"Based on authentication realm it fetches the product labels based on the organization Id.","parameters":[{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of, usually organization name, which is same as Id","required":true}],"responses":{"200":{"description":"\n          The list of product labels for the required organization. \n          ","schema":{"type":"array","properties":{"id":{"type":"uuid","description":"List of product labels that associated with the product"}},"example":["Fresh","Discount"]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["product-label"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/startOAT/{id}":{"put":{"summary":"Sends a request to the cabinet to start the operational acceptance tests.","description":"Expects no request body and starts the operational acceptance tests on the cabinet with the given ID.","parameters":[{"in":"query","name":"group","type":"string","description":"Argument to specify what group to make query on behalf of. If the cabinet has a group assigned to it, it is necessary.","required":false}],"responses":{"200":{"summary":"Success","description":"Success","schema":{"$ref":"#/definitions/StartOATSuccessResponse"}},"401":{"summary":"Not authenticated","description":"Not authenticated","schema":{"$ref":"#/definitions/StartOATNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/StartOATForbiddenResponse"}},"404":{"summary":"Not Found","description":"Not Found","schema":{"$ref":"#/definitions/StartOATNotFoundResponse"}}},"tags":["provisioning"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning/endOAT/{id}":{"put":{"summary":"Sends a request to the cabinet to end the operational acceptance tests.","description":"Ends the operational acceptance tests on the cabinet with the given ID if accepted and saves user inputs to the database.","parameters":[{"in":"query","name":"group","type":"string","description":"Argument to specify what group to make query on behalf of. If the cabinet has a group assigned to it, it is necessary.","required":false},{"in":"body","name":"body","type":"object","required":true,"schema":{"properties":{"deviceCode":{"type":"string"},"organization":{"type":"string"},"testSuitId":{"type":"string"},"isAccepted":{"type":"boolean"}},"required":["deviceCode","organization","testSuitId","isAccepted"]}}],"responses":{"200":{"summary":"Success","description":"Success","schema":{"$ref":"#/definitions/EndOATSuccessResponse"}},"401":{"summary":"Not authenticated","description":"Not authenticated","schema":{"$ref":"#/definitions/EndOATNotAuthenticatedResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/EndOATForbiddenResponse"}},"404":{"summary":"Not Found","description":"Not Found","schema":{"$ref":"#/definitions/EndOATNotFoundResponse"}}},"tags":["provisioning"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/saveOATResults":{"post":{"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/saveOATResults"}}],"responses":{"201":{"description":"created"},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Creates a new resource with data.","summary":"","tags":["saveOATResults"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/blacklist":{"get":{"summary":"Gets blacklisted records by group","description":"Gets blacklisted records by group","consumes":["application/json"],"parameters":[{"name":"group","in":"query","type":"string","description":"Organization's id of the device","required":true}],"responses":{"200":{"description":"Success","schema":{"example":[{"_id":"f9d53b83-6fa5-4a9e-a8a0-c4e9f1317dd7","organizationId":"Selfly Demo","unpaidAmount":5.4,"customerId":"20-76-27-84","orderId":"lyq-1221a21aa116","deviceCode":"bd84af7d-028b-489b-ae5b-d1f39620ed6b","paymentMethod":"nayax"}]}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["blacklist"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"create blacklist record","description":"create blacklist record","consumes":["application/json"],"parameters":[{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new subscription data.","required":true,"schema":{"$ref":"#/definitions/BlacklistPost"}}],"responses":{"200":{"description":"Success","schema":{"example":{"_id":"f9d53b83-6fa5-4a9e-a8a0-c4e9f1317dd7","organizationId":"Selfly Demo","unpaidAmount":5.4,"customerId":"20-76-27-84","orderId":"lyq-1221a21aa116","deviceCode":"bd84af7d-028b-489b-ae5b-d1f39620ed6b","paymentMethod":"nayax"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["blacklist"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/blacklist/{id}":{"get":{"summary":"Gets blacklisted records by customer Id","description":"Gets blacklisted records by customer Id","consumes":["application/json"],"parameters":[{"name":"customerId","in":"path","type":"string","description":"Customer ID: eg card hash, card Bin, etc","required":true},{"name":"group","in":"query","type":"string","description":"Organization's id of the device","required":true}],"responses":{"200":{"description":"Success","schema":{"example":[{"_id":"f9d53b83-6fa5-4a9e-a8a0-c4e9f1317dd7","organizationId":"Selfly Demo","unpaidAmount":5.4,"customerId":"20-76-27-84","orderId":"lyq-1221a21aa116","deviceCode":"bd84af7d-028b-489b-ae5b-d1f39620ed6b","paymentMethod":"nayax"}]}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["blacklist"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Update blacklist record","description":"Update blacklist record","consumes":["application/json"],"parameters":[{"name":"customerId","in":"path","type":"string","description":"Customer ID: eg card hash, card Bin, etc","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new subscription data.","required":true,"schema":{"$ref":"#/definitions/BlacklistPost"}}],"responses":{"200":{"description":"Success","schema":{"example":{"_id":"f9d53b83-6fa5-4a9e-a8a0-c4e9f1317dd7","organizationId":"Selfly Demo","unpaidAmount":5.4,"customerId":"20-76-27-84","orderId":"lyq-1221a21aa116","deviceCode":"bd84af7d-028b-489b-ae5b-d1f39620ed6b","paymentMethod":"nayax"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["blacklist"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Delete blacklist record","description":"Delete blacklist record","consumes":["application/json"],"parameters":[{"name":"customerId","in":"path","type":"string","description":"Customer ID: eg card hash, card Bin, etc","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true}],"responses":{"200":{"description":"Success"},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["blacklist"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/automation":{"get":{"summary":"Finds all automation records","description":"No parameters needed","consumes":["application/json","text/json"],"responses":{"200":{"description":"Success","schema":{"example":[{"name":"Automation record","type":"object","occurences":"1","startTime":"2019-01-01T00:00:00.000Z","endTime":"2019-01-01T00:00:00.000Z","organizationId":"organizationId","deviceCodeList":["deviceCode1","deviceCode2"],"status":"active","metadata":{},"sendMail":true,"toList":["email1","email2"]}]}},"401":{"description":"Not authenticated"},"5XX":{"description":"General server error happened."}},"parameters":[{"description":"Number of results to return","in":"query","name":"$limit","type":"integer"},{"description":"Number of results to skip","in":"query","name":"$skip","type":"integer"},{"description":"Property to sort results","in":"query","name":"$sort","type":"string"}],"tags":["automation"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new automation record","description":"Expects the automation record data","consumes":["application/json","text/json"],"parameters":[{"name":"data","in":"body","type":"object","description":"The automation record data","required":true,"example":{"name":"Automation record","type":"object","occurences":"1","startTime":"2019-01-01T00:00:00.000Z","endTime":"2019-01-01T00:00:00.000Z","organizationId":"organizationId","username":"username","deviceCodeList":["deviceCode1","deviceCode2"],"status":"active","metadata":{},"sendMail":true,"toList":["email1","email2"]}}],"responses":{"201":{"description":"Created","schema":{"example":{"msg":"Automation record created"}}},"401":{"description":"Not authenticated"},"5XX":{"description":"General server error happened."}},"tags":["automation"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/automation/{id}":{"get":{"summary":"Gets the automation record by id","description":"Expects the id","consumes":["application/json","text/json"],"parameters":[{"name":"id","in":"path","type":"string","description":"The id of the automation record","required":true}],"responses":{"200":{"description":"Success","schema":{"example":{"name":"Automation record","type":"object","occurences":"1","startTime":"2019-01-01T00:00:00.000Z","endTime":"2019-01-01T00:00:00.000Z","organizationId":"organizationId","deviceCodeList":["deviceCode1","deviceCode2"],"status":"active","metadata":{},"sendMail":true,"toList":["email1","email2"]}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found","schema":{"example":"Cabinet with given code is not in the database."}},"5XX":{"description":"General server error happened."}},"tags":["automation"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates an automation record","description":"Expects the id and the data to update","consumes":["application/json","text/json"],"parameters":[{"name":"id","in":"path","type":"string","description":"The id of the automation record","required":true},{"name":"data","in":"body","type":"object","description":"The data to update","required":true}],"responses":{"200":{"description":"Success","schema":{"example":{"msg":"Automation record updated"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found","schema":{"example":"Automation record not found"}},"5XX":{"description":"General server error happened."}},"tags":["automation"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/provisioning-selfly-encode/configure/{id}":{"put":{"summary":"Sends a request to the provisioning selfly encode device","description":"Sends a request to the provisioning service to handle provisioning a device with given configuration in the body","parameters":[{"in":"path","name":"deviceId","type":"string","required":true},{"in":"body","name":"body","type":"object","required":true,"schema":{"$ref":"#/definitions/ConfigureSelflyEncodeUpdateRequest"}}],"responses":{"200":{"description":"Success","schema":{"example":{"id":"device-id"}}},"400":{"description":"Bad Request"},"401":{"description":"Not Authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Device Not Found"}},"tags":["provisioning-selfly-encode"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/product-surcharge":{"get":{"summary":"Fetches available product surcharges within the organization Id","description":"Fetches the product surcharges within the organization Id","consumes":["application/json"],"parameters":[{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of, usually organization name, which is same as Id","required":true}],"responses":{"200":{"description":"\n          The list of product purchargeList for the required organization. \n          ","schema":{"type":"array","example":[{"id":"id","organizationId":"organizationId","valueType":1,"surchargeType":1,"value":22,"name":"Name of the product surcharge","appliedOn":"all"}]}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["product-surcharge"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"Creates a new product surcharge based on the information in the body","description":"Creates a new product surcharge and returns its value","consumes":["application/json"],"parameters":[{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new product surcharge data.","required":true,"schema":{"$ref":"#/definitions/ProductSurchargePost"}}],"responses":{"200":{"description":"Success","schema":{"type":"object","example":{"id":"id","organizationId":"organizationId","valueType":1,"surchargeType":1,"value":22,"externalCode":"code 123","name":"Name of the product surcharge","appliedOn":"all"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["product-surcharge"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/product-surcharge/{id}":{"get":{"summary":"Searches for product surcharge based on the provided id in the url and returns it","description":"Searches for product surcharge based on the provided id in the url and returns it","consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"string","description":"Id of the product surcharge","required":true},{"in":"query","name":"group","type":"string","description":"Required argument to specify what group to make query on behalf of, usually organization name, which is same as Id","required":true}],"responses":{"200":{"description":"\n          The product surcharge for provided id. \n          ","schema":{"type":"object","example":{"id":"id","organizationId":"organizationId","valueType":1,"surchargeType":1,"value":22,"externalCode":"code 123","name":"Name of the product surcharge","appliedOn":"all"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["product-surcharge"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"Updates the existing product surcharge with the provided information in the body","description":"Updates the existing product surcharge with the provided information in the body","consumes":["application/json"],"parameters":[{"name":"id","in":"path","type":"string","description":"Product surcharge ID","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new values for the existing product surcharge.","required":true,"schema":{"$ref":"#/definitions/ProductSurchargePut"}}],"responses":{"200":{"description":"Success","schema":{"type":"object","example":{"id":"id","organizationId":"organizationId","valueType":1,"surchargeType":1,"externalCode":"code 123","value":22,"name":"Name of the product surcharge","appliedOn":"all"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["product-surcharge"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Removes an existing product surcharge","description":"Removes an existing product surcharge with the provided id in the request path","consumes":["application/json"],"parameters":[{"name":"id","in":"path","type":"string","description":"Product surcharge ID","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true}],"responses":{"200":{"description":"Success","schema":{"type":"object","example":{"id":"id"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["product-surcharge"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/image-upload":{"post":{"summary":"Uploads image.","description":"The image is uploaded to the blob storage to the container depending on the type provided in query. It also returns cdn URL of the newly uploaded image","parameters":[{"name":"body","from":"body","required":true,"contentType":"multipart/form-data","description":"The body should be of type FormData to which image file should be appended."},{"in":"query","name":"type","type":"string","description":"Image type to upload.","required":false}],"responses":{"201":{"schema":{"example":{"url":"https://cdn.selflystore.com/refill-planogram-images-dev/stora%20enso%20demo/d9eb1910-74c4-11ef-8ce8-214b3b2d45c8.jpeg"},"description":"Image uploaded successfully."}},"400":{"description":"Error has happened, see error message for details."},"401":{"description":"Not authorized"},"5XX":{"description":"General server error happened."}},"tags":["image-upload"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/user-discount-apply":{"post":{"summary":"Tell cabinet if a user specific discount is applied","description":"\nCabinet listens for `user-discount-apply` `created` event, compares own ID to the given `deviceCode` and executes command.\n      ","parameters":[{"name":"body","in":"body","description":"The notification object containing device code","required":true,"schema":{"example":{"deviceCode":"XXXXXXXXXXXXXXXX","userId":"1212"}}}],"responses":{"201":{"description":"Notification sent successfully to Cabinet."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"403":{"description":"Not authorized to execute commands."},"5XX":{"description":"Unexpected server error."}},"tags":["user-discount-apply"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/refill-transaction":{"post":{"summary":"report refill transaction based on device code","description":"\nCabinet use this method to report refill transaction to selfly cloud\n    ","parameters":[{"name":"body","in":"body","description":"The purchases list of the user.","required":true,"schema":{"example":{"record":"7cd3be63-7034-40a9-9c1e-443265699e1e","organizationId":"Selfly Demo","locationId":"476a7528-1229-4c05-8fbe-bfc42b36fb96","startTime":"2024-09-19T13:17:12.411+00:00","endTime":"2024-09-19T13:19:12.411+00:00","refillAdded":[{"barcode":"12121","count":1},{"barcode":"6415600545426","count":2,"price":6}],"refillRemoved":[{"barcode":"222","count":3}],"addedTags":[],"removedTags":[],"eventType":"refill-end"}}}],"responses":{"201":{"description":"Purchase reported successfully to Cabinet payment system."},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated. Only device can use this method with Device authentication."},"5XX":{"description":"Unexpected server error."}},"tags":["refill-transaction"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/planogram/{id}":{"get":{"summary":"Gets planogram by device code","description":"Gets planogram by device code","consumes":["application/json"],"parameters":[{"name":"deviceCode","in":"path","type":"string","description":"device code of a cabinet","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true}],"responses":{"200":{"description":"Success","schema":{"example":{"shelves":[{"shelf":11,"type":"rfid","productData":null,"slots":null},{"shelf":1,"type":"scale1","slots":null,"productData":[{"slot":1,"barcode":"2023000000014","productId":"0def81a0-3a2b-42f7-b26b-cf234266fb42","trainingTimestamp":"2025-01-02T09:11:28.286Z"},{"slot":2,"barcode":"2023000000014","productId":"0def81a0-3a2b-42f7-b26b-cf234266fb42","trainingTimestamp":"2025-01-02T09:11:28.286Z"},{"slot":3,"barcode":"2023000000014","productId":"0def81a0-3a2b-42f7-b26b-cf234266fb42","trainingTimestamp":"2025-01-02T09:11:28.286Z"}]},{"shelf":2,"type":"scale1","slots":null,"productData":[{"slot":1,"barcode":"2023000000014","productId":"0def81a0-3a2b-42f7-b26b-cf234266fb42","trainingTimestamp":"2025-01-02T09:11:28.286Z"},{"slot":2,"barcode":"2023000000014","productId":"0def81a0-3a2b-42f7-b26b-cf234266fb42","trainingTimestamp":"2025-01-02T09:11:28.286Z"},{"slot":3,"barcode":"2023000000014","productId":"0def81a0-3a2b-42f7-b26b-cf234266fb42","trainingTimestamp":"2025-01-02T09:11:28.286Z"}]}],"shelvesCount":3}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["planogram"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"put":{"summary":"create or merge planogram per device","description":"create or merge planogram per device","consumes":["application/json"],"parameters":[{"name":"deviceCode","in":"path","type":"string","description":"device code per cabinet","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new subscription data.","required":true,"example":{"shelves":[{"shelf":11,"type":"rfid"},{"shelf":1,"type":"scale1","slots":[{"slot":1,"barcode":"2023000000014"},{"slot":2,"barcode":"2023000000014"},{"slot":3,"barcode":"2023000000014"}]},{"shelf":2,"type":"scale1","slots":[{"slot":1,"barcode":"2023000000014"},{"slot":2,"barcode":"2023000000014"},{"slot":3,"barcode":"2023000000014"}]}]}}],"responses":{"200":{"description":"Success"},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["planogram"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Delete planogram per device","description":"Delete planogram per device","consumes":["application/json"],"parameters":[{"name":"deviceCode","in":"path","type":"string","description":"Device code","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true}],"responses":{"200":{"description":"Success"},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["planogram"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/automation/check":{"post":{"summary":"Creates a new automation record","description":"Expects the automation record data","consumes":["application/json","text/json"],"parameters":[{"name":"data","in":"body","type":"object","description":"The automation record data","required":true,"example":{"deviceCodeList":["deviceCode1","deviceCode2"],"username":"username","type":"type","organizationId":"group"}}],"responses":{"200":{"description":"Checked automation record","schema":{"example":{"msg":"Automation check passed"}}},"401":{"description":"Not authenticated"},"5XX":{"description":"General server error happened."}},"tags":["automation"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/inventory-correction/{id}":{"put":{"summary":"Updates device's inventory for the specific slot and shelf number","description":"\n        To manually update the product or products amount in the specific slot and shelf number for a device.\n      ","consumes":["application/json","text/json"],"parameters":[{"in":"path","name":"id","type":"string","description":"Device code","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The product, shelf and slot information","required":true,"schema":{"$ref":"#/definitions/InventoryCorrectionPutRequest"}}],"responses":{"200":{"description":"Notification is created successfully.","schema":{"$ref":"#/definitions/InventoryCorrectionPutSuccessResponse"}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["inventory-correction"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v1/__adhoc/integration/pushOrder":{"post":{"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/__adhoc"}}],"responses":{"201":{"description":"created"},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Creates a new resource with data.","summary":"","tags":["__adhoc"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/used-cabinet/{id}":{"get":{"summary":"Returns all the cabinets used by user Id.","description":"Returns all the cabinets used by user Id","parameters":[{"name":"userId","in":"path","type":"string","description":"User Id","required":true}],"responses":{"200":{"description":"Cabinets","schema":{"type":"array","items":{"$ref":"#/definitions/UsedCabinetResponse"}}},"400":{"description":"Bad request. Something went wrong, see the message in the response."},"401":{"description":"Not authenticated."},"5XX":{"description":"Unexpected server error."}},"tags":["used-cabinet"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/printer-queue":{"get":{"summary":"Gets printer queue records by group","description":"Gets printer queue records by group","consumes":["application/json"],"parameters":[{"name":"group","in":"query","type":"string","description":"Organization's id of the device","required":true}],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/PrinterQueueGetItem"}}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"500":{"description":"General server error happened."}},"tags":["printer-queue"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"post":{"summary":"create printer queue record","description":"create printer queue record","consumes":["application/json"],"parameters":[{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new subscription data.","required":true,"schema":{"$ref":"#/definitions/PrinterQueuePostItem"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PrinterQueueGetItem"}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"500":{"description":"General server error happened."}},"tags":["printer-queue"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v3/printer-queue/{id}":{"put":{"summary":"Update printer queue record","description":"Update printer queue record","consumes":["application/json"],"parameters":[{"name":"id","in":"path","type":"string","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true},{"name":"body","in":"body","description":"The new subscription data.","required":true,"schema":{"$ref":"#/definitions/PrinterQueuePostItem"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/PrinterQueueGetItem"}},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["printer-queue"],"produces":["application/json"],"security":{},"securityDefinitions":{}},"delete":{"summary":"Delete printer queue record","description":"Delete printer queue record","consumes":["application/json"],"parameters":[{"name":"id","in":"path","type":"string","required":true},{"in":"query","name":"group","type":"string","description":"Organization Id","required":true}],"responses":{"200":{"description":"Success"},"401":{"description":"Not authenticated"},"404":{"description":"Not found"},"5XX":{"description":"General server error happened."}},"tags":["printer-queue"],"produces":["application/json"],"security":{},"securityDefinitions":{}}},"/api/v4/me":{"get":{"parameters":[{"description":"Number of results to return","in":"query","name":"$limit","type":"integer"},{"description":"Number of results to skip","in":"query","name":"$skip","type":"integer"},{"description":"Property to sort results","in":"query","name":"$sort","type":"string"}],"responses":{"200":{"description":"success","schema":{"$ref":"#/definitions/me list"}},"401":{"description":"not authenticated"},"500":{"description":"general error"}},"description":"Retrieves a list of all resources from the service.","summary":"","tags":["me"],"consumes":["application/json"],"produces":["application/json"],"security":{},"securityDefinitions":{}}}},"definitions":{"PaymentSessionsCreateRequest":{"properties":{"deviceCode":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"transactionType":{"enum":["AuthorizeCapture"],"type":"string"},"paymentProvider":{"type":"string"},"authorizationStatus":{"enum":["AuthorizationSuccess","AuthorizationFail"],"type":"string"},"cardIdentifier":{"$ref":"#/definitions/PaymentInformation"},"language":{"type":"string"}},"required":["deviceCode","transactionType","paymentProvider","transactionId","transactionReference"],"type":"object"},"PaymentInformation":{"additionalProperties":false,"properties":{"media":{"enum":["Unknown","EMV","LocalCard","MobilePay","Swish","Vipps"],"type":"string"},"customerIdentifiers":{"items":{"$ref":"#/definitions/CustomerIdentifier"},"type":"array","nullable":true}},"type":"object"},"CustomerIdentifier":{"additionalProperties":false,"properties":{"type":{"enum":["PAN","EmvHash31","EmvHash32"],"type":"string"},"value":{"maxLength":80,"type":"string"},"encoding":{"enum":["None","Base64","HEX","UUID"],"type":"string"}},"required":["type","value","encoding"],"type":"object"},"PaymentSessionsCreateSuccessResponse":{"properties":{"id":{"type":"string"},"status":{"type":"string"},"createDate":{"type":"string"},"paymentSession":{"$ref":"#/definitions/PaymentSessionsCreateRequest"}},"type":"object"},"PaymentSessionsCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCreateForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsDeleteSuccessResponse":{"type":"boolean","example":"true"},"PaymentSessionsDeleteBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsDeleteNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsDeleteNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsReversalCreateRequest":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"paymentProvider":{"type":"string"},"error":{"type":"string","nullable":true}},"required":["deviceCode","transactionId","transactionReference","paymentProvider"],"type":"object"},"PaymentSessionsReversalCreateSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"paymentProvider":{"type":"string"},"error":{"type":"string"}},"type":"object"},"PaymentSessionsReversalCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsReversalCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsReversalCreateForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsReversalCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCaptureCreateRequest":{"additionalProperties":false,"properties":{"paymentProvider":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"deviceCode":{"type":"string"},"error":{"type":"string","nullable":true},"chargedAmount":{"$ref":"#definitions/PaymentSessionsCaptureCreateRequestPriceInfo","nullable":true},"receiptItems":{"items":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequestReceiptItem"},"type":"array","nullable":true},"remainingAmount":{"$ref":"#definitions/PaymentSessionsCapturRemainingAmount"}},"required":["transactionId","transactionReference","deviceCode","paymentProvider"],"type":"object"},"PaymentSessionsCaptureCreateRequestPriceInfo":{"additionalProperties":false,"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"},"vat":{"format":"int64","type":"integer"}},"type":"object","required":["currency","amount","exponent"]},"PaymentSessionsCapturRemainingAmount":{"additionalProperties":false,"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"},"reason":{"enum":["TransactionComplete","AuthorizedAmountExceeded","OutOfBalance","CardRejected","CancelledByDevice"],"type":"string"}},"type":"object","required":["amount","exponent"]},"PaymentSessionsCaptureCreateRequestReceiptItem":{"additionalProperties":false,"properties":{"productId":{"type":"string"},"itemId":{"type":"string"},"name":{"items":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequestTranslation"},"type":"array"},"price":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequestPriceInfo"},"discount":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequestDiscount"}},"required":["price"],"type":"object"},"PaymentSessionsCaptureCreateRequestTranslation":{"additionalProperties":false,"properties":{"language":{"type":"string"},"value":{"type":"string"}},"type":"object"},"PaymentSessionsCaptureCreateRequestDiscount":{"additionalProperties":false,"properties":{"amount":{"format":"int64","type":"integer","nullable":true},"exponent":{"format":"int64","type":"integer","nullable":true},"percentage":{"format":"int64","type":"integer","nullable":true},"descriptions":{"items":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequestTranslation"},"type":"array"}},"type":"object"},"PaymentSessionsCaptureCreateSuccessResponse":{"additionalProperties":false,"properties":{"paymentProvider":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"deviceCode":{"type":"string"},"error":{"type":"string"},"chargedAmount":{"$ref":"#definitions/PaymentSessionsCaptureCreateRequestPriceInfo"},"receiptItems":{"items":{"$ref":"#/definitions/PaymentSessionsCaptureCreateRequestReceiptItem"},"type":"array"},"remainingSum":{"type":"number"}},"type":"object"},"PaymentSessionsCaptureCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCaptureCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCaptureCreateForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCaptureCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentItemsUpdateRequest":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"transactionId":{"type":"string"},"totalPriceUnitAmount":{"format":"int64","type":"integer"},"currency":{"type":"string"},"paymentProvider":{"type":"string"},"removedItems":{"items":{"$ref":"#/definitions/PaymentItemsUpdateRequestRemovedItems"},"type":"array"},"unchargedTags":{"items":{"$ref":"#/definitions/PaymentItemsUpdateRequestUnchargedTag"},"type":"array"},"addedItems":{"items":{"$ref":"#/definitions/PaymentItemsUpdateRequestAddedItems"},"type":"array","nullable":true},"orderId":{"type":"string"}},"required":["deviceCode","transactionId","totalPriceUnitAmount","currency","removedItems","paymentProvider","addedItems"],"type":"object"},"PaymentItemsUpdateRequestRemovedItems":{"additionalProperties":false,"properties":{"barcode":{"type":"string"},"epc":{"type":"string"},"name":{"type":"string"},"priceUnitAmount":{"format":"int64","type":"integer"},"originalPriceUnitAmount":{"format":"int64","type":"integer"},"discount":{"$ref":"#/definitions/PaymentItemsUpdateRequestItemsDiscount","nullable":true},"vatPercentage":{"format":"int64","type":"integer"},"imageUrl":{"type":"string","nullable":true},"image":{"type":"string","nullable":true}},"required":["barcode","epc","name","priceUnitAmount","vatPercentage"],"type":"object"},"PaymentItemsUpdateRequestUnchargedTag":{"additionalProperties":false,"properties":{"barcode":{"type":"string"},"epc":{"type":"string"},"reason":{"type":"string"},"price":{"format":"int64","type":"integer"}},"required":["epc"],"type":"object"},"PaymentItemsUpdateRequestAddedItems":{"additionalProperties":false,"properties":{"barcode":{"type":"string"},"epc":{"type":"string"},"name":{"type":"string"},"priceUnitAmount":{"format":"int64","type":"integer"},"originalPriceUnitAmount":{"format":"int64","type":"integer"},"discount":{"$ref":"#/definitions/PaymentItemsUpdateRequestItemsDiscount","nullable":true},"vatPercentage":{"format":"int64","type":"integer"},"imageUrl":{"type":"string"},"image":{"type":"string"}},"required":["barcode","epc","name","priceUnitAmount","vatPercentage"],"type":"object"},"PaymentItemsUpdateRequestItemsDiscount":{"additionalProperties":false,"properties":{"amount":{"format":"int64","type":"integer"},"description":{"type":"string"},"percentage":{"format":"int64","type":"integer"},"discountName":{"type":"string"},"discountId":{"type":"string"},"discountAmount":{"format":"int64","type":"integer"},"discountType":{"type":"string"},"discountAmountType":{"type":"string"}},"required":["amount","description","percentage"],"type":"object"},"PaymentItemsUpdateSuccessResponse":{"additionalProperties":false,"properties":{"success":{"type":"boolean"}},"type":"object"},"PaymentItemsUpdateBadRequestResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"format":"int64","type":"integer","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"object"},"errors":{"type":"object"}},"type":"object"},"PaymentItemsUpdateNotAuthenticatedResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"Not authenticated"},"code":{"format":"int64","type":"integer","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentItemsUpdateNotFoundResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"format":"int64","type":"integer","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsFailureCreateRequest":{"additionalProperties":false,"properties":{"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"deviceCode":{"type":"string"},"error":{"type":"string"},"paymentProvider":{"type":"string"}},"required":["transactionId","transactionReference","deviceCode","error","paymentProvider"],"type":"object"},"PaymentSessionsFailureSuccessResponse":{"additionalProperties":false,"properties":{"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"deviceCode":{"type":"string"},"error":{"type":"string"},"paymentProvider":{"type":"string"}},"type":"object"},"PaymentSessionsFailureBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsFailureNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsFailureForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsFailureNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCancelCreateRequest":{"additionalProperties":false,"properties":{"transactionId":{"type":"string","example":"1212"},"transactionReference":{"type":"string","example":"abcd-ref"},"deviceCode":{"type":"string","example":"a device code"},"paymentProvider":{"type":"string","example":"custom"},"unchargedTags":{"items":{"$ref":"#/definitions/PaymentSessionsCancelUnchargedTag"},"type":"array"},"orderId":{"type":"string"}},"required":["transactionId","transactionReference","deviceCode","paymentProvider"],"type":"object"},"PaymentSessionsCancelCreateSuccessResponse":{"type":"boolean","example":true},"PaymentSessionsCancelUnchargedTag":{"additionalProperties":false,"properties":{"barcode":{"type":"string"},"epc":{"type":"string"},"reason":{"type":"string"},"price":{"format":"int64","type":"integer"}},"required":["epc"],"type":"object"},"PaymentSessionsCancelCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCancelCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsCancelCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentPosCreateRequest":{"additionalProperties":false,"properties":{"command":{"enum":["reboot","subscribe","unsubscribe","getStatus","listSubscribedTopics"],"type":"string","nullable":false,"required":true},"deviceCode":{"type":"string","nullable":false,"required":true},"paymentProvider":{"type":"string","nullable":false,"required":true}},"required":["operation","deviceCode","paymentProvider"],"type":"object"},"PaymentPosCreateSuccessResponse":{"additionalProperties":false,"properties":{"command":{"type":"string","example":"reboot"},"deviceCode":{"type":"string","example":"if-8-3-2022-b43bbf2"},"paymentProvider":{"type":"string","example":"Selfly Test"}},"type":"object"},"PaymentPosUpdateRequestAuthorizationSettings":{"additionalProperties":false,"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer","nullable":true}},"required":["currency","amount"],"type":"object"},"PaymentPosUpdateRequest":{"additionalProperties":false,"properties":{"operation":{"enum":["OutOfService","Warning","Maintenance","Normal","Pending"],"type":"string"},"message":{"type":"string","nullable":true},"paymentProvider":{"type":"string"},"authorizationSettings":{"$ref":"#/definitions/PaymentPosUpdateRequestAuthorizationSettings","nullable":true},"terminals":{"items":{"$ref":"#/definitions/PaymentPosUpdateRequestTerminals"},"type":"array","nullable":true}},"required":["operation","paymentProvider"],"type":"object"},"PaymentPosUpdateRequestTerminals":{"additionalProperties":false,"properties":{"terminalReference":{"type":"string","nullable":true}},"type":"object"},"PaymentPosUpdateSuccessResponse":{"additionalProperties":false,"properties":{"success":{"type":"boolean","example":true}},"type":"object"},"PaymentPosUpdateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentPosUpdateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentPosUpdateForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentPosUpdateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentHeartBeatCreateRequest":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"requestDate":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"paymentProvider":{"type":"string"}},"required":["deviceCode","paymentProvider"],"type":"object"},"PaymentHeartBeatCreateSuccessResponse":{"type":"boolean","example":true},"PaymentHeartBeatCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentHeartBeatCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentHeartBeatCreateForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentHeartBeatCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentDevicePutRequestAuthorizationSettings":{"additionalProperties":false,"properties":{"currency":{"type":"string"},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"}},"required":["currency","amount"],"type":"object"},"PaymentDevicePutRequest":{"additionalProperties":false,"properties":{"operation":{"enum":["OutOfService","Warning","Maintenance","Normal","Pending"],"type":"string"},"message":{"type":"string","nullable":true},"authorizationSettings":{"$ref":"#/definitions/PaymentDevicePutRequestAuthorizationSettings"},"paymentProvider":{"type":"string"}},"required":["operation","authorizationSettings","paymentProvider"],"type":"object"},"PaymentDevicePutSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"isDeviceUpdated":{"type":"boolean"},"message":{"type":"string"}},"type":"object"},"PaymentDevicePutBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentDevicePutNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentDevicePutNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentDeviceCreateRequest":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"paymentProvider":{"type":"string"}},"required":["deviceCode","paymentProvider"],"type":"object"},"PaymentDeviceCreateSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"paymentProvider":{"type":"string"}},"type":"object"},"PaymentDeviceCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentDeviceCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentDeviceCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentPingFindSuccessResponse":{"additionalProperties":false,"properties":{"status":{"format":"int64","type":"integer","example":200}},"type":"object"},"PaymentPingFindNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentPingFindForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentRemainingAmountCreateRequest":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"transactionReference":{"type":"string"},"remainingAmount":{"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"},"reason":{"enum":["TransactionComplete","AuthorizedAmountExceeded","OutOfBalance","CardRejected","CancelledByDevice"],"type":"string"}},"type":"object","required":["amount","exponent"]},"paymentProvider":{"type":"string"}},"required":["deviceCode","remainingAmount","transactionReference","paymentProvider"],"type":"object"},"PaymentRemainingAmountCreateSuccessResponse":{"properties":{"isPurchaseCreated":{"type":"boolean"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"transactionType":{"type":"string"},"transactionState":{"type":"string"},"language":{"type":"string"},"error":{"type":"string"}},"type":"object"},"PaymentRemainingAmountCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentRemainingAmountCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentRemainingAmountCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"RemainingAmountCancelCreateRequest":{"additionalProperties":false,"properties":{"transactionId":{"type":"string","example":"1212"},"transactionReference":{"type":"string","example":"abcd-ref"},"deviceCode":{"type":"string","example":"a device code"},"paymentProvider":{"type":"string","example":"custom"}},"required":["transactionId","transactionReference","deviceCode","paymentProvider"],"type":"object"},"RemainingAmountCancelCreateSuccessResponse":{"type":"boolean","example":true},"RemainingAmountCancelCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"RemainingAmountCancelCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"RemainingAmountCancelCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsResetCreateRequest":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"paymentProvider":{"type":"string","nullable":true}},"required":["deviceCode"],"type":"object"},"PaymentSessionsResetSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string"},"paymentProvider":{"type":"string"}},"type":"object"},"PaymentSessionsResetBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"deviceCode is required."},"path":{"type":"array","items":{"type":"string","example":"deviceCode"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"deviceCode"},"key":{"type":"string","example":"deviceCode"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsResetNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsResetNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsPurchaseCreateRequest":{"additionalProperties":false,"properties":{"paymentProvider":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"deviceCode":{"type":"string"},"error":{"type":"string"},"chargedAmount":{"$ref":"#definitions/PaymentSessionsPurhcaseCreateRequestChargedAmount"},"receiptItems":{"items":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestReceiptItem"},"type":"array"},"remainingAmount":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestRemainingAmount"}},"required":["transactionId","transactionReference","deviceCode","paymentProvider","remaniningAmount"],"type":"object"},"PaymentSessionsPurchaseCreateRequestRemainingAmount":{"additionalProperties":false,"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"},"reason":{"enum":["TransactionComplete","AuthorizedAmountExceeded","OutOfBalance","CardRejected","CancelledByDevice"],"type":"string"}},"type":"object","required":["amount","exponent"]},"PaymentSessionsPurchaseCreateRequestChargedAmount":{"additionalProperties":false,"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"amount":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"}},"type":"object","required":["currency","price","exponent"]},"PaymentSessionsPurchaseCreateRequestPriceInfo":{"additionalProperties":false,"properties":{"currency":{"type":"string","maxLength":3,"minLength":3},"price":{"format":"int64","type":"integer"},"vat":{"format":"int64","type":"integer"},"exponent":{"format":"int64","type":"integer"}},"type":"object","required":["currency","price","vat"]},"PaymentSessionsPurchaseCreateRequestReceiptItem":{"additionalProperties":false,"properties":{"productId":{"type":"string"},"itemId":{"type":"string"},"name":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestTranslation"},"price":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestPriceInfo"},"discount":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestDiscount"}},"required":["price"],"type":"object"},"PaymentSessionsPurchaseCreateRequestTranslation":{"additionalProperties":false,"properties":{"english":{"type":"string"},"danish":{"type":"string"},"swedish":{"type":"string"},"norwegian":{"type":"string"}},"type":"object"},"PaymentSessionsPurchaseCreateRequestDiscount":{"additionalProperties":false,"properties":{"discount":{"format":"int64","type":"integer"},"discountDescription":{"type":"string"}},"type":"object"},"PaymentSessionsPurchaseCreateSuccessResponse":{"additionalProperties":false,"properties":{"paymentProvider":{"type":"string"},"transactionId":{"type":"string"},"transactionReference":{"type":"string"},"deviceCode":{"type":"string"},"error":{"type":"string"},"chargedAmount":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestChargedAmount"},"receiptItems":{"items":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestReceiptItem"},"type":"array"},"remainingAmount":{"$ref":"#/definitions/PaymentSessionsPurchaseCreateRequestRemainingAmount"}},"type":"object"},"PaymentSessionsPurchaseCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsPurchaseCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsPurchaseCreateForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":"Payment Provider"}}}},"errors":{"type":"object"}},"type":"object"},"PaymentSessionsPurchaseCreateNotFoundResponse":{"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Payment instance id not found with device code {deviceCode}"},"code":{"type":"number","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"PostRequestBodyAndSuccessResponse":{"additionalProperties":false,"properties":{"name":{"type":"string"},"baseUrl":{"type":"string"},"apiKey":{"type":"string"},"organization":{"type":"string"}},"required":["name","baseUrl","apiKey","organization"],"type":"object"},"PutRequestBody":{"additionalProperties":false,"properties":{"name":{"type":"string"},"baseUrl":{"type":"string"},"apiKey":{"type":"string"}},"required":["name"],"type":"object"},"PutSuccessResponse":{"additionalProperties":false,"properties":{"name":{"type":"string"},"baseUrl":{"type":"string"},"apiKey":{"type":"string"},"organization":{"type":"string"}},"required":["name","baseUrl","apiKey","organization"],"type":"object"},"CreateRequest":{"properties":{"deviceCode":{"type":"string"},"organizationId":{"type":"string"},"userKeyId":{"type":"string"},"paymentProvider":{"type":"string"},"metaData":{"type":"object"}},"required":["deviceCode","organizationId","userKeyId","paymentProvider"],"type":"object"},"CreateValidateUserKeySuccessResponse":{"additionalProperties":false,"properties":{"isUserBlocked":{"type":"boolean","example":true},"orderIds":{"type":"array","example":["Order-1221a21aa16"]},"dueAmount":{"type":"number","example":12.2},"blockReasonIds":{"type":"array","example":[1]}},"type":"object"},"CreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"paymentProvider is required."},"path":{"type":"array","items":{"type":"string","example":"paymentProvider"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"paymentProvider"},"key":{"type":"string","example":"paymentProvider"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"CreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"EnableFATSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string","example":"00000000-0000-0000-0000-000000000000"}},"type":"object"},"EnableFATNotAuthenticatedResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"Not authenticated"},"code":{"format":"int64","type":"integer","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"EnableFATForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":["Production Operator","Cabinet Operator","Administrator"]}}}},"errors":{"type":"object"}},"type":"object"},"EnableFATNotFoundResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Cabinet id not found with device code {deviceCode}"},"code":{"format":"int64","type":"integer","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"ReconfigureCreateRequest":{"additionalProperties":false,"type":"object","properties":{"configuration":{"type":"object","required":["type","code","name","organization","reprovisionMode","tags","settings"],"properties":{"type":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"organization":{"type":"string"},"description":{"type":"string"},"reprovisionMode":{"type":"number"},"tags":{"properties":{"cardPayment":{"type":"string"}}},"settings":{"required":["payment","timeZone","country"],"properties":{"cardPayment":{"type":"string"},"payment":{"type":"string"},"timeZone":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"}}}}}}},"ReconfigureCreateSuccessResponse":{"additionalProperties":false,"properties":{"message":{"type":"string","example":"OK"}},"type":"object"},"ReconfigureCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"deviceCode is required."},"path":{"type":"array","items":{"type":"string","example":"deviceCode"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"deviceCode"},"key":{"type":"string","example":"deviceCode"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"ReconfigureCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"ConfigureUpdateRequest":{"additionalProperties":false,"type":"object","required":["Code","Name","Organization"],"properties":{"Code":{"type":"string"},"Name":{"type":"string"},"SubType":{"type":"string"},"Type":{"type":"string"},"Organization":{"type":"string"},"Description":{"type":"string"},"Address":{"type":"string"},"Latitude":{"type":"string"},"Longitude":{"type":"string"},"Tags":{"type":"string"}}},"ReplaceCreateRequest":{"additionalProperties":false,"type":"object","required":["targetId","replacementId"],"properties":{"targetId":{"type":"string"},"replacementId":{"type":"string"}}},"RetireCreateRequest":{"additionalProperties":false,"type":"object","required":["targetId"],"properties":{"targetId":{"type":"string"}}},"CreateEndpointCreateRequest":{"additionalProperties":false,"type":"object","required":["id","password","type"],"properties":{"id":{"type":"string"},"password":{"type":"string"},"type":{"type":"string"},"subType":{"type":"string"},"osVersion":{"type":"string"},"meta":{"type":"object"}}},"RegisterCreateRequest":{"additionalProperties":false,"type":"object","required":["password"],"properties":{"password":{"type":"string"}}},"TeststatusUpdateRequest":{"additionalProperties":false,"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"NotificationSystemPostRequest":{"properties":{"subscriptionField":{"type":"array","items":{"type":"string"},"example":["cabinetState","door"]},"devicesScope":{"type":"array","items":{"type":"string"},"example":["deviceCode1","deviceCode2"]}},"required":["subscriptionField"],"type":"object"},"NotificationSystemPostSuccessResponse":{"properties":{"devicesScope":{"type":"array","items":{"type":"string"},"example":["deviceCode1","deviceCode2"]},"subscriptionField":{"type":"array","items":{"type":"string"},"example":["cabinetState","door"]},"id":{"type":"string","example":"03b063c7-a4eb-4ad8-8bfe-da68f5c69da6"},"topicConnectionString":{"type":"string","example":"topicConnectionString"},"topicName":{"type":"string","example":"topic name"},"subscriptionName":{"type":"string","example":"1684485404583"},"serviceBusDomain":{"type":"string","example":"se-ipa-servicebus-qa.servicebus.windows.net"}},"type":"object"},"NotificationSystemFindSuccessResponse":{"type":"array","items":{"properties":{"id":{"type":"string","description":"Id of subscription","example":"7954dcab-6a78-4be4-a875-ac2defd75c95"},"subscriptionName":{"type":"string","description":"name of subscription","example":"1683713543283"},"topicName":{"type":"string","description":"name of topic","example":"SelflyDemo"},"organizationId":{"type":"string","description":"Id of organization","example":"Selfly Demo"},"subscriptionField":{"type":"array","description":"List of group field user susbscribed for","items":{"type":"string"},"example":["cabinetState","door"]},"scope":{"type":"string","description":"Subscrition level user susbscribed for, either organization or devices","example":"devices"},"devicesScope":{"type":"array","description":"List of device codes","items":{"type":"string"},"example":["deviceCode1","deviceCode2"]},"created":{"type":"string","description":"time of creation","example":"2023-01-01T00:00:00.000Z"},"topicConnectionString":{"type":"string","description":"connection string client need to use for conneecting to service bus.","example":"topicConnectionString"},"serviceBusDomain":{"type":"string","description":"Domain name of service bus","example":"se-ipa-servicebus-qa.servicebus.windows.net"}}}},"NotificationSystemGetSuccessResponse":{"properties":{"topicName":{"type":"string","example":"topic name"},"organizationId":{"type":"string","example":"Id of the organization"},"updatedAt":{"type":"string","example":"last update date"},"topicConnectionString":{"type":"string","example":"topic connection string"}},"type":"object"},"UserKeysCreateRequest":{"additionalProperties":false,"type":"object","required":["status","paymentMethod","allowBalance","validForPurchase"],"properties":{"status":{"type":"number"},"paymentMethod":{"type":"string"},"allowBalance":{"type":"boolean"},"balance":{"type":"number"},"currency":{"type":"string"},"validityTimeStart":{"type":"date"},"validityTimeEnd":{"type":"date"},"validForPurchase":{"type":"boolean"},"metaData":{"type":"object"}}},"UserKeysCreateSuccessResponse":{"additionalProperties":false,"properties":{"message":{"type":"string","example":"OK"}},"type":"object"},"UserKeysCreateBadRequestResponse":{"properties":{"name":{"type":"string","example":"BadRequest"},"message":{"type":"string","example":"Invalid request body"},"code":{"type":"number","example":400},"className":{"type":"string","example":"bad-request"},"data":{"type":"array","items":{"properties":{"message":{"type":"string","example":"status is required."},"path":{"type":"array","items":{"type":"string","example":"status"}},"type":{"type":"string","example":"any.required"},"context":{"type":"object","properties":{"label":{"type":"string","example":"status"},"key":{"type":"string","example":"status"}}}},"type":"object"}},"errors":{"type":"object"}},"type":"object"},"UserKeysCreateNotAuthenticatedResponse":{"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"jwt expired"},"code":{"type":"number","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"StartOATSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string","example":"00000000-0000-0000-0000-000000000000"}},"type":"object"},"StartOATNotAuthenticatedResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"Not authenticated"},"code":{"format":"int64","type":"integer","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"StartOATForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":["Production Operator","Cabinet Operator","Administrator"]}}}},"errors":{"type":"object"}},"type":"object"},"StartOATNotFoundResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Cabinet id not found with device code {deviceCode}"},"code":{"format":"int64","type":"integer","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"EndOATSuccessResponse":{"additionalProperties":false,"properties":{"deviceCode":{"type":"string","example":"00000000-0000-0000-0000-000000000000"},"isAccepted":{"type":"string","example":"true"}},"type":"object"},"EndOATNotAuthenticatedResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotAuthenticated"},"message":{"type":"string","example":"Not authenticated"},"code":{"format":"int64","type":"integer","example":401},"className":{"type":"string","example":"not-authenticated"},"errors":{"type":"object"}},"type":"object"},"EndOATForbiddenResponse":{"properties":{"name":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"User is not authorized to execute command. User need to be in the roles:"},"code":{"type":"number","example":403},"className":{"type":"string","example":"forbidden"},"data":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","example":["Production Operator","Cabinet Operator","Administrator"]}}}},"errors":{"type":"object"}},"type":"object"},"EndOATNotFoundResponse":{"additionalProperties":false,"properties":{"name":{"type":"string","example":"NotFound"},"message":{"type":"string","example":"Cabinet id not found with device code {deviceCode}"},"code":{"format":"int64","type":"integer","example":404},"className":{"type":"string","example":"not-found"},"errors":{"type":"object"}},"type":"object"},"BlacklistPost":{"properties":{"unpaidAmount":{"type":"number","example":12.2},"customerId":{"type":"string","example":"abc123"},"deviceCode":{"type":"string","example":"exampleCode"},"paymentMethod":{"type":"string","example":"payment1"},"orderId":{"type":"string","example":"OrderId-121321321XX"}},"required":["unpaidAmount","customerId","deviceCode","paymentMethod"],"type":"object"},"ConfigureSelflyEncodeUpdateRequest":{"additionalProperties":false,"type":"object","required":["code","name","organization"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"organization":{"type":"string"},"description":{"type":"string"},"address":{"type":"string"},"latitude":{"type":"string"},"longitude":{"type":"string"},"tags":{"type":"string"}}},"ProductSurchargePost":{"properties":{"valueType":{"type":"number","example":1,"required":true},"surchargeType":{"type":"number","example":4,"required":true},"value":{"type":"number","example":18,"required":true},"name":{"type":"string","example":"stateTax","required":true},"externalCode":{"type":"string","example":"code123","required":false},"appliedOn":{"type":"string","example":"base","values":["base","all","onlyDeposite","none"],"required":true}},"required":["valueType","surchargeType","value","name","appliedOn"],"type":"object"},"ProductSurchargePut":{"properties":{"valueType":{"type":"number","example":1,"required":false},"surchargeType":{"type":"number","example":4,"required":false},"value":{"type":"number","example":18,"required":false},"name":{"type":"string","example":"stateTax","required":false},"externalCode":{"type":"string","example":"code123","required":false},"appliedOn":{"type":"string","example":"base","values":["base","all","onlyDeposite","none"],"required":false}},"type":"object"},"InventoryCorrectionPutRequest":{"properties":{"shelfId":{"type":"string","required":true,"example":"1"},"slotId":{"type":"string","required":true,"example":"3"},"productData":{"type":"array","items":{"id":{"type":"string","required":true,"example":"productId"},"amount":{"type":"number","required":true,"example":2}},"required":true,"example":[{"id":"productId","amount":5}]}},"required":["shelfId","slotId","productData"],"type":"object"},"InventoryCorrectionPutSuccessResponse":{"properties":{"shelfId":{"type":"string","example":"1"},"slotId":{"type":"string","example":"3"},"productData":{"type":"array","items":{"id":{"type":"string","example":"productId"},"amount":{"type":"number","example":2}},"example":[{"id":"productId","amount":5}]}},"type":"object"},"UsedCabinetResponse":{"type":"object","properties":{"deviceName":{"type":"string","example":"yiqing-dev-local-device"},"locationName":{"type":"string","example":"Yiqing's home"},"isConnected":{"type":"boolean","example":false},"deviceCode":{"type":"string","format":"uuid","example":"bd84af7d-028b-489b-ae5b-d1f39620ed6b"}}},"PrinterQueueGetItem":{"type":"object","properties":{"tagType":{"type":"string","description":"Type of the tag, e.g., 'AD Micro'"},"barcode":{"type":"string","description":"Barcode value, e.g., '4228231024862'"},"selectedDate":{"type":"string","description":"Selected date in a specific string format, e.g., '251177'"},"printExpiryDate":{"type":"boolean","description":"Indicates if the expiry date should be printed"},"printBarcode":{"type":"boolean","description":"Indicates if the barcode should be printed"},"printEpc":{"type":"boolean","description":"Indicates if the EPC should be printed"},"printProductName":{"type":"boolean","description":"Indicates if the product name should be printed"},"printBannerText":{"type":"boolean","description":"Indicates if the banner text should be printed"},"name":{"type":"string","description":"Name of the product, e.g., 'A product'"},"imageUrl":{"type":"string","format":"url","description":"URL of the product image, e.g., 'www.gole.com/aa.jpg'"},"amount":{"type":"integer","format":"int32","description":"Amount of the product, e.g., 22"},"encodeExpiryDate":{"type":"boolean","description":"Indicates if the expiry date should be encoded"},"organizationId":{"type":"string","description":"ID of the organization, e.g., 'Selfly Demo'"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the tag creation, e.g., '2025-05-23T08:36:20.010Z'"},"id":{"type":"string","format":"uuid","description":"Unique identifier of the tag, e.g., '9a6ab4fb-01db-457c-834e-906bfcdcd01a'"}}},"PrinterQueuePostItem":{"type":"object","properties":{"tagType":{"type":"string","description":"Type of the tag, e.g., 'AD Micro'"},"barcode":{"type":"string","description":"Barcode value, e.g., '4228231024862'"},"selectedDate":{"type":"string","description":"Selected date in a specific string format, e.g., '2025-05-23'","example":"2025-05-23"},"printExpiryDate":{"type":"boolean","description":"Indicates if the expiry date should be printed"},"printBarcode":{"type":"boolean","description":"Indicates if the barcode should be printed"},"printEpc":{"type":"boolean","description":"Indicates if the EPC should be printed"},"printProductName":{"type":"boolean","description":"Indicates if the product name should be printed"},"printBannerText":{"type":"boolean","description":"Indicates if the banner text should be printed"},"name":{"type":"string","description":"Name of the product, e.g., 'A product'"},"imageUrl":{"type":"string","format":"url","description":"URL of the product image, e.g., 'www.gole.com/aa.jpg'"},"amount":{"type":"integer","format":"int32","description":"Amount of the product, e.g., 22"},"encodeExpiryDate":{"type":"boolean","description":"Indicates if the expiry date should be encoded"}}}},"swagger":"2.0","schemes":["https"],"tags":[{"name":"settings","description":"A settings service","externalDocs":{}},{"name":"products","description":"A products service","externalDocs":{}},{"name":"supplier","description":"A supplier service","externalDocs":{}},{"name":"payment","description":"A payment service","externalDocs":{}},{"name":"qrcode","description":"A qrcode service","externalDocs":{}},{"name":"__adhoc","description":"A __adhoc service","externalDocs":{}},{"name":"command","description":"A command service","externalDocs":{}},{"name":"advertisements","description":"A advertisements service","externalDocs":{}},{"name":"product-image","description":"Responsible for uploading images to the CDN corresponding to the given products.","externalDocs":{}},{"name":"advertisement-image","description":"Responsible for uploading images to the CDN corresponding to the given advertisement.","externalDocs":{}},{"name":"advertisement-media","description":"Responsible for uploading images to the CDN corresponding to the given advertisement.","externalDocs":{}},{"name":"logo-image","description":"Responsible for uploading images to the CDN corresponding to the given logos.","externalDocs":{}},{"name":"inventory","description":"Service to fetch inventory of cabinet","externalDocs":{}},{"name":"transactions","description":"A transactions service","externalDocs":{}},{"name":"encoding-instruction","description":"A encoding-instruction service","externalDocs":{}},{"name":"refund","description":"A refund service","externalDocs":{}},{"name":"audit","description":"Service to fetch device audit events.","externalDocs":{}},{"name":"cabinets","description":"A cabinets service","externalDocs":{}},{"name":"refill","description":"A refill service","externalDocs":{}},{"name":"cube","description":"A cube service","externalDocs":{}},{"name":"cube-meta","description":"A cube-meta service","externalDocs":{}},{"name":"user-check-in","description":"A user-check-in service","externalDocs":{}},{"name":"user-check-out","description":"A user-check-out service","externalDocs":{}},{"name":"notification","description":"A notification service","externalDocs":{}},{"name":"vat","description":"A vat service","externalDocs":{}},{"name":"geoinfo","description":"A geoinfo service","externalDocs":{}},{"name":"expiry-events","description":"A expiry-events service","externalDocs":{}},{"name":"discount-rules","description":"A discount-rules service","externalDocs":{}},{"name":"discount-rule-stops","description":"A discount-rule-stops service","externalDocs":{}},{"name":"tag-type","description":"A tag-type service","externalDocs":{}},{"name":"setting-types","description":"A setting-types service","externalDocs":{}},{"name":"release-version","description":"A release-version service","externalDocs":{}},{"name":"os","description":"A os service","externalDocs":{}},{"name":"device-component","description":"A device-component service","externalDocs":{}},{"name":"device-release-version","description":"A device-release-version service","externalDocs":{}},{"name":"product-category","description":"A product-category service","externalDocs":{}},{"name":"discounts","description":"A discounts service","externalDocs":{}},{"name":"revenue-italian-market","description":"A revenue-italian-market service","externalDocs":{}},{"name":"consumer-feedback","description":"A consumer-feedback service","externalDocs":{}},{"name":"encodingDevices","description":"A encodingDevices service","externalDocs":{}},{"name":"provisioning","description":"A provisioning service","externalDocs":{}},{"name":"discount-image","description":"Responsible for uploading images to the CDN corresponding to the given bundle discount.","externalDocs":{}},{"name":"bundle-discount-image","description":"Responsible for uploading images to the CDN corresponding to the given bundle discount.","externalDocs":{}},{"name":"saveFATResults","description":"A saveFATResults service","externalDocs":{}},{"name":"notification_subscriptions","description":"A notification_subscriptions service","externalDocs":{}},{"name":"user-keys","description":"A user-keys service","externalDocs":{}},{"name":"refill-rules","description":"A refill-rules service","externalDocs":{}},{"name":"refill-plans","description":"A refill-plans service","externalDocs":{}},{"name":"refill-plan-suggestions","description":"A refill-plan-suggestions service","externalDocs":{}},{"name":"cabinet-state","description":"A cabinet-state service","externalDocs":{}},{"name":"theme-images","description":"Responsible for uploading images to the CDN for background image of cabinet screen.","externalDocs":{}},{"name":"product-class","description":"A product-class service","externalDocs":{}},{"name":"product-label","description":"A product-label service","externalDocs":{}},{"name":"saveOATResults","description":"A saveOATResults service","externalDocs":{}},{"name":"blacklist","description":"A blacklist service","externalDocs":{}},{"name":"automation","description":"A automation service","externalDocs":{}},{"name":"provisioning-selfly-encode","description":"A provisioning-selfly-encode service","externalDocs":{}},{"name":"product-surcharge","description":"A product-surcharge service","externalDocs":{}},{"name":"image-upload","description":"The API uploads image.(The api now supports image upload only for planogram.)","externalDocs":{}},{"name":"user-discount-apply","description":"A user-discount-apply service","externalDocs":{}},{"name":"refill-transaction","description":"A refill-transaction service","externalDocs":{}},{"name":"planogram","description":"A planogram service","externalDocs":{}},{"name":"inventory-correction","description":"A inventory-correction service","externalDocs":{}},{"name":"used-cabinet","description":"A used-cabinet service","externalDocs":{}},{"name":"printer-queue","description":"A printer-queue service","externalDocs":{}},{"name":"me","description":"A me service","externalDocs":{}}],"basePath":"","docsPath":"/docs","consumes":["application/json"],"produces":["application/json"],"info":{"title":"Selfly Cloud API Documentation.","description":"Main endpoint API for the Selfly Cloud usage. \n      Contacts: [supportt@selflystore.com](mailto:support@selflystore.com)"},"ignore":{"tags":["authentication","users","organization","transaction-e-receipt","api","account"]},"uiIndex":true,"prefix":{}}