List clients and client types, retrieve a client and its products for sale.
GET /listCustomersPaged
GET /listCustomerTypesPaged
GET /customer/{idCustomer}
GET /customer/{idCustomer}/components/paged
Each cost center has its own clients, which sales are made to.
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). List clients returns the clients of this cost center. 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 — Permission to view clients. Listing client types requires permission to view client types.
Responses may include fields other than the documented ones. Use only the documented fields.
List clients
GET /listCustomersPaged
Query parameters
startinteger · required — Position of the first row, starting at 0.rowsinteger · required — Number of rows to return.filterstring · optional — Text to filter by name, code or client type.hiddenboolean · optional —truereturns only hidden clients. Defaults tofalse: only clients that are not hidden.
Example
curl "https://app.tspoonlab.com/recipes/api/listCustomersPaged?start=0&rows=50" \
-H "rememberme: $TOKEN"
Response
[
{
"id": "3515834441676562996102020901",
"descr": "Downtown Restaurant",
"codi": "C001",
"defecte": true,
"idType": "3515834441676562996102020951",
"descrType": "Dining room"
}
]
idstring — Client id.descrstring — Name.codistring — Code.defecteboolean —trueif it is the default client.idType,descrTypestring — Client type (see List client types).
List client types
Types are used to classify clients.
GET /listCustomerTypesPaged
Query parameters
startinteger · required — Position of the first row, starting at 0.rowsinteger · required — Number of rows to return.filterstring · optional — Text to filter types by name or code.
Example
curl "https://app.tspoonlab.com/recipes/api/listCustomerTypesPaged?start=0&rows=50" \
-H "rememberme: $TOKEN"
Response
[
{ "id": "3515834441676562996102020951", "descr": "Dining room", "codi": "DIN" }
]
idstring — Type id.descrstring — Name.codistring — Code.
Retrieve a client
If the client does not exist, the response is empty.
GET /customer/{idCustomer}Path parameters
idCustomerstring · required — Client id.
Example
curl https://app.tspoonlab.com/recipes/api/customer/3515834441676562996102020901 \
-H "rememberme: $TOKEN"
Response
{
"id": "3515834441676562996102020901",
"descr": "Downtown Restaurant",
"codi": "C001",
"defecte": true,
"nif": "B12345678",
"comment": null,
"web": "https://www.downtownrestaurant.com",
"mailcc": "[email protected]",
"address": "10 High Street",
"city": "Barcelona",
"cp": "08001",
"idCustomerType": "3515834441676562996102020951",
"listContact": [
{ "id": "3515834441676562996102021001", "descr": "Laura Smith", "phone": "+34 600 000 000" }
],
"listMail": [
{ "id": "3515834441676562996102021002", "descr": "[email protected]" }
],
"listGroups": [
{
"id": "3515834441676562996102021003",
"idCustomerGroup": "3515834441676562996102021004",
"customerGroup": "Drinks",
"codiCustomerGroup": "DRK",
"comment": null
}
]
}idstring — Client id.descrstring — Name.codistring — Code.defecteboolean —trueif it is the default client.nifstring — Tax ID.commentstring — Comment.webstring — Website.mailccstring — Address that receives a copy of the orders emailed to the client.address,city,cpstring — Address, city and postcode.idCustomerTypestring — Client type.nullif it has none.listContactarray — Contacts:id,descr(name) andphone.listMailarray — Contact emails:idanddescr(email address).listGroupsarray — The client's groups of products for sale.
Each group:
idstring — Id of the group in this client.idCustomerGroup,customerGroup,codiCustomerGroupstring — Group id, name and code.commentstring — Comment.
List a client's products for sale
Returns the products and menus the client has for sale. By default, those without a group and those in each group; to get a single group, send showAll=false. Discontinued items are not included.
GET /customer/{idCustomer}/components/pagedPath parameters
idCustomerstring · required — Client id.
Query parameters
startinteger · optional — Position of the first row, starting at 0. Defaults to 0.rowsinteger · optional — Number of rows to return. If omitted, all rows are returned. WithshowAll=true,startandrowsapply separately to the items without a group and to each group.filterstring · optional — Text to filter by product or menu name, sale description or PLU.showAllboolean · optional —truereturns the items without a group and those in every group, and ignoresidGroup.falsereturns only the items in groupidGroup, or those without a group ifidGroupis not sent. Defaults totrue.idGroupstring · optional — Group to get the items of (idinlistGroupsin Retrieve a client). Only filters withshowAll=false. If the group does not exist, the call returns an error.
Example — Items in one group:
curl "https://app.tspoonlab.com/recipes/api/customer/3515834441676562996102020901/components/paged?showAll=false&idGroup=3515834441676562996102021003" \
-H "rememberme: $TOKEN"
Response
[
{
"id": "3515834441676562996102021101",
"idComponent": "3515834441676562996102021201",
"component": "Classic burger",
"idMenu": null,
"menu": null,
"plu": "HA001",
"quantity": 1,
"idUnit": "3515834441676562996102021301",
"unit": "portion",
"cost": 19.9,
"iva": 10,
"currency": "€",
"costComponent": 4.85,
"percentCost": 0.2681
}
]
idstring — Id of the item for sale.idComponent,componentstring — Product sold, if it is a product.idMenu,menustring — Menu sold, if it is a menu.plustring — Item code in the POS.quantitynumber — Quantity for sale.idUnitstring — Sale unit id.unitstring — Sale unit description.costnumber — Sale price including VAT.ivanumber — VAT rate, in %.currencystring — Currency symbol of the cost center, for example€.costComponentnumber — Product cost for the quantity for sale.percentCostnumber — Food cost: cost divided by the sale price excluding VAT, as a fraction (0.2681= 26.81%).
Need help? Message us from the support chat in the bottom-right corner.
