Skip to content

Quickstart

This page takes you from zero to your first successful call to the RestroLab API.

There are two roles in this flow, and it helps to keep them straight:

  • The organization owner (the restaurant/hotel) creates a credential in RestroLab and gives it to you once. They sign in to RestroLab with their own login, which you never see.
  • Your platform uses that credential on every call described on this site. Your platform never logs into RestroLab directly.

1. Get API credentials from the tenant owner

Section titled “1. Get API credentials from the tenant owner”

Credentials are created by the tenant owner, not by you. The owner:

  1. Logs into RestroLab with their own login and generates a credential .
  2. Receives an api_key and api_secret, shown exactly once.
  3. Pastes those two values into your platform’s own settings/integration page.

From here on, your platform only calls the partner-facing endpoints below using the api_key / api_secret the owner gave you.

Store the credential in environment variables. Never hardcode it or commit it to version control.

Terminal window
# .env (never commit this file)
RESTROLAB_API_KEY=the_api_key_the_owner_gave_you
RESTROLAB_API_SECRET=the_api_secret_the_owner_gave_you
Terminal window
export RESTROLAB_API_KEY="the_api_key_the_owner_gave_you"
export RESTROLAB_API_SECRET="the_api_secret_the_owner_gave_you"
const apiKey = process.env.RESTROLAB_API_KEY;
const apiSecret = process.env.RESTROLAB_API_SECRET;
import os
api_key = os.environ["RESTROLAB_API_KEY"]
api_secret = os.environ["RESTROLAB_API_SECRET"]

Call GET /v1/restrolab/ping/ first. It confirms your key and secret work before you build anything else:

Terminal window
curl https://api.restrolab.com/v1/restrolab/ping/ \
-H "Restro-API-Key: $RESTROLAB_API_KEY" \
-H "Restro-API-Secret: $RESTROLAB_API_SECRET"
{
"connected": true,
"credential_label": "My Delivery Platform",
"tenant": "Hillside Restaurant"
}

tenant tells you which organization this credential belongs to. A 401 means the key or secret is wrong, or the credential has been revoked.

List the organization’s dish. The organization is resolved entirely from your credential, so you never send a tenant_id, restaurant_id, or hotel_id.

Terminal window
curl https://api.restrolab.com/v1/restro/dishes/ \
-H "Restro-API-Key: $RESTROLAB_API_KEY" \
-H "Restro-API-Secret: $RESTROLAB_API_SECRET"
const response = await fetch('https://api.restrolab.com/v1/restro/dishes/', {
headers: {
'Restro-API-Key': apiKey,
'Restro-API-Secret': apiSecret,
},
});
const dishes = await response.json();
console.log(dishes);
import requests
response = requests.get(
"https://api.restrolab.com/v1/restro/dishes/",
headers={"Restro-API-Key": api_key, "Restro-API-Secret": api_secret},
)
response.raise_for_status()
print(response.json())

GET /v1/restro/dishes/ returns a JSON array of every active dish, sorted by name (see Pagination). When you place an order, send each dish’s sku as item_id:

[
{
"id": "b3f1e2c0-9d3e-4a2b-8f1a-1234567890ab",
"name": "Margherita Pizza",
"sku": "PIZZA-MARG-01",
"price": "9.99",
"currency": "USD",
"is_active": true
}
]

See Your First Request for the full field list.

Once your first request works, open the interactive API Reference. It’s generated from openapi.json and covers every endpoint (Restro menu and orders; Hotel rooms, availability, and reservations; webhooks), parameter, and schema.