NAV
shell

Introduction

Guestonline_api


The Guestonline API is organized around REST.
We use built-in HTTP features, like HTTP verbs, which can be understood by off-the-shelf HTTP clients, and we support cross-origin resource sharing to allow you to interact securely with our API from a client-side web application (though you should remember that you should never expose your secret API key in any public website’s client-side code)
JSON will be returned in all responses from the API, including errors.

To make the Guestonline API as explorable as possible , all examples are generated with an example token.

Authentication

To authorize, use this code:
With shell, you can just pass the correct header with each request
EXAMPLE REQUEST :

$ curl https://api.guestonline.fr/v1/ \
  -H "X-Token: your_token"

Make sure to replace your_token with your API key.
Your token will be provided by the team TableOnline.

You authenticate to the Guestonline API by providing your API keys in the request.
Your API key carry many privileges, so be sure to keep them secret!
You do not need to provide a password.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests.
Your token will be provided by the team TableOnline.

Errors

Guestonline uses conventional HTTP response codes to indicate success or failure of an API request.
In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information, and codes in the 5xx range indicate an error with Guestonline’s servers. Not all errors map cleanly onto HTTP response codes, however. When method is not allow, we return a 405 error code.

Attributes

Message type description
message present A human-readable message giving more details about the error
object optional describe class of object for request
code optional error code for this request
status optional html code response

HTTP Status Code Summary

Code State Description
200 OK Everything worked as expected
400 Bad Request Often missing a required parameter
401 Unauthorized No valid API key provided
402 Request Failed Parameters were valid but request failed
403 Forbidden Access forbidden
404 Not Found The requested item doesn’t exist
5XX Server errors Something went wrong on Guestonline’s end

Versionning

EXAMPLE REQUEST :

$ curl "https://api.guestonline.fr/v1"  \
-H "X-Token: 8xyDktY8QoUdHPVm3Z7H"

When we make backwards-incompatible changes to the API, we release new dated versions.
The current version is v1.

Pagination

EXAMPLE REQUEST :

$ curl -X GET "https://api.guestonline.fr/v1/contacts" \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d page=2 \
  -d max_results=1

Guestonline utilizes cursor-based pagination, using the parameter page and max_results.

Pagination Arguments

JSON RESPONSE :

  {
    "object":"list",
    "total_count":624,
    "num_pages":624,
    "current_page":2,
    "contacts":
    [
      {
      "object":"contact",
      "id":33173,
      "lastname":"Cabarrou",
      "firstname":"Céline",
      "email":"boute65@guestonline.zaza",
      "birthday":null,
      "gender":null,
      "fixed_phone":"33678027666",
      "mobile_phone":"33678027666",
      "address":"",
      "extra_address":"",
      "postcode":"",
      "city":"",
      "company":null,
      "country":"",
      "accept_email_spam":true,
      "accept_sms_spam":true,
      "note":"Autrgfjghcgjf",
      "warning":false,
      "accept_partners_spam":false,
      "bookings_count":20,
      "last_booking_date":"2014-02-26",
      "country_code":null,
      "status":"valid",
      "restaurant_id":479
      }
    ]
  }
key Constraints Default Description
page 1 to … 1 page that you want
max_results 1 to 100 40 maximum instances of object per page

Expanding

EXAMPLE REQUEST :

$ curl -X GET "http://api.guestonline.fr/v1/bookings/38765" \
 -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
 -d "expands[]=contact"

JSON RESPONSE :

{
  "object":"booking",
  "id":38765,
  "booking_state":"validated",
  "booked_persons_number":2,
  "present_persons_number":2,
  "cancel_actor":null,
  "cancel_reason":"",
  "booking_type":"restaurant",
  "note":"Terrasse",
  "period":"lunch",
  "booking_date":"2014-10-10",
  "booking_time":"2014-10-10T12:30:00+02:00",
  "email":"duhar.laurent@guestonline.fr",
  "bookings_count":1,
  "firstname":"Laurent",
  "lastname":"Duhar",
  "entity_type":"bookings",
  "contact_id":33454,
  "contact":
  {
    "object":"contact",
    "id":33454,
    "lastname":"Duhar",
    "firstname":"Laurent",
    "email":"duhar.laurent@guestonline.fr",
    "birthday":"1981-02-08",
    "gender":null,
    "fixed_phone":"33622093666",
    "mobile_phone":"33622093666",
    "address":"",
    "extra_address":"",
    "postcode":"",
    "city":"",
    "company":null,
    "country":"",
    "accept_email_spam":true,
    "accept_sms_spam":true,
    "note":"",
    "warning":false,
    "accept_partners_spam":false,
    "bookings_count":1,
    "last_booking_date":"2013-10-31",
    "country_code":null,
    "status":"valid",
    "restaurant_id":479
  }
}

Many objects contain the id of another object in their response properties.
Those objects can be expanded inline with the expand request parameter.
Objects that can be expanded are noted in this documentation.

This parameter is available for some API requests, and applies to the response of that request only.
You can expand multiple things at once by sending an array.

Booking can be expand with mutiple informations :

Key Description
contact This parameter is used to retrieve the contact that is associated with the booking
tables This parameter is used to retrieve the tables that are associated with the booking
table_occupation This parameter is used to retrieve the occupations of tables that are associated with the booking
booking_messages This parameter allows you to retrieve messages that are associated with the booking
booking_info This parameter allows you to retrieve extra information associated with the booking

Restaurant can be expand with :

Key Description
first_bookable_hours This parameter allows you to retrieve array of bookable hours for the first bookable service

Period can be expand with :

Key Description
bookings_detail This parameter allows you to retrieve messages set on restaurant or service

Metadata

EXAMPLE REQUEST :

$ curl -X POST https://api.guestonline.fr/bookings \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "metadata={key: value}"

JSON RESPONSE :

{
  "object":"booking",
  "id":38765,
  "booking_state":"validated",
  "booked_persons_number":2,
  "present_persons_number":2,
  "cancel_actor":null,
  "cancel_reason":"",
  "booking_type":"restaurant",
  "note":"Terrasse",
  "period":"lunch",
  "booking_date":"2014-10-10",
  "booking_time":"2014-10-10T12:30:00+02:00",
  "email":"duhar.laurent@guestonline.fr",
  "bookings_count":1,
  "firstname":"Laurent",
  "lastname":"Duhar",
  "entity_type":"bookings",
  "contact_id":33454, 
  "metadata":
  {
    "key":value
  }
}

Guestonline API allows you to record information on our objects using the metadata parameter.
You can use the metadata parameter to attach key-value data.
This is useful for storing additional structured information about an object.
Metadata you specify is returned in API responses.

