Skip to main content

REST API: Suppliers and purchases

How to read and create suppliers, manage their catalog items, and generate purchases. (Note: in the API, the term “vendor” is still used for backward compatibility.)

Manage suppliers, their items, orders and purchases.

GET    /listVendorsPaged
GET /listVendorTypesPaged
POST /vendorType
DELETE /vendorType/{idVendorType}
POST /vendor
DELETE /vendor/{idVendor}
PUT /vendor/{idVendor}/hide
PUT /vendor/{idVendor}/unhide
GET /vendor/{idVendor}
GET /vendor/{idVendor}/orders/paged
POST /vendor/{idVendor}/components/other
POST /vendor/{idVendor}/components/add
DELETE /vendor/{idVendor}/component/{idVendorComponent}
GET /listOrdersPagedExt
POST /order
GET /order/{idOrder}
DELETE /order/{idOrder}
POST /order/{idOrder}/vendor/{idVendor}
PUT /orderVendor/{idOrderVendor}/edit
DELETE /orderVendor/{idOrderVendor}

Each supplier has a list of items with their own code, description, purchase format and price. An item may or may not be linked to a tSpoonLab product. An order groups purchases (for example, all of one day's purchases), and each purchase goes to a single supplier.


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 — Suppliers: permission to view or edit suppliers. Supplier types: permission to view or edit supplier types. Orders and purchases: permission to view or edit orders; adding a purchase to an order requires permission to add purchases. Item costs are only returned with permission to view purchase costs.

Dates — Numeric date fields are returned as milliseconds since 1970 (epoch). Text fields such as dateGenerated or lastModified are dates already formatted for display. When sending a date, milliseconds or ISO 8601 with time are accepted, for example 2026-10-30T09:00:00.000+01:00.

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


List suppliers

Returns the cost center's suppliers.

GET /listVendorsPaged

Query parameters

  • start integer · optional — Position of the first row, starting at 0. If neither start nor rows is sent, all suppliers are returned.

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

  • filter string · optional — Text to search by name or code.

  • hidden boolean · optional — true returns only hidden suppliers. Defaults to false: visible suppliers only.

Example

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

Response

[
{
"id": "3515834441676562996102020301",
"descr": "Garriga Foods",
"codi": "P-001",
"defecte": false,
"idType": "3515834441676562996102020302",
"descrType": "Fruit and vegetables",
"orderCenter": null
}
]
  • id string — Supplier id.

  • descr string — Name.

  • codi string — Code.

  • defecte boolean — Whether it is the cost center's default supplier: the one that receives the purchase of a product with no supplier assigned.

  • idType, descrType string — Supplier type.

  • orderCenter object — If the supplier is another cost center in the account (for example, a central kitchen), that center: id and descr. Otherwise null.


List supplier types

GET /listVendorTypesPaged

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 by name or code.

Example

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

Response

[
{ "id": "3515834441676562996102020302", "descr": "Fruit and vegetables", "codi": "FV" }
]
  • id string — Type id.

  • descr string — Name.

  • codi string — Code.


Create a supplier type

POST /vendorType

Body

  • descr string · required — Name.

  • codi string · optional — Code.

  • comment string · optional — Comment.

Example

curl https://app.tspoonlab.com/recipes/api/vendorType \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"descr": "Fruit and vegetables", "codi": "FV"}'

Response

{ "id": "3515834441676562996102020302" }

Delete a supplier type

Suppliers of that type are left without a type.

DELETE /vendorType/{idVendorType}

Path parameters

  • idVendorType string · required — Type id.

Example

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

Response — No content.


Create a supplier

The supplier is created in the cost center of the call.

POST /vendor

Body

  • descr string · required — Name.

  • codi string · optional — Code.

  • nif string · optional — Tax id.

  • address, city, cp string · optional — Address, city and postcode.

  • web string · optional — Supplier website.

  • mailcc string · optional — Email that gets a copy of the orders sent to the supplier.

  • comment string · optional — Comment.

  • defecte boolean · optional — Whether it is the cost center's default supplier.

  • creditor boolean · optional — true if it is a creditor. Defaults to false.

  • idVendorType string · optional — Supplier type.

  • listContact array · optional — Contacts.

  • listMail array · optional — Contact emails.

Each contact:

  • descr string · optional — Contact name.

  • phone string · optional — Phone.

Each email:

  • descr string · optional — Email address.

Example

curl https://app.tspoonlab.com/recipes/api/vendor \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"descr": "Garriga Foods",
"codi": "P-001",
"nif": "B17000000",
"idVendorType": "3515834441676562996102020302",
"listContact": [{ "descr": "Marta Puig", "phone": "600 000 000" }],
"listMail": [{ "descr": "[email protected]" }]
}'

