1. Overview
Each cost center can have multiple suppliers.
Each supplier provides a list of items, each with a vendor-specific code (codi), description, purchase format, and price.
A supplier item may be linked to a tSpoonLab product or not.
You can load a supplier’s full catalog and link only those items you purchase regularly.
1.1 REST API: Login
To call our APIs, first authenticate via a login call.
This call returns a token that must be included in every subsequent request.
[email protected] password=XXXXXXX url=https://www.tspoonlab.com/recipes/api authenticate="username=$username&password=$password" echo -n 'rememberme:' > rememberme.txt curl -v --data "$authenticate" "$url/login" >> rememberme.txt
For later calls, add the token to your headers:
curl -X PUT -v -H "$(cat rememberme.txt)" "$url/integration/call"
1.2 REST API: Select a Cost Center / Restaurant
Most requests refer to a cost center (usually a restaurant).
To retrieve the list of cost centers and IDs, see:
REST API: Get a List of Cost Centers
The cost center identifier corresponds to idOrderCenter in class UserOrderCenter.
Add this identifier to your headers for all subsequent calls:
echo -n 'order:351583444167656299610202XXXXXXXXXXXX' >> rememberme.txt
Headers example:
rememberme:aGVucnkudXBzYWxsLmRAZXXXXXXXXXXXXXXXXXX order:351583444167656299610202XXXXXXXXXXXX
1.3 REST API: List all Suppliers
Endpoint
GET https://www.tspoonlab.com/recipes/api/listVendorsPaged
Query params
Param | Type | Required | Description |
start | int | ✅ | first row index |
rows | int | ✅ | number of rows to return |
filter | string |
| text filter by supplier name |
hidden | boolean |
| only return hidden suppliers |
Response
class TypeEntry { String id; String descr; String codi; boolean defecte; String descrType; String idType; EntityBaseDescr orderCenter; } class EntityBaseDescr { String id; String descr; }Explanation
id: supplier IDdescr: supplier namecodi: supplier codedefecte:trueif this is the default supplier (used when no linked item exists)idType,descrType: supplier classificationorderCenter: if supplier is linked to another client (e.g. central kitchen)
1.4 REST API: List Supplier Types
GET https://www.tspoonlab.com/recipes/api/listVendorTypesPaged
Query params
Param | Type | Required |
start | int | ✅ |
rows | int | ✅ |
filter | string |
|
Response
class EntityBaseBoolCodi { String id; String descr; String codi; }1.5 REST API: Create / Delete a Supplier Type
Create
POST https://www.tspoonlab.com/recipes/api/vendorType
Body
class NewVendorType { String descr; String codi; String comment; }Response
class IdWrapper { String id; }Delete
DELETE https://www.tspoonlab.com/recipes/api/vendorType/{idVendorType}1.6 REST API: Create a Supplier
Endpoint
POST https://www.tspoonlab.com/recipes/api/vendor
Body
class NewVendor { String descr; Boolean defecte; String comment; String mailcc; String web; String codi; String nif; String address; String city; String cp; boolean creditor; String idVendorType; List<NewVendorContact> listContact; List<NewVendorMail> listMail; } class NewVendorContact { String descr; // contact name String phone; } class NewVendorMail { String descr; // email address }Notes
defecte: set as default suppliermailcc: CC address for purchase emailsnif: tax IDcreditor: marks as creditor (non-typical supplier)idVendorType: optional supplier type
Response
class IdWrapper { String id; }1.7 REST API: Delete / Hide / Unhide a Supplier
Suppliers with existing purchases cannot be deleted — hide them instead.
Delete
DELETE https://www.tspoonlab.com/recipes/api/vendor/{idVendor}Hide
PUT https://www.tspoonlab.com/recipes/api/vendor/{idVendor}/hideUnhide
PUT https://www.tspoonlab.com/recipes/api/vendor/{idVendor}/unhide1.8 REST API: Get Supplier Details
GET https://www.tspoonlab.com/recipes/api/vendor/{idVendor}Response (simplified)
class Vendor { String id; String descr; Boolean defecte; String comment; String mailcc; String web; String codi; String nif; boolean creditor; String address; String city; String cp; List<VendorContact> listContact; List<VendorMail> listMail; List<VendorComponent> listComponent; List<VendorOther> listOther; List<VendorOrder> listOrders; }Key Lists
listComponent: linked supplier items (connected to tSpoonLab products)listOther: unlinked supplier itemslistOrders: recent purchases (10 latest)
Unlinked Supplier Item
class VendorOther { String id; String descr; String codi; Double cost; String comment; String lastModified; }Linked Supplier Item
class VendorComponent { String id; String descr; String codi; Double cost; String comment; String lastModified; String unit; String idUnit; Boolean defecte; String idComponent; String component; List<Format> listFormat; } class Format { String id; String descr; String comment; String codi; Double costFormat; String lastModified; Double quantityFormat; String unitFormat; String idUnitFormat; }Recent Purchases (summary)
class VendorOrder extends EntityBaseDescr { String idProveidorComanda; Double cost; String dateGenerated; int type; // 0=pending send, 1=pending receive, 2=received }For more than 10 purchases:
GET https://www.tspoonlab.com/recipes/api/vendor/{idVendor} ?start=0&rows=1001.9 REST API: Add / Remove Unlinked Supplier Items
Add
POST https://www.tspoonlab.com/recipes/api/vendor/{idVendor}/components/otherBody
class NewVendorOther { String descr; String codi; Double cost; String comment; }Delete
DELETE https://www.tspoonlab.com/recipes/api/vendor/{idVendor}/component/{idVendorComponent}1.10 REST API: Add / Remove Linked Supplier Items
You can add multiple linked items in a single call.
Add
POST https://www.tspoonlab.com/recipes/api/vendor/{idVendor}/components/addBody
class NewVendorComponentWrapper { List<NewVendorComponent> components; } class NewVendorComponent { String codi; String descr; String comment; String idComponent; // target product Double cost; Boolean defecte; // default supplier for product List<NewFormat> listFormat; } class NewFormat { String codi; String descr; String comment; String idUnit; Double quantity; Double cost; }Best practice:
One VendorComponent per format.
If a supplier sells the same product in multiple formats, create separate entries.
Remove
DELETE https://www.tspoonlab.com/recipes/api/vendor/{idVendor}/component/{idVendorComponent}1.11 REST API: Manage Purchases (Orders)
A Purchase Order groups multiple supplier purchases under one operation (e.g., daily order).
List Orders
GET https://www.tspoonlab.com/recipes/api/listOrdersPagedExt
Create Order
POST https://www.tspoonlab.com/recipes/api/order
class NewOrder { String descr; Date data; }Delete Order
DELETE https://www.tspoonlab.com/recipes/api/order/{idOrder}Get Full Order (with supplier purchases)
POST https://www.tspoonlab.com/recipes/api/order/{idOrder}class Order { String id; String descr; String dateGenerated; Date data; Double cost; Double taxes; List<OrderVendor> listComandes; }Supplier Purchase
class OrderVendor { String id; String idProveidorComanda; String idVendor; short status; // 0=pending send, 1=pending receive, 2=received String comment; String dateGenerated; String dateReceptionFlat; Double cost; Double taxes; List<OrderVendorComponent> listComponents; }Purchase Line Items
class OrderVendorComponent { String id; String idVendorComponent; String comment; boolean rebut; Double cost; Double quantity; Double quantityFormat; String idUnit; String idUnitFormat; String idFormat; }To compute total line cost:
Without format →
cost * quantityWith format →
cost * quantityFormat
Create a Supplier Purchase
POST https://www.tspoonlab.com/recipes/api/order/{idOrder}/vendor/{idVendor}Response
class IdWrapper { String id; } // Returns purchase IDAdd Items to Purchase
PUT https://www.tspoonlab.com/recipes/api/orderVendor/{idOrderVendor}/editclass NewOrderComponentData { List<NewOrderComponent> components; } class NewOrderComponent { String idVendorComponent; Double quantity; Double quantityFormat; String idUnit; String idUnitFormat; String idFormat; Double cost; String comment; }Delete Purchase
DELETE https://www.tspoonlab.com/recipes/api/orderVendor/{id}Notes
All endpoints require a valid
remembermetoken andorder(cost center) header.Always use HTTPS.
Prefer one
VendorComponentper purchase format.The API returns all numeric costs excluding tax (net values).