Restaurants

The Restaurant object


JSON Example :

{
  "object": "restaurant",
  "id": 1,
  "name": "Wasabi",
  "address": "2, Av de lombez",
  "city": "Toulouse",
  "postcode": "31300",
  "phone": "335612555555",
  "country_code": "FR",
  "capacity": 50,
  "created_at": "2014-02-11T07:54:08+01:00",
  "updated_at": "2014-11-24T09:11:23+01:00"
}
Key Type Description
id Int Restaurant id
name String Restaurant name
address String Restaurant address
city String Restaurant city
postcode String Restaurant post code
country String Restaurant country
phone String Restaurant phone
country_code String Restaurant country_code
created_at Datetime Restaurant creation datetime
update_at Datetime Last update

List managed restaurants

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/restaurants"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \

JSON RESPONSE :

{
    "object": "list",
    "total_count": 20,
    "num_pages": 2,
    "current_page": 1,
    "restaurants": [
      {
        "object": "restaurant",
        "id": 1,
        "name": "Wasabi",
        "address": "2, Av de lombez",
        "city": "Toulouse",
        "postcode": "31300",
        "phone": "335612555555",
        "country_code": "FR",
        "capacity": 50,
        "created_at": "2014-02-11T07:54:08+01:00",
        "updated_at": "2014-11-24T09:11:23+01:00"
      },
      {...}
      ]
}

GuestOnline Api provides a way to retrieve the list of restaurant managed

Arguments