Response

{ "id": "3515834441676562996102020301" }

Delete a supplier

Recalculates the default supplier and the cost of the products it was linked to. A supplier with invoices (error 409, VENDOR_HAS_INVOICES) or with purchases cannot be deleted: hide it instead.

DELETE /vendor/{idVendor}

Path parameters

  • idVendor string · required — Supplier id.

Example

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

Response — No content.


Hide a supplier

PUT /vendor/{idVendor}/hide

Path parameters

  • idVendor string · required — Supplier id.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/vendor/3515834441676562996102020301/hide \
-H "rememberme: $TOKEN"

Response — No content.


Unhide a supplier

PUT /vendor/{idVendor}/unhide

Path parameters

  • idVendor string · required — Supplier id.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/vendor/3515834441676562996102020301/unhide \
-H "rememberme: $TOKEN"

Response — No content.


Retrieve a supplier

Returns the supplier with its contacts, its items and its last 10 purchases. Items and purchases are those of the cost center of the call. If the supplier doesn't exist, the response is empty.

GET /vendor/{idVendor}

Path parameters

  • idVendor string · required — Supplier id.

Example

curl https://app.tspoonlab.com/recipes/api/vendor/3515834441676562996102020301 \
-H "rememberme: $TOKEN"

Response

{
"id": "3515834441676562996102020301",
"descr": "Garriga Foods",
"codi": "P-001",
"nif": "B17000000",
"address": "Carrer del Mercat, 3",
"city": "Girona",
"cp": "17003",
"web": "https://garriga.com",
"mailcc": "[email protected]",
"comment": null,
"defecte": false,
"creditor": false,
"vendorType": { "id": "3515834441676562996102020302", "descr": "Fruit and vegetables" },
"listContact": [{ "id": "3515834441676562996102020303", "descr": "Marta Puig", "phone": "600 000 000" }],
"listMail": [{ "id": "3515834441676562996102020304", "descr": "[email protected]" }],
"listComponent": [
{
"id": "3515834441676562996102020305",
"descr": "Sunflower oil 5 L",
"codi": "AG5",
"comment": null,
"cost": 1.85,
"lastModified": "Thu, Oct 29, 2026 10:12",
"idComponent": "3515834441676562996102020306",
"component": "Sunflower oil",
"idUnit": "3515834441676562996102020307",
"unit": "L",
"defecte": true,
"listFormat": [
{
"id": "3515834441676562996102020308",
"descr": "5 L jug",
"codi": "AG5-G",
"comment": null,
"costFormat": 9.25,
"quantityFormat": 5,
"idUnitFormat": "3515834441676562996102020309",
"unitFormat": "Jug",
"lastModified": "Thu, Oct 29, 2026 10:12"
}
]
}
],
"listOther": [
{
"id": "3515834441676562996102020310",
"descr": "Cardboard boxes",
"codi": "CC-01",
"comment": "Pack of 25",
"cost": 12.5,
"lastModified": "Mon, Oct 12, 2026 08:30"
}
],
"listOrders": [
{
"id": "3515834441676562996102020311",
"descr": "Order 29/10",
"idProveidorComanda": "3515834441676562996102020312",
"cost": 46.25,
"dateGenerated": "Thu, Oct 29, 2026 09:00",
"type": 2
}
]
}
  • id string — Supplier id.

  • descr, codi, nif string — Name, code and tax id.

  • address, city, cp string — Address, city and postcode.

  • web, mailcc, comment string — Website, copy email for orders and comment.

  • defecte boolean — Whether it is the cost center's default supplier.

  • creditor boolean — Whether it is a creditor.

  • vendorType object — Supplier type: id and descr. null if none.

  • listContact array — Contacts: id, descr (name) and phone.

  • listMail array — Emails: id and descr (address).

  • listComponent array — Items linked to a product.

  • listOther array — Unlinked items.

  • listOrders array — Last 10 purchases from the supplier.

