Skip to main content

REST API: Recipes and dishes

How to access intermediate (recipes) and final (dishes) elaborations and their details

List, retrieve, create and delete recipes and dishes, and retrieve or update their detail (the products and recipes they are made of).

GET    /listRecipesPaged
GET /listDishesPaged
GET /integration/recipe/{idRecipe}
GET /integration/dish/{idDish}
POST /recipe
POST /dish
DELETE /recipe/{idRecipe}
DELETE /dish/{idDish}
GET /component/{idComponent}/details
PUT /component/{idComponent}/details

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

Permissions — Listing and retrieving require permission to view recipes or dishes; creating and deleting, permission to add or delete recipes or dishes; updating the detail, permission to edit them. Costs are only returned with permission to view costs, and allergens with permission to view allergens.

Responses may include fields other than the documented ones. Use only the documented fields.


List recipes and dishes

/listRecipesPaged lists recipes and /listDishesPaged lists the dishes in the book given in the recipe header.

GET /listRecipesPaged
GET /listDishesPaged

Query parameters

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

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

  • filter string · optional — Text to search in the name, alternative name or code. With withTypes=true, also in category names.

  • types array · optional — Category ids; repeat the parameter for each one. Items must have all of them.

  • marked boolean · optional — true returns only marked items. Defaults to false.

  • hidden boolean · optional — true returns only hidden items; false, only visible ones. Defaults to false.

  • withTypes boolean · optional — true includes the categories. Defaults to false.

  • withDetail boolean · optional — true includes the detail. Defaults to false.

  • withQuantityUnits boolean · optional — true includes the first quantity and unit. Defaults to false.

  • withCost boolean · optional — true includes the cost. Defaults to false.

Example

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

Response

[
{
"id": "3515834441676562996102030001",
"descr": "Tomato sauce",
"altDescr": null,
"codi": "EI-014",
"hasData": true,
"tag": null,
"tagComment": null,
"listComponentTypes": null,
"listComponentDetail": null,
"idUnit": "3515834441676562996102030002",
"unit": "kg",
"quantity": 2.5,
"cost": 4.85
}
]
  • id string — Recipe or dish id.

  • descr string — Name.

  • altDescr string — Alternative name.

  • codi string — Code in the cost center.

  • hasData boolean — Whether it is used in another recipe or dish.

  • tag integer — Mark: 1 OK · 2 more info needed · 3 error. null if not marked.

  • tagComment string — Comment on the mark.

  • listComponentTypes array — Categories, each with id and descr. Only with withTypes.

  • listComponentDetail array — Detail, with the fields in Retrieve the detail of a recipe or dish. Only with withDetail.

  • idUnit, unit string — Unit of the first quantity. Only with withQuantityUnits.

  • quantity number — First quantity. Only with withQuantityUnits.

  • cost number — Cost of producing that quantity in the cost center. Only with withCost.


Retrieve a recipe or dish

Returns the recipe or dish with its quantities, detail, process and allergens. /integration/dish also returns its final-dish books.

GET /integration/recipe/{idRecipe}
GET /integration/dish/{idDish}

Path parameters

  • idRecipe / idDish string · required — Recipe or dish id.

Example

curl https://app.tspoonlab.com/recipes/api/integration/dish/3515834441676562996102030010 \
-H "rememberme: $TOKEN"

Response

