List, retrieve, create, fill in and delete menus.
GET /listMenusPagedEx
GET /menu/ext/{idMenu}
POST /menu/no/groups
PUT /menu/{idMenu}/components
DELETE /menu/{idMenu}
Before you start
Base URL: https://app.tspoonlab.com/recipes/api
Headers
rememberme· required — Session token returned by the login.order· optional — Cost center id (Cost centers). Defaults to the user's active cost center.recipe· optional — Final-dish book id (Recipe centers), orallfor every book. Defaults to the user's active book.
Login — Returns the token as plain text.
curl https://app.tspoonlab.com/recipes/api/login \
-d [email protected] \
-d password=XXXXXXX
Dates — Returned as milliseconds since 1970 (epoch). When sending, milliseconds or ISO 8601 are accepted.
Responses may include fields other than the documented ones. Use only the documented fields.
List menus
GET /listMenusPagedEx
Query parameters
startinteger · required — Position of the first row, starting at 0.rowsinteger · required — Number of rows to return.weeklyboolean · required —trueincludes weekly menus.notWeeklyboolean · required —trueincludes non-weekly menus.filterstring · optional — Text to filter menus.
Example
curl "https://app.tspoonlab.com/recipes/api/listMenusPagedEx?start=0&rows=50&weekly=true¬Weekly=true" \
-H "rememberme: $TOKEN"
Response
[
{
"id": "3515834441676562996102020001",
"descr": "Lunch menu",
"altDescr": null,
"codi": "MM-01",
"date": null,
"dateGenerated": null,
"template": false,
"pax": 1
}
]
idstring — Menu id.descrstring — Name.altDescrstring — Alternative name.codistring — Code.datestring — Date formatted for display.dateGeneratednumber — Date (epoch milliseconds).templateboolean — Whether it is a template.paxnumber — Number of guests.
Retrieve a menu
Returns the menu with its sections and dishes.
GET /menu/ext/{idMenu}Path parameters
idMenustring · required — Menu id.
Example
curl https://app.tspoonlab.com/recipes/api/menu/ext/3515834441676562996102020001 \
-H "rememberme: $TOKEN"
Response
{
"id": "3515834441676562996102020001",
"descr": "Lunch menu",
"altDescr": null,
"codi": "MM-01",
"template": false,
"date": null,
"dateFormatted": null,
"pax": 1,
"costMin": 4.2,
"costMax": 6.8,
"costAvg": 5.5,
"listMenuGroup": [
{
"id": "3515834441676562996102020002",
"descr": "Starters",
"comment": null,
"typeMenuGroup": 1,
"numSelected": null,
"costMin": 1.9,
"costMax": 2.6,
"costAvg": 2.25,
"listMenuGroupComponent": [
{
"id": "3515834441676562996102020003",
"idComponent": "3515834441676562996102020004",
"descrComponent": "Seasonal salad",
"idUnit": "3515834441676562996102020005",
"descrUnit": "portion",
"comment": null,
"quantity": 1,
"cost": 1.9
}
]
}
]
}Same fields as the list, plus:
dateFormattedstring — Date formatted for display.costMin,costMax,costAvgnumber — Minimum, maximum and average cost.listMenuGrouparray — Sections.
Each section:
idstring — Section id.descrstring — Name.commentstring — Comment.typeMenuGroupinteger —0all are served ·1choose one ·2choosenumSelecteddifferent ones ·3like 2, repeats allowed.numSelectedinteger — Dishes to choose (types 2 and 3).costMin,costMax,costAvgnumber — Minimum, maximum and average cost.listMenuGroupComponentarray — Dishes.
Each dish:
idstring — Id within the section.idComponent,descrComponentstring — Dish.idUnit,descrUnitstring — Unit.commentstring — Comment.quantitynumber — Quantity for the menu's guests.costnumber — Cost.
Create a menu
Creates an empty menu. Returns its id.
POST /menu/no/groups
Body
descrstring · required — Name.altDescrstring · optional — Alternative name.commentstring · optional — Comment.codistring · optional — Code.datedate · optional — Date.templateboolean · optional — Whether it is a template. Defaults tofalse.paxnumber · optional — Number of guests. Defaults to 1.
Example
curl https://app.tspoonlab.com/recipes/api/menu/no/groups \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"descr": "Lunch menu", "codi": "MM-01", "pax": 1}'
Response
{ "id": "3515834441676562996102020001" }Add sections and dishes
Sets the menu's sections and their dishes. Existing sections that are not sent are deleted.
PUT /menu/{idMenu}/componentsPath parameters
idMenustring · required — Menu id.
Body
menuGroupsarray · required — Sections.
Each section:
descrstring · required — Name.listMenuGroupComponentarray · required — Dishes. Can be empty.commentstring · optional — Comment.typeMenuGroupinteger · optional — Section type (see Retrieve a menu). Defaults to 0.numSelectedinteger · optional — Dishes to choose (types 2 and 3).positioninteger · optional — Order. Defaults to 0.
Each dish:
idComponentstring · required — Dish id.idUnitstring · required — Unit id.quantitynumber · optional — Quantity for the menu's guests.commentstring · optional — Comment.positioninteger · optional — Order within the section. Defaults to 0.
Example
curl -X PUT https://app.tspoonlab.com/recipes/api/menu/3515834441676562996102020001/components \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"menuGroups": [
{
"descr": "Starters",
"typeMenuGroup": 1,
"position": 0,
"listMenuGroupComponent": [
{ "idComponent": "3515834441676562996102020004", "idUnit": "3515834441676562996102020005", "quantity": 1 }
]
}
]
}'
Response — No content.
Delete a menu
DELETE /menu/{idMenu}Path parameters
idMenustring · required — Menu id.
Example
curl -X DELETE https://app.tspoonlab.com/recipes/api/menu/3515834441676562996102020001 \
-H "rememberme: $TOKEN"
Response — No content.
Need help? Message us from the support chat in the bottom-right corner.
