Skip to main content

REST API: Stores

How to list, retrieve, and manage stores and their inventories.

List, retrieve, create and delete stores, their components and locations, and retrieve their inventories.

GET    /listStoresPaged
GET /store/{idStore}/inventory/{idInventory}/components/num/{numComponents}
GET /store/{idStore}/inventory/{idInventory}/components/paged
POST /store
DELETE /store/{idStore}
PUT /store/{idStore}/components
DELETE /store/{idStore}/component/{idStoreComponent}
GET /store/{idStore}/locations
POST /store/{idStore}/location
DELETE /store/{idStore}/location/{idStoreLocation}
GET /storeLocation/{idStoreLocation}/storeComponents
POST /storeLocation/{idStoreLocation}/storeComponents/add
POST /storeLocation/{idStoreLocation}/storeComponents/remove
PUT /store/{idStore}/components/move/some/{idStoreDest}
GET /listInventoriesPaged
GET /inventory/{idInventory}/total
GET /inventory/{idInventory}/components/paged

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.

Login — Returns the token as plain text.

curl https://app.tspoonlab.com/recipes/api/login \
-d [email protected] \
-d password=XXXXXXX

Permissions — Viewing stores and locations requires permission to view stores (listing them also works with permission to view inventories); creating, changing or deleting, permission to edit stores; the inventory endpoints, permission to view inventories.

Components — A store component is a product, material, recipe or dish kept in that store. It has its own id (idStoreComponent), different from the id of the product or recipe (idComponent).

Dates — Returned as milliseconds since 1970 (epoch).

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


List stores

Returns the visible stores of the active cost center, sorted by name.

GET /listStoresPaged

Query parameters

  • start integer · optional — Position of the first row, starting at 0. Defaults to 0.

  • rows integer · optional — Number of rows to return. Defaults to all.

  • filter string · optional — Text to filter by store name.

Example

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

Response

[
{
"id": "3515834441676562996102020101",
"descr": "Cold room",
"defecte": true
}
]
  • id string — Store id.

  • descr string — Name.

  • defecte boolean — true if it is the default store for reception, production or dispatch in the active cost center.


Retrieve a store

Returns the store and its first components, with stock calculated from an inventory.

GET /store/{idStore}/inventory/{idInventory}/components/num/{numComponents}

Path parameters

  • idStore string · required — Store id.

  • idInventory string · required — Starting inventory for the stock calculation. With null (or any value that is not an id), the store's latest inventory. With a specific inventory, movements are counted up to the next inventory.

  • numComponents integer · required — Number of components to return, starting from the first one.

Example

curl https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/inventory/null/components/num/50 \
-H "rememberme: $TOKEN"

Response

{
"id": "3515834441676562996102020101",
"descr": "Cold room",
"comment": null,
"listComponent": [
{
"id": "3515834441676562996102020102",
"descr": "Onion",
"idComponent": "3515834441676562996102020103",
"idUse": null,
"use": null,
"idUnit": "3515834441676562996102020104",
"unit": "kg",
"quantityInventory": 12.5,
"quantityInput": 20,
"quantityOutput": -18.25,
"quantityDesviation": null
}
]
}
  • id string — Store id.

  • descr string — Name.

  • comment string — Comment.

  • listComponent array — Store components.

Each component:

  • id string — Id of the component in the store (idStoreComponent).

  • descr string — Name of the product, material, recipe or dish.

  • idComponent string — Id of the product, material, recipe or dish.

  • idUse, use string — Cut or breakdown, if any.

  • idUnit, unit string — Unit of the quantities.

  • quantityInventory number — Quantity in the starting inventory or, if there is a later stock adjustment, in the latest adjustment.

  • quantityInput number — Sum of later inputs.

  • quantityOutput number — Sum of later outputs, as a negative number.

  • quantityDesviation number — Differences detected in stock adjustments.

If the store has no inventory, the quantities are null.


List a store's components

Same as Retrieve a store, but paginated and with a filter.

GET /store/{idStore}/inventory/{idInventory}/components/paged

Path parameters

  • idStore string · required — Store id.

  • idInventory string · required — Starting inventory (see Retrieve a store).

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 filter by component name, alternative name or code.

Example

curl "https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/inventory/null/components/paged?start=50&rows=50" \
-H "rememberme: $TOKEN"

Response — List of components with the same fields as listComponent in Retrieve a store.


Create a store

Creates the store in the active cost center, with an initial inventory dated today. Returns its id.

POST /store

Body

  • descr string · required — Name.

  • comment string · optional — Comment.

  • defaultReception boolean · optional — Default store for reception in the active cost center. Defaults to false.

  • defaultProduction boolean · optional — Default store for production in the active cost center. Defaults to false.

  • defaultExpedition boolean · optional — Default store for dispatch in the active cost center. Defaults to false.

Example

curl https://app.tspoonlab.com/recipes/api/store \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"descr": "Cold room", "defaultReception": true}'

Response

{ "id": "3515834441676562996102020101" }

Delete a store

Also deletes its inventories, its components and their stock movements.

DELETE /store/{idStore}

Path parameters

  • idStore string · required — Store id.

Example

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

Response — No content.


Add components to a store

Replaces the store's component list: components not sent are deleted, together with their stock movements. To keep a component, send it with its id.

PUT /store/{idStore}/components

Path parameters

  • idStore string · required — Store id.

Body

  • components array · required — Every component the store must have.

Each component:

  • id string · optional — Id of the component in the store, to keep an existing one. Without id, it is added as new.

  • idComponent string · required — Id of the product, material, recipe or dish.

  • idUse string · optional — Cut or breakdown id.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/components \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"components": [
{ "id": "3515834441676562996102020102", "idComponent": "3515834441676562996102020103" },
{ "idComponent": "3515834441676562996102020105" }
]
}'