Each unlinked item:

  • id string — Item id.

  • descr, codi string — The supplier's name and code for the item.

  • comment string — Comment, for example the purchase format.

  • cost number — Cost.

  • lastModified string — Date of the last cost change.

Each linked item — The same fields, plus:

  • idComponent, component string — Linked product.

  • idUnit, unit string — Product unit. cost is the cost of one unit: for example, of 1 L if you buy 5 L jugs.

  • defecte boolean — Whether it is the default item for buying that product in the cost center.

  • listFormat array — Purchase formats.

Each format:

  • id string — Format id.

  • descr string — Format name.

  • codi, comment string — The supplier's code for the format and comment.

  • costFormat number — Cost of one format (the whole jug).

  • quantityFormat number — Format size in the product unit (5 for a 5 L jug).

  • idUnitFormat, unitFormat string — Format unit (Jug).

  • lastModified string — Date of the last cost change.

Each purchase:

  • id, descr string — Order the purchase belongs to.

  • idProveidorComanda string — Purchase id.

  • cost number — Amount excluding taxes.

  • dateGenerated string — Reception date; if there is none, the purchase date.

  • type integer — Status: -1 pending approval · 0 pending to send · 1 pending to receive · 2 received · 3 pending scan.


List a supplier's purchases

Like listOrders in Retrieve a supplier, but paginated.

GET /vendor/{idVendor}/orders/paged

Path parameters

  • idVendor string · required — Supplier 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 purchases.

Example

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

Response — List of purchases with the same fields as listOrders.

[
{
"id": "3515834441676562996102020311",
"descr": "Order 29/10",
"idProveidorComanda": "3515834441676562996102020312",
"cost": 46.25,
"dateGenerated": "Thu, Oct 29, 2026 09:00",
"type": 2
}
]

Add an unlinked item

POST /vendor/{idVendor}/components/other

Path parameters

  • idVendor string · required — Supplier id.

Body

  • descr string · optional — The supplier's name for the item.

  • codi string · optional — The supplier's code for the item.

  • cost number · optional — Cost.

  • comment string · optional — Comment, for example the purchase format.

Example

curl https://app.tspoonlab.com/recipes/api/vendor/3515834441676562996102020301/components/other \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"descr": "Cardboard boxes", "codi": "CC-01", "cost": 12.5, "comment": "Pack of 25"}'

Response — The new item, with the fields of an unlinked item (see Retrieve a supplier).

{
"id": "3515834441676562996102020310",
"descr": "Cardboard boxes",
"codi": "CC-01",
"comment": "Pack of 25",
"cost": 12.5,
"lastModified": "Fri, Oct 30, 2026 11:05"
}

Add linked items

Creates one or more items linked to products. The item unit is always the product unit. Recalculates the cost of the affected products.

POST /vendor/{idVendor}/components/add

Path parameters

  • idVendor string · required — Supplier id.

Body

  • components array · required — Items to create.

Each item:

  • idComponent string · required — Product to link to.

  • descr string · optional — The supplier's name for the item.

  • codi string · optional — The supplier's code for the item.

  • comment string · optional — Comment.

  • cost number · optional — Cost of one product unit. Ignored without permission to view purchase costs.

  • defecte boolean · optional — true to make it the default item for buying that product.

  • listFormat array · optional — Purchase formats.

