Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

[External] Tablecheck API

API from Tablecheck

Api Host : https://api.tablecheck.com/api/

Headers:

      {
        'Cache-Control' => 'no-cache',
        'Authorization' => 'TABLECHECK_AUTH_ID', -> make sure the authorization is string
        'Content-Type' => 'application/json',
      }

Setup Tablecheck Restaurant:

need following information to setup restaurant.

  •   *   Shop ID (string)
    
    • Shop Slug (string)
    • Start Time Interval (minutes)

Accepted Reservation Status List :

  • accepted ➝ we will update the datetime, pax,adult, kids or status of the reservation

  • confirmed ➝ we will update the datetime, pax, adult, kids or status of the reservation

  • waiting ➝ we will update the datetime, pax,adult, kids or status of the reservation

  • waitlist_called ➝ we will update the datetime, pax,adult, kids or status of the

  • pending ➝ we will update the datetime, pax,adult, kids or status of the

  • attended ➝ we will mark the reservation as arrived

  • noshow ➝ we will mark the reservation as no show

  • cancelled ➝ we will cancel the reservation

  • rejected ➝ we will cancel the reservation

  • tentative ➝ we will cancel the reservation

API EndpointHTTP MethodDescriptionUse Authorization HeaderRequest ParametersResponse Attributes UsedError Response
directory/v1/shops/{shop_id}GETget shop information for validation of shop_id and shop_slugYESshop_id (on url path)response code 200
{
"shop": {
"id": "64f599779de586000a3c378b",
"slug": "api-test-hungryhub-1",
}
}
response code 404
Body:
{
"errors": [
{
"message": "Venue not found."
}
]
}
booking/v1/blockages
POSTcreate blockage
(Block the date and time before the user completes the booking.)
YES{
"shop_id":"64f599779de586000a3c378b",
"start_at": "2024-10-03T10:00:00.000Z",
"pax": 2,
"expiry_ttl": 300
}

expiry_tll ➝ The time-to-live in seconds for the Blockage (from 59 to 86401).
save the blockage id
{
"blockage": {
"id": "66fd1601a70bc978ed0487fe"
}
}
response code 422
Body:
{
"errors": [
{
"message": "Could not create resource due to missing parameter."
}
]
}

response code 422 ➝ the start at is in the past
Body:
{
"errors": [
{
"message": "Selected time occurs in the past."
}
]
}


response code 422 ➝ wrong shop id
Body:
{
"errors": [
{
"message": "Venue not found."
}
]
}

response code 422 ➝ table is not available for that time
Body:
{
"errors": [
{
"message": "No tables are available for current selection."
}
]
}


booking/v1/blockages/{blockage_id}GETCheck for a blockage before making a reservation.YESblockage_id (on url path)check if its success to get the dataresponse code 400
Body:
{
"errors": [
{
"message": "Required parameter is missing."
}
]
}

response code 403
Body:
{
"errors": [
{
"message": "Your API key is invalid."
}
]
}


response code 404
Body:
{
"errors": [
{
"message": "Block not found."
}
]
}


response code 422
Body:
{
"errors": [
{
"message": "Could not create resource due to missing parameter."
}
]
}
booking/v1/blockages/{blockage_id}PUTUpdate the blockageYES{
"start_at": "2024-10-03T10:00:00.000Z",
"pax": 2,
"expiry_ttl": 300
}
expiry_tll ➝ The time-to-live in seconds for the Blockage (from 59 to 86401).
make sure to run the update before the blockage was expired
and check if its success

response code 400
Body:
{
"errors": [
{
"message": "Required parameter is missing."
}
]
}

response code 403
Body:
{
"errors": [
{
"message": "Your API key is invalid."
}
]
}


response code 404
Body:
{
"errors": [
{
"message": "Block not found."
}
]
}


response code 422
Body:
{
"errors": [
{
"message": "Could not create resource due to missing parameter."
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "Selected time occurs in the past."
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "No tables are available for current selection."
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "Block could not be updated"
}
]
}



booking/v1/reservationsPOSTCreate reservationYES{
"shop_id": "64f599779de586000a3c378b",
"blockage_id": "66fd26e2573c9ce1ffa4247c",
"pax_adult": 3,
"pax_child": 0,
"pax": 3,
"start_at": "2024-10-03T10:00:00.000Z",
"first_name": "string",
"last_name": "string",
"locale": "en",
"email": "user@example.com",
"phone": "+818012345678",
"memo2": "string",
"source": "string",
"channel": "string",
"purpose": "birthday",
"ref": "string"
}