Response — No content.


Delete a component from a store

Also deletes its stock movements.

DELETE /store/{idStore}/component/{idStoreComponent}

Path parameters

  • idStore string · required — Store id.

  • idStoreComponent string · required — Id of the component in the store.

Example

curl -X DELETE https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/component/3515834441676562996102020102 \
-H "rememberme: $TOKEN"

Response — No content.


List a store's locations

GET /store/{idStore}/locations

Path parameters

  • idStore string · required — Store id.

Example

curl https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/locations \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020106",
"descr": "Shelf 1",
"comment": null,
"countStoreComponents": 14
}
]
  • id string — Location id.

  • descr string — Name.

  • comment string — Comment.

  • countStoreComponents integer — Number of visible components in the location.


Create a location

Returns its id.

POST /store/{idStore}/location

Path parameters

  • idStore string · required — Store id.

Body

  • descr string · required — Name.

  • comment string · optional — Comment.

Example

curl https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/location \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"descr": "Shelf 1"}'

Response

{ "id": "3515834441676562996102020106" }

Delete a location

DELETE /store/{idStore}/location/{idStoreLocation}

Path parameters

  • idStore string · required — Store id.

  • idStoreLocation string · required — Location id. It must belong to that store.

Example

curl -X DELETE https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/location/3515834441676562996102020106 \
-H "rememberme: $TOKEN"

Response — No content.


List a location's components

Returns the visible components in the location, sorted by name.

GET /storeLocation/{idStoreLocation}/storeComponents

Path parameters

  • idStoreLocation string · required — Location id.

Example

curl https://app.tspoonlab.com/recipes/api/storeLocation/3515834441676562996102020106/storeComponents \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020102",
"descr": "Onion",
"idComponent": "3515834441676562996102020103",
"idUse": null,
"use": null
}
]
  • id string — Id of the component in the store (idStoreComponent).

  • descr string — Name of the product, material, recipe or dish.

  • idComponent string — Id of the product, material, recipe or dish.

  • idUse, use string — Cut or breakdown, if any.


Add components to a location

Ids that do not exist are ignored.

POST /storeLocation/{idStoreLocation}/storeComponents/add

Path parameters

  • idStoreLocation string · required — Location id.

Body

  • storeComponents array · required — Components to add.

Each component:

  • idStoreComponent string · required — Id of the component in the store.

Example

curl https://app.tspoonlab.com/recipes/api/storeLocation/3515834441676562996102020106/storeComponents/add \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"storeComponents": [{"idStoreComponent": "3515834441676562996102020102"}]}'

Response — No content.


Remove components from a location

Removes them from the location; they stay in the store.

POST /storeLocation/{idStoreLocation}/storeComponents/remove

Path parameters

  • idStoreLocation string · required — Location id.

Body

  • storeComponents array · required — Components to remove.

Each component:

  • id string · required — Id of the component in the store (the id returned by List a location's components).

Example

curl https://app.tspoonlab.com/recipes/api/storeLocation/3515834441676562996102020106/storeComponents/remove \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"storeComponents": [{"id": "3515834441676562996102020102"}]}'

Response — No content.


Move components to another store

Moves the current stock of each component to the destination store, where it is created if it does not exist, and hides the component in the source store.

PUT /store/{idStore}/components/move/some/{idStoreDest}

Path parameters

  • idStore string · required — Source store id.

  • idStoreDest string · required — Destination store id.

Body

  • listIds array · required — Ids of the components in the source store. Ids that do not belong to that store are ignored.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/store/3515834441676562996102020101/components/move/some/3515834441676562996102020107 \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020102"]}'

Response — No content.


List inventories

Returns the inventories of the active cost center's stores, newest first.

GET /listInventoriesPaged

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 filter by store name.

  • year integer · optional — Inventory year.

  • month integer · optional — Inventory month, from 1 to 12.

Example

curl "https://app.tspoonlab.com/recipes/api/listInventoriesPaged?start=0&rows=50&year=2026" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020108",
"descr": "Cold room",
"idAux": "3515834441676562996102020101",
"year": 2026,
"month": 9,
"dateGenerated": 1790762400000
}
]
  • id string — Inventory id.

  • descr string — Store name.

  • idAux string — Store id.

  • year, month integer — Inventory year and month.

  • dateGenerated date — Inventory date.


Retrieve an inventory's value

GET /inventory/{idInventory}/total

Path parameters

  • idInventory string · required — Inventory id.

Example

curl https://app.tspoonlab.com/recipes/api/inventory/3515834441676562996102020108/total \
-H "rememberme: $TOKEN"

Response

{ "value": 4825.3 }
  • value number — Inventory value: sum of the value of the lines that have a quantity.


List an inventory's lines

GET /inventory/{idInventory}/components/paged

Path parameters

  • idInventory string · required — Inventory id.

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 filter the components.

Example

curl "https://app.tspoonlab.com/recipes/api/inventory/3515834441676562996102020108/components/paged?start=0&rows=50" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020109",
"descr": "Onion",
"idComponent": "3515834441676562996102020103",
"idComponentType": "3515834441676562996102020110",
"componentType": "Vegetables",
"quantity": 12.5,
"cost": 13.75
}
]
  • id string — Inventory line id.

  • descr string — Name of the product, material, recipe or dish.

  • idComponent string — Id of the product, material, recipe or dish.

  • idComponentType, componentType string — Main category (Categories).

  • quantity number — Counted quantity.

  • cost number — Line value.

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

Did this answer your question?