Skip to main content

REST API: Cost centers

How to retrieve all cost centers (restaurants) available to the current user

List the cost centers (restaurants) the user has access to.

GET /orderCenters

Before you start

Base URL: https://app.tspoonlab.com/recipes/api

Headers

  • rememberme · required — Session token returned by the login.

Each center's idOrderCenter is the value you send in the order header on every other call. If you don't send it, the user's active cost center is used.

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 centers.

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


List cost centers

Returns the user's cost centers sorted by name. Hidden centers are not included.

GET /orderCenters

Example

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

Response

[
{
"id": "3515834441676562996102020101",
"idOrderCenter": "3515834441676562996102020102",
"descr": "Downtown Restaurant",
"active": true,
"culture": "es-ES",
"country": "es",
"currency": "€",
"codi": "DR",
"name": "Downtown Dining S.L.",
"nif": "B12345678",
"address": "Carrer Major, 12",
"cp": "17001",
"city": "Girona",
"mail": "[email protected]",
"telfs": "972 000 000",
"mailText": "Good morning, please find our order attached.",
"mailSignature": "Purchasing department",
"decimalsCurrencyShort": 2,
"decimalsCurrencyLong": 4
}
]
  • id string — Id of the user/cost-center relationship.

  • idOrderCenter string — Cost center id. This is the value of the order header.

  • descr string — Center name.

  • active boolean — Whether it is the user's active cost center.

  • culture string — Center language and country, for example es-ES.

  • country string — Lowercase country code, for example es.

  • currency string — Currency symbol, for example €.

  • codi string — Center code.

  • name, nif, address, cp, city string — Identifying details: name, tax id, address, postcode and city.

  • mail, telfs string — Email and phone numbers.

  • mailText string — Text of purchase order emails to suppliers.

  • mailSignature string — Signature of those emails.

  • decimalsCurrencyShort integer — Decimals for amounts of 1 or more (absolute value). If the center has no setting, 2.

  • decimalsCurrencyLong integer — Decimals for amounts under 1. If the center has no setting, 4.

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

Did this answer your question?