Each format:

  • idUnit string · required — Format unit, for example Jug (see Rest API: Units).

  • quantity number · required — Format size in the product unit: 5 for a 5 L jug.

  • descr string · optional — Format name.

  • codi string · optional — The supplier's code for the format.

  • comment string · optional — Comment.

  • cost number · optional — Cost of one format (the whole jug). Ignored without permission to view purchase costs.

Example

curl https://app.tspoonlab.com/recipes/api/vendor/3515834441676562996102020301/components/add \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"components": [
{
"idComponent": "3515834441676562996102020306",
"descr": "Sunflower oil 5 L",
"codi": "AG5",
"cost": 1.85,
"defecte": true,
"listFormat": [
{ "idUnit": "3515834441676562996102020309", "quantity": 5, "descr": "5 L jug", "cost": 9.25 }
]
}
]
}'

Response — List of the new items, with the fields of a linked item (see Retrieve a supplier).


Delete an item

Works for linked and unlinked items. Also deletes its formats and recalculates the default supplier and the cost of the linked product.

DELETE /vendor/{idVendor}/component/{idVendorComponent}

Path parameters

  • idVendor string · required — Supplier id.

  • idVendorComponent string · required — Item id.

Example

curl -X DELETE https://app.tspoonlab.com/recipes/api/vendor/3515834441676562996102020301/component/3515834441676562996102020310 \
-H "rememberme: $TOKEN"

Response — No content.


List orders

Returns the cost center's orders.

GET /listOrdersPagedExt

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 order name, in its purchases' description and in the delivery note number.

Example

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

Response

[
{
"id": "3515834441676562996102020311",
"descr": "Order 29/10",
"data": "Thu, Oct 29, 2026 09:00",
"year": 2026,
"month": 10,
"pendingSend": 1,
"pendingReceive": 2
}
]
  • id string — Order id.

  • descr string — Name.

  • data string — Order date, formatted for display.

  • year, month integer — Order year and month.

  • pendingSend integer — Purchases pending to send to the supplier.

  • pendingReceive integer — Purchases pending to receive.


Create an order

Creates an empty order in the cost center of the call. Returns its id.

POST /order

Body

  • descr string · required — Name.

  • data date · optional — Order date.

Example

curl https://app.tspoonlab.com/recipes/api/order \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"descr": "Order 30/10", "data": 1793350800000}'

Response

{ "id": "3515834441676562996102020313" }

Retrieve an order

Returns the order with its purchases and each purchase's lines. If the order doesn't exist, the response is empty.

GET /order/{idOrder}

Path parameters

  • idOrder string · required — Order id.

Example

curl https://app.tspoonlab.com/recipes/api/order/3515834441676562996102020311 \
-H "rememberme: $TOKEN"

Response

{
"id": "3515834441676562996102020311",
"descr": "Order 29/10",
"data": 1793264400000,
"dateGenerated": "10/29/2026",
"cost": 46.25,
"taxes": 4.63,
"listComandes": [
{
"id": "3515834441676562996102020301",
"descr": "Garriga Foods",
"idVendor": "3515834441676562996102020301",
"idProveidorComanda": "3515834441676562996102020312",
"status": 2,
"comment": null,
"dateGenerated": "Thu, Oct 29, 2026 09:00",
"dateReceptionFlat": "Thu, Oct 29, 2026 12:40",
"cost": 46.25,
"taxes": 4.63,
"listComponents": [
{
"id": "3515834441676562996102020314",
"idVendorComponent": "3515834441676562996102020305",
"comment": null,
"rebut": true,
"idFormat": "3515834441676562996102020308",
"quantityFormat": 5,
"idUnitFormat": "3515834441676562996102020309",
"quantity": 25,
"idUnit": "3515834441676562996102020307",
"cost": 46.25
}
]
}
]
}
  • id, descr string — Order id and name.

  • data number — Order date (epoch milliseconds).

  • dateGenerated string — Order date, formatted for display.

  • cost number — Sum of all purchases' amounts excluding taxes.

  • taxes number — Sum of taxes.

  • listComandes array — Purchases.

