Flavoso APIGetting startedTest restaurant

Test restaurant

A free restaurant just for trying out the API, run from the console: order and book as a guest, respond as the restaurant, sync the menu and follow every event all the way to your app. It can never go live.

What a test restaurant is

A test restaurant is a restaurant on Flavoso that exists only for the API. It costs nothing, needs no subscription and is open around the clock out of the box. For the API it counts as the Pro plan: every route is open, reservations included.

Every account has at most one test restaurant, and all your apps share it. It comes with a sample menu of categories, dishes and an option group, plus tables. You run it from the console, under Test restaurant, in five tabs: Restaurant, Orders, Reservations, Menu and Events.

Create and use

  1. 1

    Create

    “Create test restaurant”: one click, and it is there. In the setup assistant this is the second step.

    Console › Test restaurant

  2. 2

    Connect your app

    With a test token or through the OAuth flow, choosing the test restaurant. Only then are events created: without a connected app holding the matching scope, nobody is listening.

  3. 3

    Try it out

    Order and book as a guest, respond as the restaurant: move orders along, pause, change the hours, mark dishes as sold out. Every change reaches your connected apps as an event.

    Console › Test restaurant

Like a real restaurant

To your app, the test restaurant behaves like a real one: the same routes, the same events, the same errors. Test orders and test reservations take the same path as a guest's, and moving an order along in the console does exactly what the kitchen does. Every change reaches your app as an event, by webhook or through GET /events. Three things are different:

  • livemode is false, in GET /me and in every event. A test restaurant can never go live.
  • Online payments are simulated: a test order you create as paid online triggers order.created and straight after it order.paid, with no payment provider and no money involved.
  • It keeps at most 50 images from image_url. Beyond that, PUT /menu downloads no more and warns with images_capped; resetting deletes them.

The tools

The test restaurant's tabs in the console do what guests, the kitchen, the front desk and the dashboard would otherwise do. They refresh by themselves as soon as something changes in the test restaurant, even when your app makes the change through the API.

ToolWhat it doesWhere
Test ordersRandom, several at once if you like, or put together as a guest would: dishes with options, pickup, delivery or at the table, now or pre-ordered, with a tip if you like. Triggers order.created.Console › Test restaurant › Orders
Paid online (simulated)An option when you put an order together: it counts as paid online straight away, with no payment provider and no money involved. Triggers order.created and straight after it order.paid.Console › Test restaurant › Orders
Test reservationA booking as if from a guest, at the chosen time or the next free one. Triggers reservation.created.Console › Test restaurant › Reservations
Move orders along and cancelLike the kitchen: accept, preparing, ready, completed. Triggers order.status_changed, a cancellation also order.cancelled.Console › Test restaurant › Orders
Reservations as the restaurantThe front desk's buttons: confirm, decline, arrived, left, no-show, cancel, delete, assign a table; plus cancel as the guest and bring forward to now. Triggers reservation.updated with changed. A reservation taken by phone or a walk-in triggers reservation.created.Console › Test restaurant › Reservations
StorePause online ordering (15 minutes to 3 hours, with a reason) and reopen, opening hours from three presets, close today or tomorrow, switch order types and pre-orders on and off. Triggers store.paused, store.resumed and store.updated with changed.Console › Test restaurant › Restaurant
Connections as the restaurantDisconnect an app as its owner would, or remove scopes from it. Triggers app.disconnected with the reason owner, or app.scopes_changed.Console › Test restaurant › Restaurant
MenuThe menu as GET /menu shows it to an app, with its ids. Mark dishes and options as sold out and offer them again, change prices. Triggers menu.product.updated and menu.option.updated. Plus everything for the sync.Console › Test restaurant › Menu
EventsThe latest 30 events, and per app what its webhook did with them and whether it fetched them. See Following events.Console › Test restaurant › Events
ResetDeletes orders and reservations and restores the sample menu and the settings. Tables and connections stay. See Reset.Console › Test restaurant › Restaurant
DeleteDeletes the test restaurant with everything in it; your apps' test tokens stop working. You can create a new one at any time.Console › Test restaurant › Restaurant
Create test tokenAccess and refresh token for the test restaurant, without the OAuth flow: the access token is valid for one hour, the refresh token for 180 days; the console shows both exactly once. If you removed scopes from the app as the restaurant, the connection gets them back, reported with app.scopes_changed.Console › App › Credentials
API explorerTry any operation against the test restaurant, with request and response. The example bodies use ids and times from your test restaurant, such as the next free time for POST /reservations.Console › App › API explorer
Request logEvery request your app makes; for the test restaurant, with request and response bodies.Console › App › Logs
“Send a test event” and “Resend”Send an event of any type to your webhook, with data from the test restaurant; repeat a delivery. Together at most 10 times per minute and app.Console › App › Webhooks

More about your app's tools under Tools.

Following events

The Events tab shows the latest 30 events of the test restaurant. For every connected app it shows what its webhook did with them (delivered, waiting for the next attempt, failed or skipped, with the reason) and whether the app has fetched them through GET /events.

  • Envelope: a row expands and shows the event exactly as the chosen app receives it.
  • Resend: send a delivery once more, with the same event id.
  • Send to webhook: send an event without a delivery to an app's webhook, for example one from before the webhook was set up or of a type it has not subscribed to.
  • Fetch from here: copy the GET /events call whose response starts with exactly this event.

Sending is limited to ten per minute and app, together with “Resend” and “Send a test event” under Webhooks. Test events and ping never appear in GET /events; the tab says so where it applies.

Reset

“Reset test restaurant” deletes all orders and reservations, recreates the sample menu, ends a pause, removes special days and sets opening hours, order types, lead times, pre-orders, minimum order, tipping, delivery zone and reservations as they were at creation. Images downloaded from image_url are deleted. Tables and connections stay.

  • The menu reports the same events as with “Reset menu”: every deleted object with menu.*.deleted, every new one with menu.*.created. A POS that mirrors the menu sees that the dishes with its ids are gone.
  • If hours, special days, lead times, order types, pre-orders or the minimum order change, store.updated arrives, and store.resumed if a pause was running.
  • Deleted orders and reservations report nothing.

You can reset at most five times in ten minutes, “Reset menu” included.

Telling test and live apart

livemode is in GET /me and in every event. In the test restaurant it is false, in every real restaurant true. Check it wherever your app does something real: a test order must never end up in a real till.

// Test and live share one API, one address and one token format. livemode tells them apart.
const me = await fetch("https://api.flavoso.com/v1/me", {
  headers: { Authorization: `Bearer ${accessToken}` },
}).then((r) => r.json());
if (!me.livemode) console.log(`Connected to the test restaurant "${me.tenant.name}"`);

// In the webhook handler: never book a test order into a real till
export function handleEvent(event) {
  if (!event.livemode) return handleTestEvent(event);
  return handleLiveEvent(event);
}

Testing with a real restaurant

Even before approval, your app also connects to restaurants you own yourself. This is meant for the last test with a real menu.

That is no longer a test: livemode is true, guests get messages, and a pause closes real online ordering.

Still unclear? Write to support@flavoso.com and include the id from X-Request-Id. It lets us find your request in the log.