Una API REST documentada, webhooks firmados y un sandbox gratuito. Conecta una web, una pantalla de cocina, un CRM o una herramienta de contabilidad a cualquier restaurante de BookNDish, con el permiso del propietario.
La referencia de la API que aparece abajo está escrita en inglés.
Inicio rápido
01
Obtén un token
El propietario del restaurante o un encargado abre Ajustes, luego Desarrolladores, y crea un token con los permisos que necesita tu integración, o un token de sandbox para empezar con datos de ejemplo. Un token pertenece a un solo restaurante y se muestra una vez.
02
Llama a la API
Envía el token como token Bearer. Cada respuesta es JSON con data, meta y links.
03
Escribe con seguridad
Da a cada POST un Idempotency-Key. Un reintento con la misma clave recibe la primera respuesta y nada se ejecuta dos veces.
meta.now says what menus by time of day and happy hours make of the menu right now, on the default branch's clock: whether it and each category are open, and each dish or size a happy hour has cut, at the price charged now.
name and description are a string in the restaurant's default language, or a translation map. A dish is priced by price_minor, or per size by variants.
Only the fields sent change; variants and modifier groups are kept. A price change is recorded in the activity log. A dish priced per size refuses price_minor.
The order is priced from the menu (any price in the body is ignored), the owner's ordering rules apply (types offered, minimum order, delivery zones, opening hours; an order outside hours is held for the next opening), the kitchen gets its tickets and a connected POS gets the order. Dine-in orders need table_code.
placed to accepted or rejected, accepted to ready, ready to completed, and anything not finished to cancelled. Accepting fires the kitchen. A cancel with a reason (3 to 200 characters) also voids the kitchen tickets and keeps the reason.
Guest profiles, with contact details only for guests who agreed to share them.
GET/guests
Guest profiles, a page at a time
Guests who asked to be forgotten never appear. Phone and email are included only for guests who agreed to hear from the restaurant. Staff notes are never included.
Apps from the marketplace: a venue owner allows an app on the consent screen, and the app exchanges the code for an access token (used as the bearer token of every operation above) and a refresh token. Authorization code with PKCE (S256).
POST/oauth/token
Exchange a code, or refresh, for tokens
authorization_code: redeem the code the venue's consent sent to your redirect address, with the PKCE verifier. refresh_token: get a new access token and a new refresh token; the old pair stops working. Authenticate with your client id and secret, as HTTP Basic or as client_id and client_secret in the body. Answers are never cached.
Gives back a refresh token (with its access token) or an access token (RFC 7009). An unknown token is not an error. Authenticate with your client id and secret, as HTTP Basic or as client_id and client_secret in the body. To end the whole grant, the venue uninstalls the app.
Añade una dirección https en Ajustes, luego Desarrolladores, y elige sus eventos. Cada envío es un POST firmado: responde con cualquier 2xx en menos de 10 segundos. Un fallo se reintenta tras 1 minuto, 5 minutos, 30 minutos, 2 horas y 6 horas, y el registro de envíos puede reenviarlo.
Eventos
order.created
Se hace un pedido por cualquier canal.
order.status_changed
Un pedido pasa a otro estado.
order.paid
Los pagos cubren el pedido.
reservation.created
Se hace una reserva, por el cliente o por el personal.
reservation.updated
Cambia una reserva.
reservation.cancelled
Se cancela una reserva.
menu.item_updated
Cambia un plato: precio, nombre, agotado.
payment.refunded
Se reembolsa un pago.
guest.created
Se crea un perfil de cliente.
guest.updated
Cambian los datos o el consentimiento de un cliente, o se borra al cliente.
giftcard.issued
Se vende o se emite una tarjeta regalo.
giftcard.redeemed
Una tarjeta regalo paga un pedido.
review.created
Un cliente envía una valoración.
stock.below_par
Un ingrediente baja de su nivel mínimo en un local.
shift.published
Un encargado publica una semana de turnos.
experience.booked
Se pagan las entradas de una experiencia.
Verifica la firma
BookNDish-Signature lleva t, una hora Unix, y v1, el HMAC-SHA256 hexadecimal de t, un punto y el cuerpo sin procesar, con tu secreto de firma como clave. Compara en tiempo constante y rechaza un t de más de cinco minutos.
Un sandbox es un local de ejemplo propio, con carta, mesas, clientes, una reserva y un pedido, detrás de un token con todos los permisos. Responde en la misma dirección con una cabecera BookNDish-Sandbox, nunca toca el restaurante real y vuelve a sus datos de ejemplo cada noche.
Crea uno en Ajustes, luego Desarrolladores, luego Sandbox. Su token empieza por bnd_sbx_.
Límites y errores
Cada token puede hacer 60 solicitudes por minuto por defecto. Cada respuesta incluye X-RateLimit-Remaining, y un 429 incluye Retry-After.
Un fallo responde con error.code, error.message y error.details. Un token solo ve su propio restaurante: cualquier otra cosa es un 404.
v1 solo crece: nuevos endpoints, campos opcionales y eventos. Un cambio que rompería a un cliente va a v2, y v1 se mantiene a su lado.