{
"id": "3515834441676562996102030010",
"descr": "Macaroni gratin",
"altDescr": null,
"cost": 1.92,
"process": "Boil the pasta.\nMix with the sauce and grill.",
"listComponentService": [
{
"id": "3515834441676562996102030011",
"idUnit": "3515834441676562996102030012",
"quantity": 1,
"unit": "portion"
}
],
"listComponentDetail": [
{
"id": "3515834441676562996102030013",
"idComponent": "3515834441676562996102030001",
"codeComponent": "EI-014",
"descr": "Tomato sauce",
"altDescr": null,
"quantity": 0.08,
"quantityGross": null,
"idUnit": "3515834441676562996102030002",
"unit": "kg",
"use": null,
"comment": null,
"cost": 0.16,
"type": 1
}
],
"listAllergies": [
{
"id": "3515834441676562996102030014",
"descr": "Gluten",
"idAllergy": "3515834441676562996102030015",
"codi": "GLU",
"calculated": true,
"traces": false
}
],
"listRecipeCenters": [
{
"id": "3515834441676562996102030016",
"idAux": "3515834441676562996102030017",
"descr": "Menu"
}
]
}
  • id string — Recipe or dish id.

  • descr, altDescr string — Name and alternative name.

  • cost number — Cost of producing the first quantity in listComponentService in the cost center.

  • process string — Preparation process, one step per line (\n).

  • listComponentService array — Quantities the recipe or dish yields. If there are several, they are equivalent: the detail produces any one of them.

  • listComponentDetail array — Products and recipes it is made of.

  • listAllergies array — Allergens present.

  • listRecipeCenters array — Final-dish books. Only in /integration/dish.

Each quantity:

  • id string — Quantity id.

  • idUnit, unit string — Unit.

  • quantity number — Quantity.

Each detail line:

  • id string — Line id.

  • idComponent string — Product or recipe used.

  • codeComponent string — Its code.

  • descr, altDescr string — Its name and alternative name.

  • quantity number — Quantity used (net).

  • quantityGross number — Gross quantity when a cut or breakdown applies. Can be null.

  • idUnit, unit string — Line unit; it may differ from the product's unit. On a "sufficient quantity" line, quantity and idUnit are null.

  • use string — Cut or breakdown used.

  • comment string — Comment.

  • cost number — Line cost in the cost center.

  • type integer — 0 product · 1 recipe · 2 tool · 3 dish.

Each allergen:

  • id string — Id of the link to the recipe or dish.

  • descr string — Allergen name.

  • idAllergy, codi string — Allergen id and code.

  • calculated boolean — Whether it comes from the ingredients.

  • traces boolean — Whether it is a trace.

Each book:

  • id string — Id of the link to the book.

  • idAux string — Book id.

  • descr string — Book name.


Create a recipe or dish

Creates a recipe (/recipe) or a dish (/dish). Returns its id.

POST /recipe
POST /dish

Body

  • descr string · required — Name.

  • listComponentUnits array · required — Quantities the recipe or dish yields.

  • listComponentTypes array · required — Categories. Send [] if there are none.

  • altDescr string · optional — Alternative name.

  • codi string · optional — Code in the active cost center.

  • barcode string · optional — Barcode in the active cost center.

  • includeInOrder boolean · optional — true includes it in orders. Defaults to false.

  • averageCost boolean · optional — true: cost type average of last month's purchases.

  • fixedCost boolean · optional — true: fixed cost type.

  • fromVendor boolean · optional — true: supplier cost type. If none of the three is sent, last purchase cost.

  • minStock, maxStock number · optional — Minimum and maximum stock in the active cost center.

  • minProduction number · optional — Minimum production.

  • multProduction number · optional — Production multiple.

  • listStores array · optional — Stores in the active cost center, each with its id. Ignored without permission to edit stores.

  • origen string · optional — Where the recipe comes from.

  • caducity number · optional — Shelf life in days.

  • idPartida string · optional — Station id in the active cost center.

  • inLabel boolean · optional — Whether it is included on the label.

  • inPlanning boolean · optional — Whether it is included in planning.

  • typeConservation integer · optional — 0 fridge · 1 freezer · 2 dry · 3 hot.

  • storageTemperature number · optional — Storage temperature.

  • storageTemperatureAux number · optional — Second temperature, for type 3 (between).

  • typeTemperature integer · optional — 0 equal to · 1 less than · 2 greater than · 3 between.

  • iva number · optional — VAT percentage. Ignored without permission to edit orders.

  • listRecipeCenters array · optional — /dish only: final-dish books. Defaults to the book in the recipe header or, with recipe: all, every book of the user.