Each purchase:

  • id, descr string — Supplier id and name. Without permission to view suppliers, id is null.

  • idVendor string — Supplier id.

  • idProveidorComanda string — Purchase id.

  • status integer — Status: -1 pending approval · 0 pending to send · 1 pending to receive · 2 received · 3 pending scan.

  • comment string — Comment.

  • dateGenerated string — Purchase date, formatted for display.

  • dateReceptionFlat string — Reception date, formatted for display.

  • cost number — Amount excluding taxes.

  • taxes number — Taxes.

  • listComponents array — Purchase lines.

Each line:

  • id string — Line id.

  • idVendorComponent string — Supplier item.

  • comment string — Comment.

  • rebut boolean — Whether the goods have been received.

  • idFormat, quantityFormat, idUnitFormat — When buying by format: format, number of formats and format unit.

  • quantity number, idUnit string — Purchase quantity and unit. Used when idFormat is null.

  • cost number — Line amount: unit cost × quantityFormat (or × quantity if there is no format).


Delete an order

Also deletes all its purchases and their lines, including purchases already received.

DELETE /order/{idOrder}

Path parameters

  • idOrder string · required — Order id.

Example

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

Response — No content.


Add a purchase to an order

Creates an empty purchase to the supplier, pending to send and dated now. Returns the purchase id (idProveidorComanda).

POST /order/{idOrder}/vendor/{idVendor}

Path parameters

  • idOrder string · required — Order id.

  • idVendor string · required — Supplier id.

Example

curl -X POST https://app.tspoonlab.com/recipes/api/order/3515834441676562996102020313/vendor/3515834441676562996102020301 \
-H "rememberme: $TOKEN"

Response

{ "id": "3515834441676562996102020315" }

Set the lines of a purchase

Replaces the purchase's lines with the ones you send: existing lines that you don't send are deleted. The comment and any other purchase details not sent are cleared.

PUT /orderVendor/{idOrderVendor}/edit

Path parameters

  • idOrderVendor string · required — Purchase id (idProveidorComanda).

Body

  • components array · required — Lines. Can be empty.

Each line:

  • id string · optional — Id of an existing line of this purchase (see Retrieve an order). With it, the line is kept and updated with the data you send; without it, a new line is created.

  • idVendorComponent string · optional — Supplier item.

  • idFormat string · optional — Purchase format. If sent, the quantity goes in quantityFormat and the unit in idUnitFormat.

  • quantityFormat number · optional — Number of formats.

  • idUnitFormat string · optional — Format unit.

  • quantity number · optional — Quantity, when there is no format.

  • idUnit string · optional — Purchase unit, when there is no format.

  • cost number · optional — Total line amount, not the unit cost: it is divided by the quantity to get the unit cost.

  • comment string · optional — Comment.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/orderVendor/3515834441676562996102020312/edit \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"components": [
{
"id": "3515834441676562996102020314",
"idVendorComponent": "3515834441676562996102020305",
"idFormat": "3515834441676562996102020308",
"quantityFormat": 6,
"idUnitFormat": "3515834441676562996102020309",
"cost": 55.5
},
{
"idVendorComponent": "3515834441676562996102020316",
"quantity": 2,
"idUnit": "3515834441676562996102020317",
"cost": 7.8,
"comment": "New line"
}
]
}'

Response

{ "id": "3515834441676562996102020312" }

Delete a purchase

Deletes the purchase and its lines, even if it has already been received.

DELETE /orderVendor/{idOrderVendor}

Path parameters

  • idOrderVendor string · required — Purchase id (idProveidorComanda).

Example

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

Response — No content.

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

Did this answer your question?