Skip to main content

REST API: Menus

How to list, retrieve, and create menus

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), or all for 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

  • start integer · required — Position of the first row, starting at 0.

  • rows integer · required — Number of rows to return.

  • weekly boolean · required — true includes weekly menus.

  • notWeekly boolean · required — true includes non-weekly menus.

  • filter string · optional — Text to filter menus.

Example

curl "https://app.tspoonlab.com/recipes/api/listMenusPagedEx?start=0&rows=50&weekly=true&notWeekly=true" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020001",
"descr": "Lunch menu",
"altDescr": null,
"codi": "MM-01",
"date": null,
"dateGenerated": null,
"template": false,
"pax": 1
}
]
  • id string — Menu id.

  • descr string — Name.

  • altDescr string — Alternative name.

  • codi string — Code.

  • date string — Date formatted for display.

  • dateGenerated number — Date (epoch milliseconds).

  • template boolean — Whether it is a template.

  • pax number — Number of guests.


Retrieve a menu

Returns the menu with its sections and dishes.

GET /menu/ext/{idMenu}

Path parameters

  • idMenu string · 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:

  • dateFormatted string — Date formatted for display.

  • costMin, costMax, costAvg number — Minimum, maximum and average cost.

  • listMenuGroup array — Sections.

Each section:

  • id string — Section id.

  • descr string — Name.

  • comment string — Comment.

  • typeMenuGroup integer — 0 all are served · 1 choose one · 2 choose numSelected different ones · 3 like 2, repeats allowed.

  • numSelected integer — Dishes to choose (types 2 and 3).

  • costMin, costMax, costAvg number — Minimum, maximum and average cost.

  • listMenuGroupComponent array — Dishes.

Each dish:

  • id string — Id within the section.

  • idComponent, descrComponent string — Dish.

  • idUnit, descrUnit string — Unit.

  • comment string — Comment.

  • quantity number — Quantity for the menu's guests.

  • cost number — Cost.


Create a menu

Creates an empty menu. Returns its id.

POST /menu/no/groups

Body

  • descr string · required — Name.

  • altDescr string · optional — Alternative name.

  • comment string · optional — Comment.

  • codi string · optional — Code.

  • date date · optional — Date.

  • template boolean · optional — Whether it is a template. Defaults to false.

  • pax number · 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}/components

Path parameters

  • idMenu string · required — Menu id.

Body

  • menuGroups array · required — Sections.

Each section:

  • descr string · required — Name.

  • listMenuGroupComponent array · required — Dishes. Can be empty.

  • comment string · optional — Comment.

  • typeMenuGroup integer · optional — Section type (see Retrieve a menu). Defaults to 0.

  • numSelected integer · optional — Dishes to choose (types 2 and 3).

  • position integer · optional — Order. Defaults to 0.

Each dish:

  • idComponent string · required — Dish id.

  • idUnit string · required — Unit id.

  • quantity number · optional — Quantity for the menu's guests.

  • comment string · optional — Comment.

  • position integer · 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

  • idMenu string · 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.

Did this answer your question?