{"openapi":"3.0.3","info":{"title":"RestoFleet Open API","version":"1.0.0","description":"Let your website, app or AI assistant show your menu, check free tables and book them. Create keys in RestoFleet under Setup → API keys. Prices are in paise (₹1 = 100).","contact":{"name":"RestoFleet developers","url":"https://developers.restofleet.com"}},"servers":[{"url":"https://api.restofleet.com/api/v1","description":"Production"}],"security":[{"apiKey":[]}],"tags":[{"name":"Restaurant","description":"Branches, hours and menu."},{"name":"Bookings","description":"Free times and table reservations."},{"name":"Guests","description":"Loyalty look-up (secret keys only)."}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Secret keys (`rf_sk_…`) belong on your server. Publishable keys (`rf_pk_…`) may be used in web pages, only from the websites listed on the key. `X-API-Key` works too."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}},"Reservation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["booked","confirmed","seated","completed","cancelled","no_show"]},"branch":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}}},"name":{"type":"string"},"partySize":{"type":"integer"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"source":{"type":"string"}}}},"x-scopes":[{"key":"brand:read","label":"Restaurant & branches","description":"Name, branches, address, phone and opening hours.","publishable":true},{"key":"menu:read","label":"Menu","description":"Categories, dishes, prices and what is available now.","publishable":true},{"key":"availability:read","label":"Table availability","description":"Free booking times for a date and party size.","publishable":true},{"key":"reservations:write","label":"Book tables","description":"Create bookings (and cancel them with a secret key).","publishable":true},{"key":"reservations:read","label":"Read bookings","description":"Look up a booking by its id.","publishable":false},{"key":"guests:read","label":"Guest loyalty","description":"Find a guest by phone: name, visits and points.","publishable":false}]},"paths":{"/open/restaurant":{"get":{"tags":["Restaurant"],"operationId":"getRestaurant","summary":"Restaurant and branches","description":"Scope `brand:read`. Branches the key may use, with hours and whether they take online bookings.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"branches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"address":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"timezone":{"type":"string","example":"Asia/Kolkata"},"opensAt":{"type":"string","example":"11:00"},"closesAt":{"type":"string","example":"23:00"},"onlineBooking":{"type":"boolean"},"maxPartySize":{"type":"integer"}}}}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests"}}}},"/open/branches/{branchId}/menu":{"get":{"tags":["Restaurant"],"operationId":"getMenu","summary":"Menu of a branch","description":"Scope `menu:read`. Branch prices (paise), stock-outs (`available`), sizes and choices.","parameters":[{"name":"branchId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"From `GET /restaurant`."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object"}}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests"}}}},"/open/branches/{branchId}/availability":{"get":{"tags":["Bookings"],"operationId":"getAvailability","summary":"Free booking times","description":"Scope `availability:read`. Every 30 minutes within opening hours, whether a table for the party is free for 90 minutes.","parameters":[{"name":"branchId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"From `GET /restaurant`."},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Local date at the branch, YYYY-MM-DD."},"description":"Local date at the branch, YYYY-MM-DD."},{"name":"partySize","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":50,"description":"Number of guests."},"description":"Number of guests."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"date":{"type":"string"},"partySize":{"type":"integer"},"durationMinutes":{"type":"integer"},"slots":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string","example":"7:30 pm"},"startsAt":{"type":"string","format":"date-time"},"available":{"type":"boolean"}}}}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests"}}}},"/open/branches/{branchId}/reservations":{"post":{"tags":["Bookings"],"operationId":"bookTable","summary":"Book a table","description":"Scope `reservations:write`. Picks the best free table. Fails with `SLOT_FULL` (409) if the time was just taken, `PARTY_TOO_LARGE` or `ONLINE_BOOKING_OFF`. The guest gets a confirmation through the brand’s connected SMS/WhatsApp/e-mail.","parameters":[{"name":"branchId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"From `GET /restaurant`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Guest's name."},"phone":{"type":"string","minLength":8,"maxLength":20,"description":"Mobile number; Indian numbers may omit +91."},"email":{"description":"For the confirmation e-mail.","nullable":true,"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"partySize":{"type":"integer","minimum":1,"maximum":50},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"One of the `startsAt` values from availability."},"notes":{"description":"Allergies, occasion, seating wishes.","nullable":true,"type":"string","maxLength":300},"source":{"description":"Where the booking came from, for reports.","type":"string","enum":["online","app","ai"]}},"required":["name","phone","partySize","startsAt"]}}}},"responses":{"201":{"description":"Booked","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["booked","confirmed","seated","completed","cancelled","no_show"]},"branch":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}}},"name":{"type":"string"},"partySize":{"type":"integer"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"source":{"type":"string"}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"409":{"description":"Time no longer free (`SLOT_FULL`)"},"429":{"description":"Too many requests"}}}},"/open/reservations/{reservationId}":{"get":{"tags":["Bookings"],"operationId":"getReservation","summary":"Look up a booking","description":"Scope `reservations:read`, secret keys only.","parameters":[{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["booked","confirmed","seated","completed","cancelled","no_show"]},"branch":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}}},"name":{"type":"string"},"partySize":{"type":"integer"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"source":{"type":"string"}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests"}}}},"/open/reservations/{reservationId}/cancel":{"post":{"tags":["Bookings"],"operationId":"cancelReservation","summary":"Cancel a booking","description":"Scope `reservations:write`, secret keys only. Only upcoming bookings can be cancelled.","parameters":[{"name":"reservationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["booked","confirmed","seated","completed","cancelled","no_show"]},"branch":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}}},"name":{"type":"string"},"partySize":{"type":"integer"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"source":{"type":"string"}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"429":{"description":"Too many requests"}}}},"/open/guests":{"get":{"tags":["Guests"],"operationId":"findGuest","summary":"Guest loyalty by phone","description":"Scope `guests:read`, secret keys only.","parameters":[{"name":"phone","in":"query","required":true,"schema":{"type":"string","minLength":8,"maxLength":20}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"phone":{"type":"string"},"name":{"type":"string","nullable":true},"points":{"type":"integer"},"visits":{"type":"integer"},"lastVisitAt":{"type":"string","nullable":true}}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"401":{"description":"Missing or invalid API key (`API_KEY_INVALID`)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"403":{"description":"Scope missing, wrong key type or website, or branch not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"SLOT_FULL"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}}},"404":{"description":"No guest with that number (`GUEST_NOT_FOUND`)"},"429":{"description":"Too many requests"}}}}}}