Each quantity:

  • quantity number · required — Quantity the recipe or dish yields.

  • idUnit string · required — Unit id.

  • position integer · optional — Order. Defaults to the list order.

Each category:

  • id string · required — Category id.

Each book:

  • idRecipeCenter string · required — Book id.

Example

curl https://app.tspoonlab.com/recipes/api/dish \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"descr": "Macaroni gratin",
"codi": "EF-032",
"listComponentUnits": [
{ "quantity": 1, "idUnit": "3515834441676562996102030012" }
],
"listComponentTypes": [],
"listRecipeCenters": [
{ "idRecipeCenter": "3515834441676562996102030017" }
]
}'

Response

{ "id": "3515834441676562996102030010" }

Delete a recipe or dish

Deletion is permanent.

DELETE /recipe/{idRecipe}
DELETE /dish/{idDish}

Path parameters

  • idRecipe / idDish string · required — Recipe or dish id.

Example

curl -X DELETE https://app.tspoonlab.com/recipes/api/dish/3515834441676562996102030010 \
-H "rememberme: $TOKEN"

Response — No content.


Retrieve the detail of a recipe or dish

Returns the products and recipes a recipe or dish is made of.

GET /component/{idComponent}/details

Path parameters

  • idComponent string · required — Recipe or dish id.

Example

curl https://app.tspoonlab.com/recipes/api/component/3515834441676562996102030010/details \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102030013",
"idComponent": "3515834441676562996102030001",
"codeComponent": "EI-014",
"descr": "Tomato sauce",
"altDescr": null,
"quantity": 0.08,
"quantityGross": null,
"idUnit": "3515834441676562996102030002",
"unit": "kg",
"idUse": null,
"use": null,
"comment": null,
"cost": 0.16,
"date": "Mon 10/12/2026 09:30",
"listAllergies": [
{
"id": "3515834441676562996102030020",
"descr": "Gluten",
"idAllergy": "3515834441676562996102030015",
"codi": "GLU",
"calculated": true,
"traces": false
}
]
}
]
  • id string — Line id.

  • idComponent string — Product or recipe used.

  • codeComponent string — Its code.

  • descr, altDescr string — Its name and alternative name.

  • quantity number — Quantity used (net).

  • quantityGross number — Gross quantity when a cut or breakdown applies. Can be null.

  • idUnit, unit string — Unit. On a "sufficient quantity" line, quantity and idUnit are null.

  • idUse, use string — Cut or breakdown.

  • comment string — Comment.

  • cost number — Line cost in the cost center.

  • date string — Cost date, formatted for display.

  • listAllergies array — Allergens of the product or recipe used, with the fields in Retrieve a recipe or dish.


Update the detail of a recipe or dish

Replaces the whole detail: existing lines not sent are deleted, lines with an id are updated and lines without one are created. Allergens and costs are then recalculated.

PUT /component/{idComponent}/details

Path parameters

  • idComponent string · required — Recipe or dish id.

Body

  • components array · required — Detail lines. An empty array deletes them all.

Each line:

  • idComponent string · required — Product or recipe used.

  • id string · optional — Id of an existing line, to update it. Omit it (do not send "") to create a line.

  • quantity number · required unless qs — Quantity.

  • idUnit string · required unless qs — Unit id.

  • qs boolean · optional — true means sufficient quantity: quantity and idUnit are not stored. Defaults to false.

  • idUse string · optional — Cut or breakdown id.

  • comment string · optional — Comment.

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

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/component/3515834441676562996102030010/details \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"components": [
{ "id": "3515834441676562996102030013", "idComponent": "3515834441676562996102030001", "idUnit": "3515834441676562996102030002", "quantity": 0.1, "position": 0 },
{ "idComponent": "3515834441676562996102030021", "qs": true, "position": 1 }
]
}'

Response — No content.

Need help? Message us from the support chat in the bottom-right corner.

Did this answer your question?