> ref ➝ your reservation id
> purpose: birthday, date_anniversary, business, date, other
> memo2 accepts html tags \n for new line
save the reservation id data
{
"reservation": {
"id": "66fd270692d050cbd2a3daed"
}
}
response code 404
Body:
{
"errors": [
{
"message": "Block not found."
}
]
}


response code 422
Body:
{
"errors": [
{
"message": "Selected time occurs in the past."
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "No tables are available for current selection."
}
]
}


booking/v1/reservations/{tablecheck_reservation_id}GETGet detail reservationYEStablecheck_reservation_id (on url path)get the reservation data, used for validation before updating the status on
{
"reservation": {
"start_at": "2024-11-27T05:00:00.000Z",
"pax": 5,
"pax_adult": 5,
"pax_child": 0,
"status": "attended",
"cancel_reason": "Cancelled due to weather",
}
}
response code 422
Body:
{
"errors": [
{
"message": "Reservation not found."
}
]
}

booking/v1/reservations/{tablecheck_reservation_id}PUTUpdate reservationYEStablecheck_reservation_id (on url path)
ref ➝ your reservation id

{
"pax_adult": 3,
"pax_child": 0,
"pax": 3,
"start_at": "2024-10-03T10:00:00.000Z",
"memo2": "string",
"purpose": "birthday",
"ref": "string"
}
get the reservation id data, to update the reservation on your system
{
"reservation": {
"id": "66fd270692d050cbd2a3daed"
}
}


response code 422
Body:
{
"errors": [
{
"message": "Selected time occurs in the past."
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "Reservation not found."
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "No tables are available for current selection."
}
]
}



booking/v1/reservations/{tablecheck_reservation_id}/cancelPUTCancel the reservationYEStablecheck_reservation_id (on url path)

{
"cancel_reason": "Cancelled reason"
}
check if its success and run the code to cancel the reservation on your systemresponse code 422
Body:
{
"errors": [
{
"message": "Reservation could not be updated"
}
]
}

response code 422
Body:
{
"errors": [
{
"message": "Reservation not found."
}
]
}

availability/v1/timetable/{shop_id}GETFetch available timeslots for a restaurant within a specified date range. Returns datetime strings for available booking slots.
The API has a 7-day limit per request
YESshop_id (on url path)
date_min (query param) - Start date in YYYY-MM-DD format
date_max (query param) - End date in YYYY-MM-DD format
pax (query param) - Party size for availability check
Response code 200
{
"timetable": {
"availability": [
"2024-10-03T10:00:00.000Z",
"2024-10-03T10:30:00.000Z",
"2024-10-03T11:00:00.000Z"
]
}
}
Response code 429

{
"errors": [
{
"message": "Too many requests, please try again later."
}
]
}

Response code 4xx/5xx (Non-200)

{
"errors": [
{
"message": "Venue not found."
}
]
}

API Callback from Hungryhub

API Host: https://api.hh-venus.my.id/webhooks

Headers:

      {
        'Authorization' => 'Bearer access token', -> get the access token first on oauth2_tablecheck
        'Content-Type' => 'application/json',
      }

Notes:

Please send callback /vendors/tablecheck_callback whenever you have status, pax, adult, kids, datetime updated.

API EndpointHTTP MethodDescriptionUse Authorization HeaderRequest ParametersResponse
https://api.hh-venus.my.id/webhooks/vendors/oauth2_tablecheckPOSTGet the access tokenNOUse Query Params or Body

{
"client_id":"yHhJTXukkrfzIzck4RsJSpRA3sCP6MiXvTWDj7OwAt4",
"client_secret": "YGr9u3EV8Lo2Ly8VTDI6UebeKW0rM2X-MNJ9aIp6t3U"
}
{
"token_type": "Bearer",
"scope": "default",
"created_at": 1730271750,
"access_token": "-Cqm4uMQfFfKgudVsuTVsYj-xxxxxx",
"expires_at": 1761828702,
"refresh_token": "a474e765ca106e9246c7e2ad70997xxxxxxx"
}
https://api.hh-venus.my.id/webhooks/vendors/tablecheck_callback
POSTTablecheck should hit this API when they update their booking information. This API will triger the HH worker to update the booking data as well.YES
Use Query Params or Body

syncable_type value always reservation,
syncable_id is tablecheck reservation id
{
"syncable_type" : "reservation",
"syncable_id" : 123444
}
{
"success": true,
"message": null
}