No argument is required. Pagination is supported for this query (see

Parameter Status Description
date Mandatory you must provide it .

List restaurants available for booking

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/restaurants/bookable"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "date=2015-01-27" \
  -d "persons_number=3" \
  -d "period=lunch" \
  -d "expands[]"="first_bookable_hours"

JSON RESPONSE :

{
    "object": "list",
    "total_count": 2,
    "num_pages": 1,
    "current_page": 1,
    "restaurants": [
      {
        "object": "restaurant",
        "id": 1,
        "first_bookable_hours": 
        [
          {
              "object": "hour",
              "time": "12:00"
          },
          {...},
          ...
        ]
      },
      {...}
      ]
}

GuestOnline Api provides a way to get the restaurants available for booking

Arguments

Arguments Status Description
date Mandatory booking date
persons_number Mandatory number of people
restaurant_ids Optional Array of restaurant ids. Leave empty to check all authorized restaurants
period Optional period of the booking [lunch, afternoon, dinner…]
expands Optional This parameter is optional see Expanding

Returns

Returns a paginated list of restaurants available for this booking

Periods

The period object


JSON Example :

{
  "object": "period",
  "restaurant_id": 479,
  "restaurant_name": "wasabi",
  "period": "lunch",
  "date": "2014-11-06",
  "persons": 2,
  "total_left_seats": 25,
  "hours": 
    [
      {
          "object": "hour",
          "time": "12:00"
      },
      {...},
      ...
    ]  
  "bookings_details": 
    [
      {
          "object": "bookings_detail",
          "note": {
              "en": "please check the menu",
              "fr": "..."
            }
      },
      {...},
      ...
    ]  
}

Key Type Description
restaurant_id Int restaurant id
restaurant_name String restaurant name
period Enumerate [lunch, dinner, afternoon, breakfast]
date Date Date
persons Int persons number requested
total_left_seats Int total number of seats available on the period
hours Array Array of hour objects
bookings_detail Array Array of booking_detail objects

The hour object

Key Type Description
time String format hh:mm (h=hour, m = minute)

The BookingDetail object


JSON Example :

{
  "object": "bookings_detail",
  "note": {
      "en": "please check the menu",
      "fr": "..."
    }
}

Key Type Description
note Hash key: locale, value: message

List periods with params

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/periods"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H"
  -d date=2014-11-6
  -d persons=2
  -d period=lunch
  -d "expands[]=bookings_detail"

JSON RESPONSE :

{
  "object": "list",
  "periods": 
    [
      {
        "object": "offer",
        "id": 162,
        "name": "a name",
        "description": "My period",
        "start_date": "2014-11-06",
        "end_date": "2014-11-06",
        "permanent": false,
        "bookable": false,
        "minimum_dishes": 1,
        "maximum_dishes": null,
        "restaurant_id": 479
      },
      {...},
      ...
    ]
}

JSON RESPONSE WHEN NO PERIODS FOUND:

{
  "object": "list",
  "periods": [],
  "next_available_date": '2014-11-07'
}

Guestonline Api provide a way to retrieve list of periods.
All those parameters used to refine your search.

Arguments

Key Status Description warning
date Mandatory Date for request
persons Mandatory persons number for request
restaurant_id Dependant This parameter is optional if your token manage a single restaurant. In case, this token can manage more than one restaurant you must provide it .
period Optional use to filter to a specifi period period must be in [lunch, dinner, afternoon, breakfast]
expands Optional This parameter is optional see Expanding

RuntimeService

The runtime service object


JSON Example :

{
  "object": "runtime_service",
  "id": "54525943f5cb5c39aa000741",
  "left_seats": 47,
  "min_persons": 1,
  "max_persons": 25,
  "last_booking": "2014-11-27T10:00:00+02:00",
  "start_time": "12:00",
  "end_time": "14:00",
  "date": "2014-11-27",
  "restaurant_id": 479,
  "parent_id": "53f438c9f5cb5c1411000467"
}
Key Type Description
id Int runtime_service id
date Date date of this runtime_service
left_seats Int seats available for this runtime_service
closed Boolean true if service is closed else false
min_persons Int Minimum person for online booking
max_persons Int Maximum person for online booking
last_booking date time after witch online booking is impossible
start_time Date start time of runtime_service
end_time Date end time of commeruntime_servicercial
restaurant_id Int restaurant id
parent_id Int runtime_opening id

List runtime_services with params

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/runtime_services"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "date=2014-11-27" \

JSON RESPONSE :

{
  "object": "list",
  "runtime_services": [
    {
      "object": "runtime_service",
      "id": "54525943f5cb5c39aa000741",
      "left_seats": 47,
      "min_persons": 1,
      "max_persons": 25,
      "last_booking": "2014-11-27T10:00:00+02:00",
      "start_time": "12:00",
      "end_time": "14:00",
      "date": "2014-11-27",
      "restaurant_id": 479,
      "parent_id": "53f438c9f5cb5c1411000467"
    },
    {....}
  ]
}

GuestOnline Api provides a way to retrieve list of runtime services.

Arguments

Parameter Status Description
date Mandatory you must provide it .
restaurant_id Optional id of restaurant

Modify left_seats of a existing runtime_services

EXAMPLE REQUEST :

  $ curl -X PUT "https://api.guestonline.fr/v1/runtime_services"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "date=2014-11-27" \
  -d "id=54525943f5cb5c39aa000741" \
  -d "left_seats=14" \

JSON RESPONSE :

{
  "object": "runtime_service",
  "id": "54525943f5cb5c39aa000741",
  "left_seats": 14,
  "start_time": "12:00",
  "end_time": "14:00",
  "date": "2014-11-27",
  "restaurant_id": 479,
  "parent_id": "53f438c9f5cb5c1411000467"
}

GuestOnline Api provides a way to change the number of availables seats for a given runtime service.

Arguments

Arguments Status Description
date Mandatory service date
id Mandatory service id
left_seats Mandatory new left_seats number

Returns

Returns the modified runtime service object. “`

Close a runtime service

EXAMPLE REQUEST :

  $ curl -X PUT "https://api.guestonline.fr/v1/runtime_services/close"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "date=2014-11-27" \
  -d "id=54525943f5cb5c39aa000741" \

JSON RESPONSE :

{
  "object": "runtime_service",
  "id": "54525943f5cb5c39aa000741",
  "closed": true,
  "left_seats": 14,
  "start_time": "12:00",
  "end_time": "14:00",
  "date": "2014-11-27",
  "restaurant_id": 479,
  "parent_id": "53f438c9f5cb5c1411000467"
}

GuestOnline Api provides a way to close a runtime service, in order to prevent new bookings even if the seats are still available.

Arguments

Arguments Status Description
date Mandatory service date
id Mandatory service id

Returns

Returns the runtime service object. ”`

Open a runtime service

EXAMPLE REQUEST :

  $ curl -X PUT "https://api.guestonline.fr/v1/runtime_services/open"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "date=2014-11-27" \
  -d "id=54525943f5cb5c39aa000741" \

JSON RESPONSE :

{
  "object": "runtime_service",
  "id": "54525943f5cb5c39aa000741",
  "closed": false,
  "left_seats": 14,
  "start_time": "12:00",
  "end_time": "14:00",
  "date": "2014-11-27",
  "restaurant_id": 479,
  "parent_id": "53f438c9f5cb5c1411000467"
}

GuestOnline Api provides a way to open a runtime service.

Arguments

Arguments Status Description
date Mandatory service date
id Mandatory service id

Returns

Returns the runtime service object.

PendingBooking

The PendingBooking object


JSON Example :

{
  "object": "pending_booking",
  "id": "55cc4c049089c76870000001",
  "date": "2015-08-25",
  "hour": "13:30",
  "opening_id": "54e7809af5cb5c1dcb000ff5",
  "persons": 4,
  "restaurant_id": 479,
  "commitable": false,
  "metadata": nil,
  "contact_info": {
    "object": "contact_info",
    "firstname": null,
    "lastname": null,
    "email": null,
    "mobile_phone": null,
    "country_code": null
  },
  "available_commercials": [
    {
      "object": "offer",
      "id": 469,
      "name": "Test",
      "description": "tez ef dsf fefdf dfs",
      "start_date": "2015-08-22",
      "end_date": "2015-08-31",
      "permanent": false,
      "bookable": null,
      "minimum_dishes": 1,
      "maximum_dishes": null,
      "restaurant_id": 479,
      "has_prepayment": true
    }
  ],
    "bookings_detail": "Please make sure you inform us of any special dietary requirements when you make your reservation",
  "prepayment": null
}

A pending booking represents a booking during the reservation process. It holds the seats during the booking process. It allows to finalize the process (fillings contact fields or paiement). A pending booking is valid for a maximum of 7 minutes, since the creation or the last update. After this time it is destroyed and the seats are released.

In order to be transformed into a Booking, the PendingBooking must be committed. The commitable property shows if the PendingBooking is commitable or not.

Key Type Description
id String pending_booking id
date Date date of pending_booking
hour DateTime hour of pending_booking
persons Int persons of pending_booking
restaurant_id Int restaurant id
commitable Boolean true if pending booking can be saved as booking
contact_info ContactInfo contact info for pending_booking
available_commercials Commercial Commecials available for this pending_booking
prepayment Prepayment if pending_booking need prepayment
metadata Hash metadata added on pending booking creation

ContactInfo

Parameter Status Description
lastname String
firstname String
mobile_phone String
country_code String
email String

Prepayment

Parameter Status Description
kind String Kind of prepayment (by seats or booking)
amount Int in cents
stripe_key String stripe key to be able to create a stripe_token

create pending_booking

EXAMPLE REQUEST :

  $ curl -X POST "https://api.guestonline.fr/v1/pending_bookings"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "restaurant_id=479" \
  -d "date=2014-11-27" \
  -d "hour=13:30" \
  -d "persons=4" \
  -d "metadata[biz_metric1]=val1"
  -d "metadata[biz_metric2]=val2"

JSON RESPONSE :

{
  "object": "pending_booking",
  "id": "55cc4c049089c76870000001",
  "date": "2015-08-25",
  "hour": "13:30",
  "opening_id": "54e7809af5cb5c1dcb000ff5",
  "persons": 4,
  "restaurant_id": 479,
  "commitable": false,
  "contact_info": {
    "object": "contact_info",
    "firstname": null,
    "lastname": null,
    "email": null,
    "mobile_phone": null,
    "country_code": null
  },
  "available_commercials": [
    {
      "object": "offer",
      "id": 469,
      "name": "Special Offer",
      "description": "special offer for all our clients",
      "start_date": "2015-08-22",
      "end_date": "2015-08-31",
      "permanent": false,
      "bookable": null,
      "minimum_dishes": 1,
      "maximum_dishes": null,
      "restaurant_id": 479,
      "has_prepayment": true
    }
  ],
  "bookings_detail": "Please make sure you inform us of any special dietary requirements when you make your reservation",
  "prepayment": null,
  "metadata": {
    "biz_metric1"= "val1",
    "biz_metric2"= "val2"
  }
}

GuestOnline Api provides a way to create a pending booking.

Arguments

Parameter Status Description
date Mandatory you must provide it .
hour Mandatory you must provide it .
restaurant_id Mandatory you must provide it .
persons Mandatory you must provide it .
contact_info Optional you can provide it on creation .
metadata Optional hash of extra data to store

Update pending booking

EXAMPLE REQUEST :

  $ curl -X PUT "https://api.guestonline.fr/v1/pending_bookings/55cc4c049089c76870000001"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "selected_offer=469" \
  -d "contact_info[lastname]=Doe" \
  -d "contact_info[firstname]=John" \
  -d "contact_info[mobile_phone]=0692550398" \
  -d "contact_info[country_code]=FR" \
  -d "contact_info[email]=j.doe@example.com" \

JSON RESPONSE :

{
  "object": "pending_booking",
  "id": "55cc4ddf9089c76870000002",
  "date": "2015-08-25",
  "hour": "13:30",
  "opening_id": "54e7809af5cb5c1dcb000ff5",
  "persons": 4,
  "restaurant_id": 479,
  "commitable": true,
  "contact_info": {
    "object": "contact_info",
    "firstname": "John",
    "lastname": "Does",
    "email": "jdoe@example.com",
    "mobile_phone": "33692550398",
    "country_code": "FR"
  },
  "offer": {
    "object": "offer",
    "commercial_id": 469
  },
  "bookings_detail": "Please make sure you inform us of any special dietary requirements when you make your reservation",
  "prepayment": {
    "kind": "seats",
    "amount": 4000,
    "stripe_key": "pk_test_abs9s8CTCdDT2B7D8q9j5DAH"
  }
}

GuestOnline Api provides a way to add contact info on pending booking, as well to select an offer .

Arguments

Arguments Status Description
selected_offer Optional the selected offer id (from available_commercials)
contact_info Optional the contact_info to add or update in the pending_booking

ContactInfo to provide if not provided at creation

Parameter Status Description
contact_info[lastname] Mandatory you must provide it .
contact_info[firstname] Mandatory you must provide it .
contact_info[mobile_phone] Mandatory you must provide it .
contact_info[country_code] Mandatory you must provide it .
contact_info[email] Mandatory you must provide it .
contact_info[message] Optionnal Message for the restaurant

Returns

Returns the modify pending_booking object, adding the Prepayment if needed (+ the stripe public key to allow you to use strip api for the payment) and the commercial_id of selected_offer.

Commit the pending_booking and create the booking

EXAMPLE REQUEST :

  $ curl -X PUT "https://api.guestonline.fr/v1/pending_bookings/55cc4c049089c76870000001/commit"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "stripe_token=tok_16YuLg4QnRLJ9Q2EYXevGsFv" \

JSON RESPONSE :

{
  "object": "booking",
  "id": 1094518,
  "booking_state": "validated",
  "booked_persons_number": 4,
  "present_persons_number": 4,
  "cancel_actor": null,
  "cancel_reason": null,
  "booking_type": "website",
  "note": null,
  "period": "lunch",
  "booking_date": "2015-08-25",
  "booking_time": "2015-08-25T13:30:00+02:00",
  "email": "j.doe@example.com",
  "firstname": "John",
  "lastname": "Doe",
  "entity_type": "bookings",
  "contact_id": 435833,
  "send_reminders": false,
  "user_locale": "fr",
  "metadata": null,
  "booking_token": "a-booking-token"
}

GuestOnline Api provides a way to create the booking from the pending_booking .

Arguments

Arguments Status Description
stripe_token Mandatory mandatory only if pending_booking has prepayment (https://stripe.com/docs/tutorials/forms), for you to generate using stripe key provided in the last response.

Returns

Returns the created booking.

Cancel the pending_booking

EXAMPLE REQUEST :

  $ curl -X DELETE "https://api.guestonline.fr/v1/pending_bookings/55cc4c049089c76870000001"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "stripe_token=tok_16YuLg4QnRLJ9Q2EYXevGsFv" \

JSON RESPONSE :

{
}

GuestOnline Api provides a way to cancel / destroy the pending booking to release the seats

Arguments

Arguments Status Description
ID Mandatory id of the pending booking

Returns

Returns the created booking.

Bookings

The booking object


JSON Example :

{
  "object": "bookings",
  "id": 577988,
  "booking_state": "validated",
  "booked_persons_number": 2,
  "present_persons_number": 2,
  "cancel_actor": null,
  "cancel_reason": null,
  "booking_type": "restaurant",
  "note": null,
  "period": "dinner",
  "booking_date": "2014-09-05",
  "booking_time": "2014-09-05T20:00:00+02:00",
  "email": "nelle@heller.uk",
  "firstname": "Mazie",
  "lastname": "Hegmann",
  "send_reminders": true,
  "user_locale": "Fr",
  "metadata": {
      "data1": "val",
      "data2": 3
   },
  "contact_id": 622360,
  "restaurant_id": 479
}
Key Type Description
id Int booking if
object String define type of object booking
booking_state String status of booking in [initialized, validated, canceled, fully_faked, partially_faked, honored]
booked_persons_number Int expected number people define with maximum 11 characters
present_persons_number Int number of people present define with maximum 11 characters
cancel_actor String cancel actor of booking in [commercial, restaurateur, user, admin]
cancel_reason Text cancel reason for booking define with maximum 65535 characters
booking_type String type of booking in [restaurant, tableonline, website, external, facebook, lafourchette]
note Text note of booking define with maximum 65535 characters
period String booking period in [breakfast, brunch, lunch, afternoon, dinner, no_service]
booking_date Date date of booking
booking_time Datetime time of booking
email String email of contact for booking define with maximum 300 characters
firstname String email of contact for booking define with maximum 50 characters
lastname Int email of contact for booking define with maximum 50 characters
send_reminders Bool true if reminders are sent ot customer
user_locale String Locale used or requested by the customer on booking creation
metadata Hash extra properties associated to the booking with the api
booking_token String token returned on booking creation. It can be requested for specific operation
contact_id Int id of contact for booking define with maximum 11 characters
restaurant_id Int restaurant id for booking define with maximum 11 characters

List bookings with params

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/bookings"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H"

JSON RESPONSE :

{
  "object":"list",
  "total_count":930,
  "num_pages":24,
  "current_page":1,
  "bookings":
  [
    {
      "object":"booking",
      "id":577988,
      "booking_state":"validated",
      "booked_persons_number":2,
      "present_persons_number":2,
      "cancel_actor":null,
      "cancel_reason":null,
      "booking_type":"restaurant",
      "note":null,
      "period":"dinner",
      "booking_date":"2014-09-05",
      "booking_time":"2014-09-05T20:00:00+02:00",
      "email":"nelle@heller.uk",
      "firstname":"Mazie",
      "lastname":"Hegmann",

      "contact_id":622360,
      "restaurant_id" => 479
    },
    {...},
    ...
  ]
}

Guestonline Api provide a way to retrieve list of bookings with severals arguments.
All those parameters used to refine your search.

Arguments

Parameter Staus Description
restaurant_id Dependant This parameter is optional if your token manage a single restaurant. In case, this token can manage more than one restaurant you must provide it .
period Optional period of booking
booking_state Optional booking state of booking
booking_date Optional booking date of booking

Retrieve an existing booking

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/bookings/577988"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" 

JSON RESPONSE :

{
  "object":"booking",
  "id":577988,
  "booking_state":"validated",
  "booked_persons_number":2,
  "present_persons_number":2,
  "cancel_actor":null,
  "cancel_reason":null,
  "booking_type":"restaurant",
  "note":null,
  "period":"dinner",
  "booking_date":"2014-09-05",
  "booking_time":"2014-09-05T20:00:00+02:00",
  "email":"nelle@heller.uk",
  "firstname":"Mazie",
  "lastname":"Hegmann",
  "contact_id":622360,
  "restaurant_id" => 479
}

You can also retrieve a specific booking from our id.

Arguments

Arguments Status Description
id Mandatory id of booking

Returns

Returns the booking object.

Creating a new booking with contact id

EXAMPLE REQUEST :

  $ curl -X POST "http://api.guestonline.fr/v1/bookings"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "booking[note]=my booking from api" \
  -d "booking[booking_time]=2014-11-06T20:00:00+02:00" \
  -d "booking[booking_date]=2014-11-06" \
  -d "booking[booked_persons_number]=15" \
  -d "booking[contact_id]=622360" \
  -d "booking[send_reminders]=true" \
  -d "booking[user_locale]=fr" \
  -d "booking[restaurant_id]=479"

JSON RESPONSE :

{
  "object":"booking",
  "id":577989,
  "booking_state":"initialized",
  "booked_persons_number":15,
  "present_persons_number":15,
  "cancel_actor":null,
  "cancel_reason":null,
  "booking_type":"restaurant",
  "note":"my booking from api",
  "period":"dinner",
  "booking_date":"2014-11-06",
  "booking_time":"2014-11-06T20:00:00+01:00",
  "email":"nelle@heller.uk",
  "firstname":"Mazie",
  "lastname":"Hegmann",
  "contact_id":622360,
  "restaurant_id": 479
}

All arguments define in booking parameter.

Arguments

Arguments Status Description
booking[booking_date] Mandatory booking date of booking
booking[booking_time] Mandatory booking time of booking
booking[booked_persons_number] Mandatory booked persons number of booking
booking[contact_id] Mandatory contact id of booking
booking[restaurant_id] Dependant id of the restaurant which is attached to the booking
booking[send_reminders] Optional send reminders of booking
booking[user_locale] Optional user locale of booking
booking[note] Optional note of booking

Returns

Returns the booking object.

Creating a new booking with new contact

EXAMPLE REQUEST :

  $ curl -X POST "http://api.guestonline.fr/v1/bookings"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "booking[note]=my booking from api" \
  -d "booking[booking_time]=2014-11-06T20:00:00+02:00" \
  -d "booking[booking_date]=2014-11-06" \
  -d "booking[booked_persons_number]=15" \
  -d "booking[send_reminders]=true" \
  -d "booking[user_locale]=fr" \
  -d "booking[restaurant_id]=479" \
  -d "booking[contact][lastname]=GuestOnline" \
  -d "booking[contact][firstname]=Api" \
  -d "booking[contact][email]=api@guestonline.fr" \
  -d "booking[contact][mobile_phone]=33612233445" \
  -d "booking[contact][accept_email_spam]=true" \
  -d "booking[contact][accept_sms_spam]=true" \
  -d "booking[contact][country_code]=fr"

JSON RESPONSE :

{
  "object":"booking",
  "id":577990,
  "booking_state":"initialized",
  "booked_persons_number":15,
  "present_persons_number":15,
  "cancel_actor":null,
  "cancel_reason":null,
  "booking_type":"restaurant",
  "note":"my booking from api",
  "period":"dinner",
  "booking_date":"2014-11-06",
  "booking_time":"2014-11-06T20:00:00+01:00",
  "email":"api@guestonline.fr",
  "firstname":"Api",
  "lastname":"GuestOnline",
  "contact_id":622361,
  "restaurant_id": 479
}

All arguments define in booking parameter.

Arguments for booking

Arguments Status Description
booking[booking_time] Mandatory booking time of booking
booking[booking_date] Mandatory booking date of booking
booking[booked_persons_number] Mandatory booked persons number of booking
booking[contact] Mandatory contact of booking
booking[restaurant_id] Dependant id of the restaurant which is attached to the booking
booking[note] Optional note of booking
booking[send_reminders] Optional send reminders of booking
booking[user_locale] Optional user locale of booking
You specify your new contact with following arguments:

Arguments for contact

Arguments Description Warning
contact[lastname] lastname of contact
contact[firstname] firstname of contact
contact[email] email of contact this parameter must have valid email (example : “guestonline@api.fr”)
contact[mobile_phone] mobile phone of contact this parameter must have valid phone number (example : 33 6 12 23 34 45)
contact[accept_email_spam] accept_email_spam of contact
contact[accept_sms_spam] accept_sms_spam of contact
contact[country_code] country code of contact (example: “fr”)

Returns

Returns the booking object.

Updating existing booking

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "booking[booked_persons_number]=14" 

JSON RESPONSE :

{ 
  "object":"booking",
  "id":577990,
  "booking_state":"initialized",
  "booked_persons_number":14,
  "present_persons_number":15,
  "cancel_actor":null,
  "cancel_reason":null,
  "booking_type":"restaurant",
  "note":"my booking from api",
  "period":"dinner",
  "booking_date":"2014-11-06",
  "booking_time":"2014-11-06T20:00:00+01:00",
  "email":"api@guestonline.fr",
  "firstname":"Api",
  "lastname":"GuestOnline",
  "contact_id":622361,
  "restaurant_id": 479
}

You can update a specific booking with id.

Arguments

Arguments Status Description
id Mandatory The ID of the booking to be retrieved.

Returns

Returns the booking object.

Cancel an existing booking

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/cancel"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \ 

JSON RESPONSE :

{
  "object": "booking",
  "id": 577990,
  "booking_state": "canceled",
  "booked_persons_number": 14,
  "present_persons_number": 0,
  "cancel_actor": "restaurateur",
  "cancel_reason": "Bonjour,<br/>Nous sommes contraint d'annuler votre réservation et nous le regrettons.<br/>N'hésitez pas à réserver à une autre date.<br/>Nous sommes navrés de la gêne occasionnée.",
  "booking_type": "restaurant",
  "note": "my booking from api",
  "period": "no_service",
  "booking_date": "2014-11-06",
  "booking_time": "2014-11-06T20:00:00+01:00",
  "email": "api@guestonline.fr",
  "firstname": "Api",
  "lastname": "GuestOnline",
  "contact_id": 622361,
  "restaurant_id": 479
}

You can cancel a specific booking with id.

Arguments

Arguments Status Description
id Mandatory The ID of the booking to be canceled.

Returns

Returns the booking object.

Cancel an existing booking for a user

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/user_cancel"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \ 
  -d "booking_token=the-booking-token" \
  -d "cancel_reason=i am sick"\

JSON RESPONSE :

{
  "object": "booking",
  "id": 577990,
  "booking_state": "canceled",
  "booked_persons_number": 14,
  "present_persons_number": 0,
  "cancel_actor": "client",
  "cancel_reason": "I am sick, sorry!",
  "booking_type": "website",
  "note": "my booking from api",
  "period": "no_service",
  "booking_date": "2014-11-06",
  "booking_time": "2014-11-06T20:00:00+01:00",
  "email": "api@guestonline.fr",
  "firstname": "Api",
  "lastname": "GuestOnline",
  "contact_id": 622361,
  "restaurant_id": 479
}

You can cancel a specific booking in place of the customer with id, and booking_token.

Arguments

Arguments Status Description
id Mandatory The ID of the booking to be canceled.
booking_token Mandatory The booking_token of the booking
cancel_reason Mandatory The reason to give to the restaurant

Returns

Returns the booking object.

Confirm an existing booking

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/confirm"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \ 

JSON RESPONSE :

{
  "object": "booking",
  "id": 577990,
  "booking_state": "validated",
  "booked_persons_number": 14,
  "present_persons_number": 15,
  "cancel_actor": null,
  "cancel_reason": null,
  "booking_type": "restaurant",
  "note": "my booking from api",
  "period": "dinner",
  "booking_date": "2014-11-06",
  "booking_time": "2014-11-06T20:00:00+01:00",
  "email": "api@guestonline.fr",
  "firstname": "Api",
  "lastname": "GuestOnline",
  "contact_id": 622361,
  "restaurant_id": 479
}

You can confirm a specific booking with id.

Arguments

Arguments Status Description
id Mandatory ID of booking

Returns

Returns the booking object.

honore an existing booking

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/honore"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \ 

JSON RESPONSE :

{
  "object": "booking",
  "id": 577990,
  "booking_state": "honored",
  "booked_persons_number": 14,
  "present_persons_number": 14,
  "cancel_actor": null,
  "cancel_reason": null,
  "booking_type": "restaurant",
  "note": "my booking from api",
  "period": "dinner",
  "booking_date": "2014-11-06",
  "booking_time": "2014-11-06T20:00:00+01:00",
  "email": "api@guestonline.fr",
  "firstname": "Api",
  "lastname": "GuestOnline",
  "contact_id": 622361,
  "restaurant_id": 479
}

You can honore a specific booking with id.

Arguments

Arguments Status Description
id Mandatory ID of booking
present_persons_number Optional present persons number if not supply the booked persons number will be used

Returns

Returns the booking object.

fake an existing booking

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/fake"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \ 

JSON RESPONSE :

{
  "object": "booking",
  "id": 577990,
  "booking_state": "fully_faked",
  "booked_persons_number": 14,
  "present_persons_number": 0,
  "cancel_actor": null,
  "cancel_reason": null,
  "booking_type": "restaurant",
  "note": "my booking from api",
  "period": "dinner",
  "booking_date": "2014-11-06",
  "booking_time": "2014-11-06T20:00:00+01:00",
  "email": "api@guestonline.fr",
  "firstname": "Api",
  "lastname": "GuestOnline",
  "contact_id": 622361,
  "restaurant_id": 479
}

You can specify that a specific booking is fully fake.

Arguments

Arguments Status Description
id Mandatory ID of booking

Returns

Returns the booking object.

Releasing the table

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/release_table"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "booking_info[amount]=10000" 
  -d "booking_info[currency]=EUR" 

JSON RESPONSE :

{ 
  "object":"booking",
  "id":577990,
  "booking_state":"validated",
  "booked_persons_number":14,
  "present_persons_number":15,
  "cancel_actor":null,
  "cancel_reason":null,
  "booking_type":"restaurant",
  "note":"my booking from api",
  "period":"dinner",
  "booking_date":"2014-11-06",
  "booking_time":"2014-11-06T20:00:00+01:00",
  "email":"api@guestonline.fr",
  "firstname":"Api",
  "lastname":"GuestOnline",
  "contact_id":622361,
  "restaurant_id": 479,
  "booking_info": {
      "object": "booking_info",
      "amount": 10000,
      "currency": "EUR"
  }
}

You add extra info to the booking when releasing the table.

Arguments

All properties of the Booking Info can be updated. They

Arguments Status Description
booking_info[amount] Mandatory The amount of the bill
booking_info[currency] Mandatory The currency of the bill

Returns

Returns the booking object with booking info expanded. The release table process is also triggered.

Invite friends

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/bookings/577990/invite_friends"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "emails[]=j.doe@example.com" 
  -d "emails[]=p.smith@example.com" 
  -d "message=See you there."

JSON RESPONSE :

{ 
  "object":"booking",
  "id":577990,
  "booking_state":"validated",
  "booked_persons_number":14,
  "present_persons_number":15,
  "cancel_actor":null,
  "cancel_reason":null,
  "booking_type":"restaurant",
  "note":"my booking from api",
  "period":"dinner",
  "booking_date":"2014-11-06",
  "booking_time":"2014-11-06T20:00:00+01:00",
  "email":"api@guestonline.fr",
  "firstname":"Api",
  "lastname":"GuestOnline",
  "contact_id":622361,
  "restaurant_id": 479,
  "booking_info": {
      "object": "booking_info",
      "amount": 10000,
      "currency": "EUR"
  }
}

Send mails to given emails with booking information and specific message

Arguments

Arguments Status Description
emails Mandatory Array of emails
message Mandatory The message to add

Returns

Returns the booking object.

Contacts

The contact object


JSON Example :

{
  "id":622359,
  "lastname":"Koch",
  "firstname":"Skyla",
  "email":"adolph@schamberger.us",
  "birthday":"1980-01-01",
  "gender":2,
  "fixed_phone":"33520506100",
  "mobile_phone":"33620506100",
  "address":"8 rue des restaurants",
  "extra_address":"allée des gastronomes",
  "postcode":"31000",
  "city":"TOULOUSE",
  "company":"TableOnline",
  "country":"France",
  "accept_email_spam":true,
  "accept_sms_spam":true,
  "note":"lactose",
  "warning":true,
  "country_code":"FR",
  "restaurant_id":479
}
Key Type Description
id Int id of contact
lastname String lastname of contact define with maximum 50 characters
firstname String firstname of contact define with maximum 50 characters
email String email of contact define with maximum 300 characters
birthday Date birthday of contact define with date
gender Int gender of contact define with 1(for male) or 2(for female)
fixed_phone String fixed phone of contact define with maximum 25 characters
mobile_phone String mobile phone of contact define with maximum 25 characters
address String address of contact define with maximum 200 characters
extra_address String extra address of contact define with maximum 200 characters
postcode String postcode of contact define with maximum 5 characters
city String city of contact define with maximum 50 characters
company String company of contact define with maximum 100 characters
country String country of contact define with maximum 100 characters
accept_email_spam Boolean true if contact accepts email campaigns
accept_sms_spam Boolean true if contact accepts sms campaigns
note String note of contact define with maximum 65535 characters
warning Boolean warning of contact (more details on note)
country_code String country code for contact define with maximum 3 characters
restaurant_id Int restaurant id for contact

List contacts with params

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/contacts"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H"

JSON RESPONSE :

{
  "object":"list",
  "total_count":624,
  "num_pages":16,
  "current_page":1,
  "contacts":
  [
    {
      "object":"contact",
      "id":622359,
      "lastname":"Koch",
      "firstname":"Skyla",
      "email":"adolph@schamberger.us",
      "birthday":"1980-01-01",
      "gender":2,
      "fixed_phone":"33520506100",
      "mobile_phone":"33620506100",
      "address":"8 rue des restaurants",
      "extra_address":"allée des gastronomes",
      "postcode":"31000",
      "city":"TOULOUSE",
      "company":"TableOnline",
      "country":"France",
      "accept_email_spam":true,
      "accept_sms_spam":true,
      "note":"lactose",
      "warning":true,
      "country_code":"FR",
      "restaurant_id":479
    },
    {...},
    ...
  ]
}

Guestonline Api provide a way to retrieve list of contacts with severals arguments.
All those parameters used to refine your search.

Arguments

Parameter Status Description
restaurant_id Dependant This parameter is optional if your token manage a single restaurant. In case, this token can manage more than one restaurant you must provide it .
email Optional email address
mobile_phone Optional mobile phone
lastname Optional lastname of contact

Retrieve an existing contact

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/contacts/622359"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" 

JSON RESPONSE :

{
  "object":"contact",
  "id":622359,
  "lastname":"Koch",
  "firstname":"Skyla",
  "email":"adolph@schamberger.us",
  "birthday":"1980-01-01",
  "gender":2,
  "fixed_phone":"33520506100",
  "mobile_phone":"33620506100",
  "address":"8 rue des restaurants",
  "extra_address":"allée des gastronomes",
  "postcode":"31000",
  "city":"TOULOUSE",
  "company":"TableOnline",
  "country":"France",
  "accept_email_spam":true,
  "accept_sms_spam":true,
  "note":"lactose",
  "warning":true,
  "country_code":"FR",
  "restaurant_id":479
}

You can also retrieve a specific contact.

Arguments

Arguments Status Description
id Mandatory contact ID.

Returns

Returns the contact object.

Creating a new contact

EXAMPLE REQUEST :

  $ curl -X POST "http://api.guestonline.fr/v1/contacts"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "contact[lastname]=Cabarrou"

JSON RESPONSE :

{ 
  "object":"contact",
  "id":622356,
  "lastname":"Cabarrou",
  "firstname":null,
  "email":null,
  "birthday":null,
  "gender":null,
  "fixed_phone":null,
  "mobile_phone":null,
  "address":null,
  "extra_address":null,
  "postcode":null,
  "city":null,
  "company":null,
  "country":null,
  "accept_email_spam":false,
  "accept_sms_spam":false,
  "note":null,
  "warning":false,
  "country_code":"FR",
  "restaurant_id":479
}

All arguments define in contact parameter.

Arguments

Arguments Status Description Warning
contact[lastname] Mandatory lastname is mandatory.
contact[firstname] Optional firstname of contact
contact[email] Optional email of contact this parameter must have valid email (example : “guestonline@api.fr”)
contact[birthday] Optional birthday of contact
contact[gender] Optional gender of contact
contact[fixed_phone] Optional fixed phone of contact this parameter must have valid landline number (example : 33 5 12 23 34 45)
contact[mobile_phone] Optional mobile phone of contact this parameter must have valid phone number (example : 33 6 12 23 34 45)
contact[address] Optional address of contact
contact[extra_address] Optional extra address of contact
contact[postcode] Optional postcode of contact
contact[city] Optional city of contact
contact[company] Optional company of contact
contact[country] Optional country of contact
contact[accept_email_spam] Dependant define if contact accept email from guestonline to set this paramater, you need to provide valid email
contact[accept_sms_spam] Dependant define if contact accept sms from guestonline to set this paramater, you need to provide valid mobile phone
contact[note] Optional note of contact
contact[warning] Optional warning of contact
contact[country_code] Optional country code of contact
contact[restaurant_id] Dependant id of the restaurant which is attached to the contact this parameter is mandatory if your token manage more than one restaurant

Returns

Returns the contact object.

Updating existing contact

EXAMPLE REQUEST :

  $ curl -X PUT "http://api.guestonline.fr/v1/contacts/622356"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H" \
  -d "contact[firstname]=Magalie"

JSON RESPONSE :

{ 
  "object":"contact",
  "id":622356,
  "lastname":"Cabarrou",
  "firstname":"Magalie",
  "email":null,
  "birthday":null,
  "gender":null,
  "fixed_phone":null,
  "mobile_phone":null,
  "address":null,
  "extra_address":null,
  "postcode":null,
  "city":null,
  "company":null,
  "country":null,
  "accept_email_spam":false,
  "accept_sms_spam":false,
  "note":null,
  "warning":false,
  "country_code":"FR",
  "restaurant_id":479
}

You can update contact with same parameters of creation except lastname

Arguments Status Description
contact[lastname] Optional lastname of contact.

Returns

Returns the contact object.

Commercials

The commercial object


JSON Example :

{
  "object": "offer",
  "id": 162,
  "name": "a name",
  "description": "My commercial",
  "start_date": "2014-11-05",
  "end_date": "2014-11-05",
  "permanent": false,
  "bookable": false,
  "minimum_dishes": 1,
  "maximum_dishes": null,
  "restaurant_id": 479,
  "translations": [
    {
      "object": "commercial_translation",
      "locale": "fr",
      "name": "Happy Hour",
      "description": "Free glass of white wine with your meal"
    },
    {
      "object": "commercial_translation",
      "locale": "en",
      "name": "Happy Hour",
      "description": "Free glass of white wine with your meal"
    }
   ],
  "commercial_recurrencies": [
    {
      "object": "commercial_recurrency",
      "week_day": 4,
      "month_week": 0,
      "start_hour": "19:00",
      "end_hour": "20:30"
    }
}
Key Type Description
id Int commercial id
object String type in [offer, event]
name String name of commercial
description Text description of commercial
permanent Boolean permanent of commercial
start_date Date start date of commercial
end_date Date end date of commercial
bookable Boolean bookable of commercial
minimum_dishes Int minimum dishes required for this
maximum_dishes Int maximum dishes required for this
restaurant_id Int restaurant id
has_prepayment Boolean True if prepayment is requested for this commercial
translations Array Array of translation
commercial_recurrencies Array Array of Commercial Recurrency

Commercial translation Object

Key Type Description
locale String locale ISO code (fr, en, …)
name String Name of the commercial
description String Description of the commercial

Commercial Recurrency Object

Key Type Description
week_day Int day of the week
month_week Int week in the month 0 -> 5 0 means every week
start_hour String start hour in the restaurant timezone (format 19:00)
end_hour String end hour in the restaurant timezone (format 19:00)

List commercials with params

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/commercials"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H"
  -d "date=2014-11-05"
  -d "permanent=false"

JSON RESPONSE :

{
  "object": "list",
  "total_count":2,
  "num_pages":1,
  "current_page":1,
  "commercials": 
    [
      {
        "object": "offer",
        "id": 162,
        "name": "a name",
        "description": "My commercial",
        "start_date": "2014-11-05",
        "end_date": "2014-11-05",
        "permanent": false,
        "bookable": false,
        "minimum_dishes": 1,
        "maximum_dishes": null,
        "restaurant_id": 479,
        "translations": [
          {
            "object": "commercial_translation",
            "locale": "fr",
            "name": "Happy Hour",
            "description": "Free glass of white wine with your meal"
          },
          {
            "object": "commercial_translation",
            "locale": "en",
            "name": "Happy Hour",
            "description": "Free glass of white wine with your meal"
          }
         ],
        "commercial_recurrencies": [
          {
            "object": "commercial_recurrency",
            "week_day": 4,
            "month_week": 0,
            "start_hour": "19:00",
            "end_hour": "20:30"
          }
      ]
      },
      {...},
      ...
    ]
}

GuestOnline Api provides a way to retrieve a paginated list of commercials.

Arguments

Parameter Status Type Description
permanent Optional Bool Commercial#permanent field filter
date Optional Date if set limit the search to Commercials available on given date
restaurant_id Optional Int In case, your token can manage more than one restaurant this allows you to filter a specific restaurant. By default all commercials of your managed restaurants will be listed

Retrieve an existing commercial

EXAMPLE REQUEST :

  $ curl -X GET "https://api.guestonline.fr/v1/commercials/162"  \
  -H "X-Token: 8xyDktY8QoUdHPVm3Z7H"

JSON RESPONSE :

{
  "object": "offer",
  "id": 162,
  "name": "a name",
  "description": "My commercial",
  "start_date": "2014-11-05",
  "end_date": "2014-11-05",
  "permanent": false,
  "bookable": false,
  "minimum_dishes": 1,
  "maximum_dishes": null,
  "restaurant_id": 479
}

GuestOnline Api provides a way to retrieve list of commercials.

Arguments

Parameter Status Description
restaurant_id Dependant This parameter is optional if your token manage a single restaurant. In case, this token can manage more than one restaurant you must provide it .

Opinions

The opinion object


JSON Example :


"opinions": [
    {
        "object": "opinion",
        "id": "54a3b2c7c29387595a00003b",
        "opinion_items": [
            {
                "object": "opinion_item",
                "kind": "rate",
                "key": "atmosphere",
                "value": "1"
            },
            ...
        ],
        "booking": {
            "object": "booking",
            "id": 654636,
            "booking_state": "validated",
            "booking_date": "2014-10-31",
            "booking_time": "2014-10-31T20:00:00+01:00"
        },
        "contact": {
            "object": "contact",
            "lastname": "Kreiger",
            "firstname": "Quinn"
        }
    }
]

Key Type Description
id Int id of opinion
booking booking a simplified instance booking
contact contact a simplified instance contact
opinion_items Array array of opinion items

Booking Object

Key Type Description
id Int id of opinion
booking_state String state of booking
booking_date Date date of booking
booking_time DateTime time of booking

Contact Object

Key Type Description
lastname String lastname of contact
firstname String firstname of contact

Opinion Item Object

Key Type Description
kind String rate or text
key String defined the title that requires a scoring
value String score or comment

List opinions with params

EXAMPLE REQUEST :

  $ curl -X GET "http://api.guestonline.fr/v1/opinions" \
  -H "X-Token: S8zUPVsQ3ouL6WzUV87V"
  -d "updated_at=2014-12-31"

JSON RESPONSE :

{
    "object": "list",
    "total_count": 1,
    "num_pages": 1,
    "current_page": 1,
    "opinions": [
        {
            "object": "opinion",
            "id": "54a3b2c7c29387595a00003b",
            "opinion_items": [
                {
                    "object": "opinion_item",
                    "kind": "rate",
                    "key": "atmosphere",
                    "value": "1"
                },
                ...
            ],
            "booking": {
                "object": "booking",
                "id": 654636,
                "booking_state": "validated",
                "booking_date": "2014-10-31",
                "booking_time": "2014-10-31T20:00:00+01:00"
            },
            "contact": {
                "object": "contact",
                "lastname": "Kreiger",
                "firstname": "Quinn"
            }
        }
    ]
}

Guestonline Api provide a way to retrieve a paginated list of opinions.

Arguments

Parameter Status Type Description
updated_at Optional Date it allows to retrieve opinions since this date.
restaurant_id Optional Int In case, your token can manage more than one restaurant this allows you to filter a specific restaurant. By default all commercials of your managed restaurants will be listed

Booking Info


Extra data can be attached to a booking. Those are store in the BookingInfo element.

Pagination Arguments

JSON RESPONSE :

  {
    "object":"booking_info",
    "amount":10000,
    "currency":"EUR",
  }
key Type Description
amount Int Bill amount in cents
currency String 3 letter ISO code for currency