grocy/grocy.openapi.json
Bernd Bestel 35fb87ab1e
Squashed commit
Use managed fonts
Include userentities dynamically in grocy.openapi.json for /userfields/{entity}/{objectId} endpoints (closes #1218)
Fixed userfieldsform load / save (for products and recipes) handling (fixes #1302)
Fixed PUT/DELETE /objects/{entity}/{objectId} when the given object id was invalid (fixes #1396)
Allow arrays in HTMLPurifier (fixes #1407)
2021-06-28 17:00:16 +02:00

5466 lines
124 KiB
JSON

{
"openapi": "3.0.0",
"info": {
"title": "grocy REST API",
"description": "Authentication is done via API keys (header *GROCY-API-KEY* or same named query parameter), which you can manage [here](PlaceHolderManageApiKeysUrl).<br>Additionally requests from within the frontend are also valid (via session cookie).",
"version": "xxx",
"license": {
"name": "grocy.info",
"url": "https://grocy.info"
}
},
"servers": [
{
"url": "xxx"
}
],
"tags": [
{
"name": "Generic entity interactions",
"description": "A limited set of entities are directly exposed for convenience"
},
{
"name": "System"
},
{
"name": "User management"
},
{
"name": "Current user"
},
{
"name": "Stock"
},
{
"name": "Stock \"by-barcode\"",
"description": "Some of the *Stock* routes, but access them by the products barcode instead of its id"
},
{
"name": "Recipes"
},
{
"name": "Chores"
},
{
"name": "Batteries"
},
{
"name": "Tasks"
},
{
"name": "Calendar"
},
{
"name": "Files"
},
{
"name": "Print"
}
],
"paths": {
"/system/info": {
"get": {
"summary": "Returns information about the installed grocy, PHP and SQLite version",
"tags": [
"System"
],
"responses": {
"200": {
"description": "An DbChangedTimeResponse object",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"grocy_version": {
"type": "object",
"properties": {
"Version": {
"type": "string"
},
"ReleaseDate": {
"type": "string",
"format": "date"
}
}
},
"php_version": {
"type": "string"
},
"sqlite_version": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/system/db-changed-time": {
"get": {
"summary": "Returns the time when the database was last changed",
"tags": [
"System"
],
"responses": {
"200": {
"description": "An DbChangedTimeResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DbChangedTimeResponse"
}
}
}
}
}
}
},
"/system/config": {
"get": {
"summary": "Returns all config settings",
"tags": [
"System"
],
"responses": {
"200": {
"description": "Key/value pairs of config settings",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Key/value pairs of config settings"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/system/time": {
"get": {
"summary": "Returns the current server time",
"tags": [
"System"
],
"parameters": [
{
"$ref": "#/components/parameters/offsettime"
}
],
"responses": {
"200": {
"description": "A TimeResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TimeResponse"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/system/log-missing-localization": {
"post": {
"summary": "Logs a missing localization string",
"description": "Only when MODE == 'dev', so should only be called then",
"tags": [
"System"
],
"requestBody": {
"description": "A valid MissingLocalizationRequest object",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MissingLocalizationRequest"
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/objects/{entity}": {
"get": {
"summary": "Returns all objects of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_NotIncludingNotListable"
}
},
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An entity object",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/Product"
},
{
"$ref": "#/components/schemas/Chore"
},
{
"$ref": "#/components/schemas/Battery"
},
{
"$ref": "#/components/schemas/Location"
},
{
"$ref": "#/components/schemas/QuantityUnit"
},
{
"$ref": "#/components/schemas/ShoppingListItem"
},
{
"$ref": "#/components/schemas/StockEntry"
},
{
"$ref": "#/components/schemas/ProductBarcode"
}
]
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
},
"post": {
"summary": "Adds a single object of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_NotIncludingNotEditable"
}
}
],
"requestBody": {
"description": "A valid entity object of the entity specified in parameter *entity*",
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Product"
},
{
"$ref": "#/components/schemas/Chore"
},
{
"$ref": "#/components/schemas/Battery"
},
{
"$ref": "#/components/schemas/Location"
},
{
"$ref": "#/components/schemas/QuantityUnit"
},
{
"$ref": "#/components/schemas/ShoppingListItem"
},
{
"$ref": "#/components/schemas/StockEntry"
},
{
"$ref": "#/components/schemas/ProductBarcode"
}
]
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"created_object_id": {
"type": "number",
"format": "integer",
"description": "The id of the created object"
}
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/objects/{entity}/{objectId}": {
"get": {
"summary": "Returns a single object of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_NotIncludingNotListable"
}
},
{
"in": "path",
"name": "objectId",
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "An entity object",
"content": {
"application/json": {
"schema": {
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/Product"
},
{
"$ref": "#/components/schemas/Chore"
},
{
"$ref": "#/components/schemas/Battery"
},
{
"$ref": "#/components/schemas/Location"
},
{
"$ref": "#/components/schemas/QuantityUnit"
},
{
"$ref": "#/components/schemas/ShoppingListItem"
},
{
"$ref": "#/components/schemas/StockEntry"
},
{
"$ref": "#/components/schemas/ProductBarcode"
}
]
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
},
"404": {
"description": "Object not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"put": {
"summary": "Edits the given object of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_NotIncludingNotEditable"
}
},
{
"in": "path",
"name": "objectId",
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "A valid entity object of the entity specified in parameter *entity*",
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Product"
},
{
"$ref": "#/components/schemas/Chore"
},
{
"$ref": "#/components/schemas/Battery"
},
{
"$ref": "#/components/schemas/Location"
},
{
"$ref": "#/components/schemas/QuantityUnit"
},
{
"$ref": "#/components/schemas/ShoppingListItem"
},
{
"$ref": "#/components/schemas/StockEntry"
},
{
"$ref": "#/components/schemas/ProductBarcode"
}
]
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"delete": {
"summary": "Deletes a single object of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_NotIncludingNotDeletable"
}
},
{
"in": "path",
"name": "objectId",
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/userfields/{entity}/{objectId}": {
"get": {
"summary": "Returns all userfields with their values of the given object of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_IncludingUserEntities"
}
},
{
"in": "path",
"name": "objectId",
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Key/value pairs of userfields",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Key/value pairs of userfields"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"put": {
"summary": "Edits the given userfields of the given object of the given entity",
"tags": [
"Generic entity interactions"
],
"parameters": [
{
"in": "path",
"name": "entity",
"required": true,
"description": "A valid entity name",
"schema": {
"$ref": "#/components/internalSchemas/ExposedEntity_IncludingUserEntities_NotIncludingNotEditable"
}
},
{
"in": "path",
"name": "objectId",
"required": true,
"description": "A valid object id of the given entity",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "A valid entity object of the entity specified in parameter *entity*",
"required": true,
"content": {
"application/json": {
"schema": {
"description": "Key/value pairs of userfields"
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/files/{group}/{fileName}": {
"get": {
"summary": "Serves the given file",
"description": "With proper Content-Type header",
"tags": [
"Files"
],
"parameters": [
{
"in": "path",
"name": "group",
"required": true,
"description": "The file group",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "fileName",
"required": true,
"description": "The file name (including extension)<br>**BASE64 encoded**",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "force_serve_as",
"required": false,
"description": "Force the file to be served as the given type",
"schema": {
"type": "string",
"enum": [
"picture"
]
}
},
{
"in": "query",
"name": "best_fit_height",
"required": false,
"description": "Only when using `force_serve_as` = `picture`: Downscale the picture to the given height while maintaining the aspect ratio",
"schema": {
"type": "integer"
}
},
{
"in": "query",
"name": "best_fit_width",
"required": false,
"description": "Only when using `force_serve_as` = `picture`: Downscale the picture to the given width while maintaining the aspect ratio",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "The binary file contents (Content-Type header is automatically set based on the file type)",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"put": {
"summary": "Uploads a single file",
"description": "The file will be stored at /data/storage/{group}/{file_name} (you need to remember the group and file name to get or delete it again)",
"tags": [
"Files"
],
"parameters": [
{
"in": "path",
"name": "group",
"required": true,
"description": "The file group",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "fileName",
"required": true,
"description": "The file name (including extension)<br>**BASE64 encoded**",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"delete": {
"summary": "Deletes the given file",
"tags": [
"Files"
],
"parameters": [
{
"in": "path",
"name": "group",
"required": true,
"description": "The file group",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "fileName",
"required": true,
"description": "The file name (including extension)<br>**BASE64 encoded**",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/users": {
"get": {
"summary": "Returns all users",
"tags": [
"User management"
],
"parameters": [
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "A list of user objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserDto"
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
},
"post": {
"summary": "Creates a new user",
"tags": [
"User management"
],
"requestBody": {
"description": "A valid user object",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/users/{userId}": {
"put": {
"summary": "Edits the given user",
"tags": [
"User management"
],
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"description": "A valid user id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "A valid user object",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"delete": {
"summary": "Deletes the given user",
"tags": [
"User management"
],
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"description": "A valid user id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/users/{userId}/permissions": {
"get": {
"summary": "Returns the assigned permissions of the given user",
"tags": [
"User management"
],
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"description": "A valid user id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "A list of user permission objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"permission_id": {
"type": "integer"
},
"user_id": {
"type": "integer"
}
}
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"post": {
"summary": "Adds a permission to the given user",
"tags": [
"User management"
],
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"description": "A valid user id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"permissions_id": {
"type": "integer",
"description": "A permission ids"
}
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"put": {
"summary": "Replaces the assigned permissions of the given user",
"tags": [
"User management"
],
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"description": "A valid user id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"permissions": {
"type": "array",
"items": {
"type": "integer"
},
"description": "A list of permission ids"
}
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/user": {
"get": {
"summary": "Returns the currently authenticated user",
"tags": [
"Current user"
],
"responses": {
"200": {
"description": "A user object",
"content": {
"application/json": {
"schema": {
"type": "object",
"items": {
"$ref": "#/components/schemas/UserDto"
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/user/settings": {
"get": {
"summary": "Returns all settings of the currently logged in user",
"tags": [
"Current user"
],
"responses": {
"200": {
"description": "Key/value pairs of user settings",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Key/value pairs of user settings"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/user/settings/{settingKey}": {
"get": {
"summary": "Returns the given setting of the currently logged in user",
"tags": [
"Current user"
],
"parameters": [
{
"in": "path",
"name": "settingKey",
"required": true,
"description": "The key of the user setting",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A UserSetting object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSetting"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"put": {
"summary": "Sets the given setting of the currently logged in user",
"tags": [
"Current user"
],
"requestBody": {
"description": "A valid UserSetting object",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSetting"
}
}
}
},
"parameters": [
{
"in": "path",
"name": "settingKey",
"required": true,
"description": "The key of the user setting",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"delete": {
"summary": "Deletes the given setting of the currently logged in user",
"tags": [
"Current user"
],
"parameters": [
{
"in": "path",
"name": "settingKey",
"required": true,
"description": "The key of the user setting",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock": {
"get": {
"summary": "Returns all products which are currently in stock incl. the next due date per product",
"tags": [
"Stock"
],
"responses": {
"200": {
"description": "An array of CurrentStockResponse objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentStockResponse"
}
}
}
}
}
}
}
},
"/stock/entry/{entryId}": {
"get": {
"summary": "Returns details of the given stock",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "entryId",
"required": true,
"description": "A valid stock entry id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "A StockEntry Response object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StockEntry"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
},
"put": {
"summary": "Edits the stock entry",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "entryId",
"required": true,
"description": "A valid stock entry id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"format": "number",
"description": "The amount to add - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"best_before_date": {
"type": "string",
"format": "date",
"description": "The due date of the product to add, when omitted, the current date is used"
},
"price": {
"type": "number",
"format": "number",
"description": "The price per stock quantity unit in configured currency"
},
"open": {
"type": "boolean",
"description": "If the stock entry was already opened or not"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, the default location of the product is used"
},
"shopping_location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, no store will be affected"
},
"purchased_date": {
"type": "string",
"format": "date",
"description": "The date when this stock entry was purchased"
}
},
"example": {
"id": "2",
"amount": "1",
"best_before_date": "2021-07-19",
"purchased_date": "2020-01-01",
"price": "22.03",
"open": false,
"location_id": "4"
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, invalid transaction type)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/entry/{entryId}/printlabel": {
"get": {
"summary": "Prints the label of the given stock entry",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "entryId",
"required": true,
"description": "A valid stock entry id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "WebHook data"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing stock entry, error on WebHook execution)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/volatile": {
"get": {
"summary": "Returns all products which are due soon, overdue, expired or currently missing",
"tags": [
"Stock"
],
"parameters": [
{
"in": "query",
"name": "due_soon_days",
"required": false,
"description": "The number of days in which products are considered to be due soon",
"schema": {
"type": "integer",
"default": 5
}
}
],
"responses": {
"200": {
"description": "A CurrentVolatilStockResponse object",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentVolatilStockResponse"
}
}
}
}
}
}
}
},
"/stock/products/{productId}": {
"get": {
"summary": "Returns details of the given product",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "A ProductDetailsResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProductDetailsResponse"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/locations": {
"get": {
"summary": "Returns all locations where the given product currently has stock",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
},
{
"in": "query",
"name": "include_sub_products",
"required": false,
"description": "If sub product locations should be included (if the given product is a parent product and in addition to the ones of the given product)",
"schema": {
"type": "boolean"
}
},
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An array of StockLocation objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLocation"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
}
},
"/stock/products/{productId}/entries": {
"get": {
"summary": "Returns all stock entries of the given product in order of next use (Opened first, then first due first, then first in first out)",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
},
{
"in": "query",
"name": "include_sub_products",
"required": false,
"description": "If sub products should be included (if the given product is a parent product and in addition to the ones of the given product)",
"schema": {
"type": "boolean"
}
},
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An array of StockEntry objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
}
},
"/stock/products/{productId}/price-history": {
"get": {
"summary": "Returns the price history of the given product",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "An array of ProductPriceHistory objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProductPriceHistory"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/add": {
"post": {
"summary": "Adds the given amount of the given product to stock",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"format": "number",
"description": "The amount to add - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"best_before_date": {
"type": "string",
"format": "date",
"description": "The due date of the product to add, when omitted, the current date is used"
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
},
"price": {
"type": "number",
"format": "number",
"description": "The price per stock quantity unit in configured currency"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, the default location of the product is used"
},
"shopping_location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, no store will be affected"
},
"print_stock_label": {
"type": "boolean",
"description": "True when the stock entry label should be printed"
}
},
"example": {
"amount": 1,
"best_before_date": "2019-01-19",
"transaction_type": "purchase",
"price": "1.99"
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, invalid transaction type)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/consume": {
"post": {
"summary": "Removes the given amount of the given product from stock",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "The amount to remove - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
},
"spoiled": {
"type": "boolean",
"description": "True when the given product was spoiled, defaults to false"
},
"stock_entry_id": {
"type": "string",
"description": "A specific stock entry id to consume, if used, the amount has to be 1"
},
"recipe_id": {
"type": "number",
"format": "integer",
"description": "A valid recipe id for which this product was used (for statistical purposes only)"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "A valid location id (if supplied, only stock at the given location is considered, if ommitted, stock of any location is considered)"
},
"exact_amount": {
"type": "boolean",
"description": "For tare weight handling enabled products, `true` when the given is the absolute amount to be consumed, not the amount including the container weight"
},
"allow_subproduct_substitution": {
"type": "boolean",
"description": "`True` when any in-stock sub product should be used when the given product is a parent product and currently not in-stock"
}
},
"example": {
"amount": 1,
"transaction_type": "consume",
"spoiled": false
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, invalid transaction type, given amount > current stock amount)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/transfer": {
"post": {
"summary": "Transfers the given amount of the given product from one location to another (this is currently not supported for tare weight handling enabled products)",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "The amount to transfer - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"location_id_from": {
"type": "number",
"format": "integer",
"description": "A valid location id, the location from where the product should be transfered"
},
"location_id_to": {
"type": "number",
"format": "integer",
"description": "A valid location id, the location to where the product should be transfered"
},
"stock_entry_id": {
"type": "string",
"description": "A specific stock entry id to transfer, if used, the amount has to be 1"
}
},
"example": {
"amount": 1,
"location_id_from": 1,
"location_id_to": 2
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, no existing from or to location, given amount > current stock amount at the source location)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/inventory": {
"post": {
"summary": "Inventories the given product (adds/removes based on the given new amount)",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"new_amount": {
"type": "integer",
"description": "The new current amount for the given product - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"best_before_date": {
"type": "string",
"format": "date",
"description": "The due date which applies to added products"
},
"shopping_location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, no store will be affected"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, the default location of the product is used (only applies to added products)"
},
"price": {
"type": "number",
"format": "number",
"description": "If omitted, the last price of the product is used (only applies to added products)"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/open": {
"post": {
"summary": "Marks the given amount of the given product as opened",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "The amount to mark as opened"
},
"stock_entry_id": {
"type": "string",
"description": "A specific stock entry id to open, if used, the amount has to be 1"
},
"allow_subproduct_substitution": {
"type": "boolean",
"description": "`True` when any in-stock sub product should be used when the given product is a parent product and currently not in-stock"
}
},
"example": {
"amount": 1
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, given amount > current unopened stock amount)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productId}/printlabel": {
"get": {
"summary": "Prints the product label of the given product",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productId",
"required": true,
"description": "A valid product id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "WebHook data"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, error on WebHook execution)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/{productIdToKeep}/merge/{productIdToRemove}": {
"post": {
"summary": "Merges two products into one",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "productIdToKeep",
"required": true,
"description": "A valid product id of the product to keep",
"schema": {
"type": "integer"
}
},
{
"in": "path",
"name": "productIdToRemove",
"required": true,
"description": "A valid product id of the product to remove",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Invalid product id)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/by-barcode/{barcode}": {
"get": {
"summary": "Returns details of the given product by its barcode",
"tags": [
"Stock \"by-barcode\""
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "Barcode",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A ProductDetailsResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProductDetailsResponse"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Unknown barcode)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/by-barcode/{barcode}/add": {
"post": {
"summary": "Adds the given amount of the by its barcode given product to stock",
"tags": [
"Stock \"by-barcode\""
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "Barcode",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"format": "number",
"description": "The amount to add - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"best_before_date": {
"type": "string",
"format": "date",
"description": "The due date of the product to add, when omitted, the current date is used"
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
},
"price": {
"type": "number",
"format": "number",
"description": "The price per stock quantity unit in configured currency"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, the default location of the product is used"
}
},
"example": {
"amount": 1,
"best_before_date": "2019-01-19",
"transaction_type": "purchase",
"price": "1.99"
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, invalid transaction type)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/by-barcode/{barcode}/consume": {
"post": {
"summary": "Removes the given amount of the by its barcode given product from stock",
"tags": [
"Stock \"by-barcode\""
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "Barcode",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "The amount to remove - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
},
"spoiled": {
"type": "boolean",
"description": "True when the given product was spoiled, defaults to false"
},
"stock_entry_id": {
"type": "string",
"description": "A specific stock entry id to consume, if used, the amount has to be 1"
},
"recipe_id": {
"type": "number",
"format": "integer",
"description": "A valid recipe id for which this product was used (for statistical purposes only)"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "A valid location id (if supplied, only stock at the given location is considered, if ommitted, stock of any location is considered)"
},
"exact_amount": {
"type": "boolean",
"description": "For tare weight handling enabled products, `true` when the given is the absolute amount to be consumed, not the amount including the container weight"
},
"allow_subproduct_substitution": {
"type": "boolean",
"description": "`True` when any in-stock sub product should be used when the given product is a parent product and currently not in-stock"
}
},
"example": {
"amount": 1,
"transaction_type": "consume",
"spoiled": false
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, invalid transaction type, given amount > current stock amount)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/by-barcode/{barcode}/transfer": {
"post": {
"summary": "Transfers the given amount of the by its barcode given product from one location to another (this is currently not supported for tare weight handling enabled products)",
"tags": [
"Stock \"by-barcode\""
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "Barcode",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "The amount to transfer - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"location_id_from": {
"type": "number",
"format": "integer",
"description": "A valid location id, the location from where the product should be transfered"
},
"location_id_to": {
"type": "number",
"format": "integer",
"description": "A valid location id, the location to where the product should be transfered"
},
"stock_entry_id": {
"type": "string",
"description": "A specific stock entry id to transfer, if used, the amount has to be 1"
}
},
"example": {
"amount": 1,
"location_id_from": 1,
"location_id_to": 2
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, no existing from or to location, given amount > current stock amount at the source location)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/by-barcode/{barcode}/inventory": {
"post": {
"summary": "Inventories the by its barcode given product (adds/removes based on the given new amount)",
"tags": [
"Stock \"by-barcode\""
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "Barcode",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"new_amount": {
"type": "integer",
"description": "The new current amount for the given product - please note that when tare weight handling for the product is enabled, this needs to be the amount including the container weight (gross), the amount to be posted will be automatically calculated based on what is in stock and the defined tare weight"
},
"best_before_date": {
"type": "string",
"format": "date",
"description": "The due date which applies to added products"
},
"location_id": {
"type": "number",
"format": "integer",
"description": "If omitted, the default location of the product is used (only applies to added products)"
},
"price": {
"type": "number",
"format": "number",
"description": "If omitted, the last price of the product is used (only applies to added products)"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/products/by-barcode/{barcode}/open": {
"post": {
"summary": "Marks the given amount of the by its barcode given product as opened",
"tags": [
"Stock \"by-barcode\""
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "Barcode",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "The amount to mark as opened"
},
"stock_entry_id": {
"type": "string",
"description": "A specific stock entry id to open, if used, the amount has to be 1"
},
"allow_subproduct_substitution": {
"type": "boolean",
"description": "`True` when any in-stock sub product should be used when the given product is a parent product and currently not in-stock"
}
},
"example": {
"amount": 1
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing product, given amount > current unopened stock amount)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/shoppinglist/add-missing-products": {
"post": {
"summary": "Adds currently missing products (below defined min. stock amount) to the given shopping list",
"tags": [
"Stock"
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"list_id": {
"type": "integer",
"description": "The shopping list to use, when omitted, the default shopping list (with id 1) is used"
}
},
"example": {
"list_id": 2
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing shopping list)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/shoppinglist/add-overdue-products": {
"post": {
"summary": "Adds overdue products to the given shopping list",
"tags": [
"Stock"
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"list_id": {
"type": "integer",
"description": "The shopping list to use, when omitted, the default shopping list (with id 1) is used"
}
},
"example": {
"list_id": 2
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing shopping list)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/shoppinglist/add-expired-products": {
"post": {
"summary": "Adds expired products to the given shopping list",
"tags": [
"Stock"
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"list_id": {
"type": "integer",
"description": "The shopping list to use, when omitted, the default shopping list (with id 1) is used"
}
},
"example": {
"list_id": 2
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing shopping list)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/shoppinglist/clear": {
"post": {
"summary": "Removes all items from the given shopping list",
"tags": [
"Stock"
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"list_id": {
"type": "integer",
"description": "The shopping list id to clear, when omitted, the default shopping list (with id 1) is used"
}
},
"example": {
"list_id": 2
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing shopping list)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/shoppinglist/add-product": {
"post": {
"summary": "Adds the given amount of the given product to the given shopping list",
"description": "If the product is already on the shopping list, the given amount will increase the amount of the already existing item, otherwise a new item will be added",
"tags": [
"Stock"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"product_id": {
"type": "integer",
"description": "A valid product id of the item on the shopping list"
},
"list_id": {
"type": "integer",
"description": "A valid shopping list id, when omitted, the default shopping list (with id 1) is used"
},
"product_amount": {
"type": "integer",
"description": "The amount of product units to add, when omitted, the default amount of 1 is used"
},
"note": {
"type": "string",
"description": "The note of the shopping list item"
}
},
"example": {
"product_id": 3,
"list_id": 2,
"product_amount": 5,
"note": "This is the note of the shopping list item..."
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing shopping list, Invalid product id supplied)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/shoppinglist/remove-product": {
"post": {
"summary": "Removes the given amount of the given product from the given shopping list, if it is on it",
"description": "If the resulting amount is <= 0, the item will be completely removed from the given list, otherwise the given amount will reduce the amount of the existing item",
"tags": [
"Stock"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"product_id": {
"type": "integer",
"description": "A valid product id of the item on the shopping list"
},
"list_id": {
"type": "integer",
"description": "A valid shopping list id, when omitted, the default shopping list (with id 1) is used"
},
"product_amount": {
"type": "integer",
"description": "The amount of product units to remove, when omitted, the default amount of 1 is used"
}
},
"example": {
"product_id": 3,
"list_id": 2,
"product_amount": 5
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing shopping list, Invalid product id supplied)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/bookings/{bookingId}": {
"get": {
"summary": "Returns the given stock booking",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "bookingId",
"required": true,
"description": "A valid stock booking id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "A StockLogEntry object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Invalid stock booking id)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/bookings/{bookingId}/undo": {
"post": {
"summary": "Undoes a booking",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "bookingId",
"required": true,
"description": "A valid stock booking id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing booking)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/transactions/{transactionId}": {
"get": {
"summary": "Returns all stock bookings of the given transaction id",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "transactionId",
"required": true,
"description": "A valid stock transaction id",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "An array of StockLogEntry objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockLogEntry"
}
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing transaction)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/transactions/{transactionId}/undo": {
"post": {
"summary": "Undoes a transaction",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "transactionId",
"required": true,
"description": "A valid stock transaction id",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing transaction)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/stock/barcodes/external-lookup/{barcode}": {
"get": {
"summary": "Executes an external barcode lookoup via the configured plugin with the given barcode",
"tags": [
"Stock"
],
"parameters": [
{
"in": "path",
"name": "barcode",
"required": true,
"description": "The barcode to lookup up",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "add",
"required": false,
"description": "When true, the product is added to the database on a successful lookup and the new product id is in included in the response",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"200": {
"description": "An ExternalBarcodeLookupResponse object or null, when nothing was found for the given barcode",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalBarcodeLookupResponse"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Plugin error)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/recipes/{recipeId}/add-not-fulfilled-products-to-shoppinglist": {
"post": {
"summary": "Adds all missing products for the given recipe to the shopping list",
"tags": [
"Recipes"
],
"parameters": [
{
"in": "path",
"name": "recipeId",
"required": true,
"description": "A valid recipe id",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"excludedProductIds": {
"type": "array",
"items": {
"type": "number",
"format": "integer"
},
"description": "An optional array of product ids to exclude them from being put on the shopping list"
}
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
}
}
}
},
"/recipes/{recipeId}/fulfillment": {
"get": {
"summary": "Get stock fulfillment information for the given recipe",
"tags": [
"Recipes"
],
"parameters": [
{
"in": "path",
"name": "recipeId",
"required": true,
"description": "A valid recipe id",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A RecipeFulfillmentResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecipeFulfillmentResponse"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/recipes/{recipeId}/consume": {
"post": {
"summary": "Consumes all products of the given recipe",
"tags": [
"Recipes"
],
"parameters": [
{
"in": "path",
"name": "recipeId",
"required": true,
"description": "A valid recipe id",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
}
}
}
},
"/recipes/fulfillment": {
"get": {
"summary": "Get stock fulfillment information for all recipe",
"tags": [
"Recipes"
],
"parameters": [
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An array of RecipeFulfillmentResponse objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RecipeFulfillmentResponse"
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
}
},
"/chores": {
"get": {
"summary": "Returns all chores incl. the next estimated execution time per chore",
"tags": [
"Chores"
],
"parameters": [
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An array of CurrentChoreResponse objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentChoreResponse"
}
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
}
},
"/chores/{choreId}": {
"get": {
"summary": "Returns details of the given chore",
"tags": [
"Chores"
],
"parameters": [
{
"in": "path",
"name": "choreId",
"required": true,
"description": "A valid chore id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "A ChoreDetailsResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChoreDetailsResponse"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing chore)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/chores/{choreId}/execute": {
"post": {
"summary": "Tracks an execution of the given chore",
"tags": [
"Chores"
],
"parameters": [
{
"in": "path",
"name": "choreId",
"required": true,
"description": "A valid chore id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"tracked_time": {
"type": "string",
"format": "date-time",
"description": "The time of when the chore was executed, when omitted, the current time is used"
},
"done_by": {
"type": "integer",
"description": "A valid user id of who executed this chore, when omitted, the currently authenticated user will be used"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChoreLogEntry"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing chore)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/chores/executions/{executionId}/undo": {
"post": {
"summary": "Undoes a chore execution",
"tags": [
"Chores"
],
"parameters": [
{
"in": "path",
"name": "executionId",
"required": true,
"description": "A valid chore execution id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing booking)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/chores/executions/calculate-next-assignments": {
"post": {
"summary": "(Re)calculates all next user assignments of all chores",
"tags": [
"Chores"
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chore_id": {
"type": "integer",
"description": "The chore id of the chore which next user assignment should be (re)calculated, when omitted, the next user assignments of all chores will (re)caluclated"
}
},
"example": {
"chore_id": 1
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/batteries": {
"get": {
"summary": "Returns all batteries incl. the next estimated charge time per battery",
"tags": [
"Batteries"
],
"parameters": [
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An array of CurrentBatteryResponse objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentBatteryResponse"
}
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
}
},
"/batteries/{batteryId}": {
"get": {
"summary": "Returns details of the given battery",
"tags": [
"Batteries"
],
"parameters": [
{
"in": "path",
"name": "batteryId",
"required": true,
"description": "A valid battery id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "A BatteryDetailsResponse object",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BatteryDetailsResponse"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing battery)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/batteries/{batteryId}/charge": {
"post": {
"summary": "Tracks a charge cycle of the given battery",
"tags": [
"Batteries"
],
"parameters": [
{
"in": "path",
"name": "batteryId",
"required": true,
"description": "A valid battery id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"tracked_time": {
"type": "string",
"format": "date-time",
"description": "The time of when the battery was charged, when omitted, the current time is used"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The operation was successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BatteryChargeCycleEntry"
}
}
}
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing battery)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/batteries/charge-cycles/{chargeCycleId}/undo": {
"post": {
"summary": "Undoes a battery charge cycle",
"tags": [
"Batteries"
],
"parameters": [
{
"in": "path",
"name": "chargeCycleId",
"required": true,
"description": "A valid charge cycle id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing booking)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/tasks": {
"get": {
"summary": "Returns all tasks which are not done yet",
"tags": [
"Tasks"
],
"parameters": [
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/order"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
],
"responses": {
"200": {
"description": "An array of Task objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Task"
}
}
}
}
},
"500": {
"description": "The operation was not successful (possible errors are invalid field names or conditions in filter parameters provided)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error500"
}
}
}
}
}
}
},
"/tasks/{taskId}/complete": {
"post": {
"summary": "Marks the given task as completed",
"tags": [
"Tasks"
],
"parameters": [
{
"in": "path",
"name": "taskId",
"required": true,
"description": "A valid task id",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"done_time": {
"type": "string",
"format": "date-time",
"description": "The time of when the task was completed, when omitted, the current time is used"
}
}
}
}
}
},
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing task)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/tasks/{taskId}/undo": {
"post": {
"summary": "Marks the given task as not completed",
"tags": [
"Tasks"
],
"parameters": [
{
"in": "path",
"name": "taskId",
"required": true,
"description": "A valid task id",
"schema": {
"type": "integer"
}
}
],
"responses": {
"204": {
"description": "The operation was successful"
},
"400": {
"description": "The operation was not successful (possible errors are: Not existing task)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/calendar/ical": {
"get": {
"summary": "Returns the calendar in iCal format",
"tags": [
"Calendar"
],
"responses": {
"200": {
"description": "The iCal file contents",
"content": {
"text/calendar": {
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
},
"/calendar/ical/sharing-link": {
"get": {
"summary": "Returns a (public) sharing link for the calendar in iCal format",
"tags": [
"Calendar"
],
"responses": {
"200": {
"description": "The (public) sharing link for the calendar in iCal format",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/print/shoppinglist/thermal": {
"get": {
"summary": "Prints the shoppinglist with a thermal printer",
"tags": [
"Print"
],
"parameters": [
{
"in": "query",
"name": "list",
"required": false,
"description": "Shopping list id",
"schema": {
"type": "integer",
"default": 1
}
},
{
"in": "query",
"name": "printHeader",
"required": false,
"description": "Prints grocy logo if true",
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Returns OK if the printing was successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "The operation was not successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error400"
}
}
}
}
}
}
}
},
"components": {
"internalSchemas": {
"ExposedEntity": {
"type": "string",
"enum": [
"products",
"chores",
"product_barcodes",
"batteries",
"locations",
"quantity_units",
"quantity_unit_conversions",
"shopping_list",
"shopping_lists",
"shopping_locations",
"recipes",
"recipes_pos",
"recipes_nestings",
"tasks",
"task_categories",
"product_groups",
"equipment",
"api_keys",
"userfields",
"userentities",
"userobjects",
"meal_plan",
"stock_log",
"stock",
"stock_current_locations",
"api_keys"
]
},
"ExposedEntityNoListing": {
"type": "string",
"enum": [
"api_keys"
]
},
"ExposedEntityNoEdit": {
"type": "string",
"enum": [
"stock_log",
"api_keys",
"stock",
"stock_current_locations"
]
},
"ExposedEntityNoDelete": {
"type": "string",
"enum": [
"stock_log",
"stock",
"stock_current_locations"
]
},
"ExposedEntityEditRequiresAdmin": {
"type": "string",
"enum": [
"api_keys"
]
},
"StockTransactionType": {
"type": "string",
"enum": [
"purchase",
"consume",
"inventory-correction",
"product-opened"
]
},
"StringEnumTemplate": {
"type": "string",
"enum": []
}
},
"schemas": {
"Product": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"location_id": {
"type": "integer"
},
"qu_id_purchase": {
"type": "integer"
},
"qu_id_stock": {
"type": "integer"
},
"enable_tare_weight_handling": {
"type": "integer"
},
"not_check_stock_fulfillment_for_recipes": {
"type": "integer"
},
"product_group_id": {
"type": "integer"
},
"qu_factor_purchase_to_stock": {
"type": "number",
"format": "number"
},
"tare_weight": {
"type": "number",
"format": "number"
},
"barcode": {
"type": "string",
"description": "Can contain multiple barcodes separated by comma"
},
"min_stock_amount": {
"type": "integer",
"minimum": 0,
"default": 0
},
"default_best_before_days": {
"type": "integer",
"minimum": 0,
"default": 0
},
"default_best_before_days_after_open": {
"type": "integer",
"minimum": 0,
"default": 0
},
"picture_file_name": {
"type": "string"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"shopping_location_id": {
"type": "integer"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
},
"example": {
"id": "1",
"name": "Cookies",
"description": null,
"location_id": "4",
"qu_id_purchase": "3",
"qu_id_stock": "3",
"qu_factor_purchase_to_stock": "1.0",
"barcode": "cok1",
"min_stock_amount": "8",
"default_best_before_days": "0",
"row_created_timestamp": "2019-05-02 20:12:26",
"product_group_id": "1",
"picture_file_name": "cookies.jpg",
"default_best_before_days_after_open": "0",
"enable_tare_weight_handling": "0",
"tare_weight": "0.0",
"not_check_stock_fulfillment_for_recipes": "0",
"shopping_location_id": null,
"userfields": null
}
},
"QuantityUnit": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"name_plural": {
"type": "string"
},
"description": {
"type": "string"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"plural_forms": {
"type": "string"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
},
"example": {
"id": "2",
"name": "Piece",
"description": null,
"row_created_timestamp": "2019-05-02 20:12:25",
"name_plural": "Pieces",
"plural_forms": null,
"userfields": null
}
},
"Location": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
},
"example": {
"id": "2",
"name": "0",
"description": null,
"row_created_timestamp": "2019-05-02 20:12:25",
"userfields": null
}
},
"ShoppingLocation": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
},
"example": {
"id": "2",
"name": "0",
"description": null,
"row_created_timestamp": "2019-05-02 20:12:25",
"userfields": null
}
},
"StockLocation": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"product_id": {
"type": "integer"
},
"amount": {
"type": "integer"
},
"location_id": {
"type": "integer"
},
"location_name": {
"type": "string"
},
"location_is_freezer": {
"type": "integer"
}
},
"example": {
"id": "1",
"product_id": "3",
"amount": "2",
"location_id": "1",
"name": "Fridge"
}
},
"StockEntry": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"product_id": {
"type": "integer"
},
"location_id": {
"type": "integer"
},
"shopping_location_id": {
"type": "integer"
},
"amount": {
"type": "number"
},
"best_before_date": {
"type": "string",
"format": "date"
},
"purchased_date": {
"type": "string",
"format": "date"
},
"stock_id": {
"type": "string",
"description": "A unique id which references this stock entry during its lifetime"
},
"price": {
"type": "number"
},
"open": {
"type": "integer"
},
"opened_date": {
"type": "string",
"format": "date"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
},
"example": {
"id": "77",
"product_id": "1",
"amount": "2",
"best_before_date": "2019-07-07",
"purchased_date": "2019-05-03",
"stock_id": "5ccc6b2421979",
"price": null,
"open": "0",
"opened_date": null,
"row_created_timestamp": "2019-05-03 18:24:04",
"location_id": "4",
"shopping_location_id": null
}
},
"RecipeFulfillmentResponse": {
"type": "object",
"properties": {
"recipe_id": {
"type": "integer"
},
"need_fulfilled": {
"type": "boolean"
},
"need_fulfilled_with_shopping_list": {
"type": "boolean"
},
"missing_products_count": {
"type": "integer"
},
"costs": {
"type": "number",
"format": "number"
}
},
"example": {
"recipe_id": "1",
"need_fulfilled": "0",
"need_fulfilled_with_shopping_list": "0",
"missing_products_count": "2",
"costs": "17.74"
}
},
"ProductDetailsResponse": {
"type": "object",
"properties": {
"product": {
"$ref": "#/components/schemas/Product"
},
"product_barcodes": {
"$ref": "#/components/schemas/ProductBarcode"
},
"default_quantity_unit_purchase": {
"$ref": "#/components/schemas/QuantityUnit"
},
"quantity_unit_stock": {
"$ref": "#/components/schemas/QuantityUnit"
},
"last_purchased": {
"type": "string",
"format": "date"
},
"last_used": {
"type": "string",
"format": "date-time"
},
"stock_amount": {
"type": "integer"
},
"stock_amount_opened": {
"type": "integer"
},
"next_due_date": {
"type": "string",
"format": "date-time"
},
"last_price": {
"type": "number",
"format": "number"
},
"avg_price": {
"type": "number",
"format": "number"
},
"oldest_price": {
"type": "number",
"format": "number"
},
"last_shopping_location_id": {
"type": "integer"
},
"location": {
"$ref": "#/components/schemas/Location"
},
"average_shelf_life_days": {
"type": "number",
"format": "integer"
},
"spoil_rate_percent": {
"type": "number",
"format": "number"
}
},
"example": {
"product": {
"id": "1",
"name": "Cookies",
"description": null,
"location_id": "4",
"qu_id_purchase": "3",
"qu_id_stock": "3",
"qu_factor_purchase_to_stock": "1.0",
"barcode": "cok1",
"min_stock_amount": "8",
"default_best_before_days": "0",
"row_created_timestamp": "2019-05-02 20:12:26",
"product_group_id": "1",
"picture_file_name": "cookies.jpg",
"default_best_before_days_after_open": "0",
"enable_tare_weight_handling": "0",
"tare_weight": "0.0",
"not_check_stock_fulfillment_for_recipes": "0",
"last_shopping_location_id": null
},
"product_barcodes": [
{
"id": "1",
"product_id": "13",
"barcode": "01321230213",
"qu_id": "1",
"shopping_location_id": "2",
"amount": "10"
}
],
"last_purchased": null,
"last_used": null,
"stock_amount": "2",
"stock_amount_opened": null,
"default_quantity_unit_purchase": {
"id": "3",
"name": "Pack",
"description": null,
"row_created_timestamp": "2019-05-02 20:12:25",
"name_plural": "Packs",
"plural_forms": null
},
"quantity_unit_stock": {
"id": "3",
"name": "Pack",
"description": null,
"row_created_timestamp": "2019-05-02 20:12:25",
"name_plural": "Packs",
"plural_forms": null
},
"last_price": null,
"avg_price": null,
"oldest_price": null,
"last_shopping_location_id": null,
"next_due_date": "2019-07-07",
"location": {
"id": "4",
"name": "Candy cupboard",
"description": null,
"row_created_timestamp": "2019-05-02 20:12:25"
},
"average_shelf_life_days": -1,
"spoil_rate_percent": 0
}
},
"ProductPriceHistory": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date-time"
},
"price": {
"type": "number",
"format": "float"
},
"shopping_location": {
"$ref": "#/components/schemas/ShoppingLocation"
}
}
},
"ProductBarcode": {
"type": "object",
"properties": {
"product_id": {
"type": "integer"
},
"barcode": {
"type": "string"
},
"qu_id": {
"type": "integer"
},
"shopping_location_id": {
"type": "integer"
},
"amount": {
"type": "number",
"format": "number"
},
"last_price": {
"type": "number",
"format": "float"
},
"note": {
"type": "string"
}
}
},
"ExternalBarcodeLookupResponse": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"location_id": {
"type": "integer"
},
"qu_id_purchase": {
"type": "integer"
},
"qu_id_stock": {
"type": "integer"
},
"qu_factor_purchase_to_stock": {
"type": "number",
"format": "number"
},
"barcode": {
"type": "string",
"description": "Can contain multiple barcodes separated by comma"
},
"id": {
"type": "integer",
"description": "The id of the added product, only included when the producted was added to the database"
}
}
},
"ChoreDetailsResponse": {
"type": "object",
"properties": {
"chore": {
"$ref": "#/components/schemas/Chore"
},
"last_tracked": {
"type": "string",
"format": "date-time",
"description": "When this chore was last tracked"
},
"track_count": {
"type": "integer",
"description": "How often this chore was tracked so far"
},
"last_done_by": {
"$ref": "#/components/schemas/UserDto"
},
"next_estimated_execution_time": {
"type": "string",
"format": "date-time"
},
"next_execution_assigned_user": {
"$ref": "#/components/schemas/UserDto"
}
},
"example": {
"chore": {
"id": 0,
"name": "string",
"description": "string",
"period_type": "manually",
"period_days": 0,
"row_created_timestamp": "2019-05-04T11:31:04.563Z"
},
"last_tracked": "2019-05-04T11:31:04.563Z",
"track_count": 0,
"last_done_by": {
"id": 0,
"username": "string",
"first_name": "string",
"last_name": "string",
"display_name": "string",
"row_created_timestamp": "2019-05-04T11:31:04.564Z"
},
"next_estimated_execution_time": "2019-05-04T11:31:04.564Z"
}
},
"BatteryDetailsResponse": {
"type": "object",
"properties": {
"chore": {
"$ref": "#/components/schemas/Battery"
},
"last_charged": {
"type": "string",
"format": "date-time",
"description": "When this battery was last charged"
},
"charge_cycles_count": {
"type": "integer",
"description": "How often this battery was charged so far"
},
"next_estimated_charge_time": {
"type": "string",
"format": "date-time"
}
},
"example": {
"battery": {
"id": "1",
"name": "Battery1",
"description": "Warranty ends 2023",
"used_in": "TV remote control",
"charge_interval_days": "0",
"row_created_timestamp": "2019-05-02 20:12:26"
},
"last_charged": "2019-03-13 18:12:28",
"charge_cycles_count": 4,
"next_estimated_charge_time": "2999-12-31 23:59:59"
}
},
"Session": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"session_key": {
"type": "string"
},
"expires": {
"type": "string",
"format": "date-time"
},
"last_used": {
"type": "string",
"format": "date-time"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"password": {
"type": "string"
},
"picture_file_name": {
"type": "string"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"UserDto": {
"type": "object",
"description": "A user object without the *password* and with an additional *display_name* property",
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"picture_file_name": {
"type": "string"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"ApiKey": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"api_key": {
"type": "string"
},
"expires": {
"type": "string",
"format": "date-time"
},
"last_used": {
"type": "string",
"format": "date-time"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"ShoppingListItem": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"shopping_list_id": {
"type": "integer"
},
"product_id": {
"type": "integer"
},
"note": {
"type": "string"
},
"amount": {
"type": "number",
"minimum": 0,
"default": 0,
"description": "The manual entered amount"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
}
},
"Battery": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"used_in": {
"type": "string"
},
"charge_interval_days": {
"type": "integer",
"minimum": 0,
"default": 0
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
}
},
"BatteryChargeCycleEntry": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"battery_id": {
"type": "integer"
},
"tracked_time": {
"type": "string",
"format": "date-time"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"Chore": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"period_type": {
"type": "string",
"enum": [
"manually",
"dynamic-regular",
"daily",
"weekly",
"monthly"
]
},
"period_config": {
"type": "string"
},
"period_days": {
"type": "integer"
},
"track_date_only": {
"type": "boolean"
},
"rollover": {
"type": "boolean"
},
"assignment_type": {
"type": "string",
"enum": [
"no-assignment",
"who-least-did-first",
"random",
"in-alphabetical-order"
]
},
"assignment_config": {
"type": "string"
},
"next_execution_assigned_to_user_id": {
"type": "integer"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
}
},
"ChoreLogEntry": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"chore_id": {
"type": "integer"
},
"tracked_time": {
"type": "string",
"format": "date-time"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"StockLogEntry": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"product_id": {
"type": "integer"
},
"amount": {
"type": "number"
},
"best_before_date": {
"type": "string",
"format": "date"
},
"purchased_date": {
"type": "string",
"format": "date-time"
},
"used_date": {
"type": "string",
"format": "date-time"
},
"spoiled": {
"type": "boolean",
"default": false
},
"stock_id": {
"type": "string"
},
"transaction_id": {
"type": "string"
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"StockJournal": {
"type": "object",
"properties": {
"correlation_id": {
"type": "string"
},
"undone": {
"type": "integer"
},
"undone_timestamp": {
"type": "string",
"format": "date-time"
},
"amount": {
"type": "number",
"format": "float"
},
"location_id": {
"type": "integer"
},
"location_name": {
"type": "string"
},
"product_name": {
"type": "string"
},
"qu_name": {
"type": "string"
},
"qu_name_plural": {
"type": "string"
},
"user_display_name": {
"type": "string"
},
"spoiled": {
"type": "boolean",
"default": false
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
}
},
"example": {
"id": "1",
"correlation_id": null,
"undone": "0",
"undone_timestamp": null,
"transaction_type": "purchase",
"spoiled": "0",
"amount": "1",
"location_id": "4",
"location_name": "Candy cupboard",
"product_name": "Gummy bears",
"qu_name": "Pack",
"qu_name_plural": "Packs",
"user_display_name": "Demo User",
"row_created_timestamp": "2020-11-14 16:42:21"
}
},
"StockJournalSummary": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"format": "float"
},
"user_id": {
"type": "integer"
},
"product_name": {
"type": "string"
},
"product_id": {
"type": "integer"
},
"qu_name": {
"type": "string"
},
"qu_name_plural": {
"type": "string"
},
"user_display_name": {
"type": "string"
},
"transaction_type": {
"$ref": "#/components/internalSchemas/StockTransactionType"
}
},
"example": {
"id": "1",
"user_id": "1",
"user_display_name": "Demo User",
"product_name": "Chocolate",
"product_id": "2",
"transaction_type": "purchase",
"qu_name": "Pack",
"qu_name_plural": "Packs",
"amount": "1"
}
},
"Error400": {
"type": "object",
"properties": {
"error_message": {
"type": "string"
}
},
"example": {
"error_message": "The error message..."
}
},
"Error500": {
"type": "object",
"properties": {
"error_message": {
"type": "string"
},
"error_details": {
"type": "object",
"properties": {
"stack_trace": {
"type": "string"
},
"file": {
"type": "string"
},
"line": {
"type": "integer"
}
}
}
},
"example": {
"error_message": "The error message..."
}
},
"CurrentStockResponse": {
"type": "object",
"properties": {
"product_id": {
"type": "integer"
},
"amount": {
"type": "number"
},
"amount_aggregated": {
"type": "number"
},
"amount_opened": {
"type": "number"
},
"amount_opened_aggregated": {
"type": "number"
},
"best_before_date": {
"type": "string",
"format": "date",
"description": "The next due date for this product"
},
"is_aggregated_amount": {
"type": "boolean",
"description": "Indicates wheter this product has sub-products or not / if the fields `amount_aggregated` and `amount_opened_aggregated` are filled"
},
"product": {
"$ref": "#/components/schemas/Product"
}
}
},
"CurrentChoreResponse": {
"type": "object",
"properties": {
"chore_id": {
"type": "integer"
},
"last_tracked_time": {
"type": "string",
"format": "date-time"
},
"next_estimated_execution_time": {
"type": "string",
"format": "date-time",
"description": "The next estimated execution time of this chore, 2999-12-31 23:59:59 when the given chore has a period_type of manually"
}
}
},
"CurrentBatteryResponse": {
"type": "object",
"properties": {
"battery_id": {
"type": "integer"
},
"last_tracked_time": {
"type": "string",
"format": "date-time"
},
"next_estimated_charge_time": {
"type": "string",
"format": "date-time",
"description": "The next estimated charge time of this battery, 2999-12-31 23:59:59 when the given battery has no charge_interval_days defined"
}
}
},
"CurrentVolatilStockResponse": {
"type": "object",
"properties": {
"due_products": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentStockResponse"
}
},
"overdue_products": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentStockResponse"
}
},
"expired_products": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CurrentStockResponse"
}
},
"missing_products": {
"type": "array",
"items": {
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"amount_missing": {
"type": "number"
},
"is_partly_in_stock": {
"type": "integer"
}
}
}
}
}
},
"Task": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"due_date": {
"type": "string",
"format": "date-time"
},
"done": {
"type": "integer"
},
"done_timestamp": {
"type": "string",
"format": "date-time"
},
"category_id": {
"type": "integer"
},
"assigned_to_user_id": {
"type": "integer"
},
"row_created_timestamp": {
"type": "string",
"format": "date-time"
},
"userfields": {
"type": "object",
"description": "Key/value pairs of userfields"
}
}
},
"DbChangedTimeResponse": {
"type": "object",
"properties": {
"changed_time": {
"type": "string",
"format": "date-time"
}
}
},
"TimeResponse": {
"type": "object",
"properties": {
"timezone": {
"type": "string"
},
"time_local": {
"type": "string",
"format": "date-time"
},
"time_local_sqlite3": {
"type": "string",
"format": "date-time"
},
"time_utc": {
"type": "string",
"format": "date-time"
},
"timestamp": {
"type": "integer"
},
"offset": {
"type": "integer"
}
}
},
"UserSetting": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
},
"MissingLocalizationRequest": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
}
}
},
"securitySchemes": {
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "GROCY-API-KEY"
}
},
"parameters": {
"order": {
"in": "query",
"name": "order",
"required": false,
"description": "A valid field name by which the response should be ordered, use the separator `:` to specify the sort order (`asc` or `desc`, defaults to `asc` when omitted)",
"schema": {
"type": "string"
}
},
"limit": {
"in": "query",
"name": "limit",
"required": false,
"description": "The maximum number of objects to return",
"schema": {
"type": "integer"
}
},
"offset": {
"in": "query",
"name": "offset",
"required": false,
"description": "The number of objects to skip",
"schema": {
"type": "integer"
}
},
"offsettime": {
"in": "query",
"name": "offset",
"required": false,
"description": "Offset of timestamp in seconds. Can be positive or negative.",
"schema": {
"type": "integer"
}
},
"query": {
"in": "query",
"name": "query[]",
"required": false,
"description": "An array of filter conditions, each of them is a string in the form of `<field><condition><value>` where<br>`<field>` is a valid field name<br>`<condition>` is a comparison operator, one of<br>&nbsp;&nbsp;`=` equal<br>&nbsp;&nbsp;`!=` not equal<br>&nbsp;&nbsp;`~` LIKE<br>&nbsp;&nbsp;`!~` not LIKE<br>&nbsp;&nbsp;`<` less<br>&nbsp;&nbsp;`>` greater<br>&nbsp;&nbsp;`<=` less or equal<br>&nbsp;&nbsp;`>=` greater or equal<br>&nbsp;&nbsp;`§` regular expression<br>`<value>` is the value to search for",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"security": [
{
"ApiKeyAuth": []
}
]
}