Reservations

Return a Reservation.

Parameters
  • idpath integerRequired

    Return a Reservation by specific id.

  • includequery string

    Include associations (delimited with comma). Available associations: bookings, tables, business, user.

GET/api/v1/reservations/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/${id}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Available Seats

Check for available seats for a particular hour in a restaurant.

Parameters
  • dataformData, objectRequired

    Form Data needed when checking for available seats for a particular hour in a restaurant.

    • typestringRequired

      Provide Reservation type. Current selection is only reservations.

    • attributesformData, objectRequired

      Attributes object.

      • datedateRequired

        Date should be formated as a ISO date.

      • timeintegerRequired

    • relationshipsformData, objectRequired

      Relationships object with business object.

      • businessformData, objectRequired

        Add a Business relationships link.

        • idstringRequired

          Related Business id.

        • typestringRequired

          Business type; business.

GET/api/v1/reservations/available_seats

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/available_seats`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Available Hours

Check for available hours in a restaurant.

Parameters
  • dataformData, objectRequired

    Form Data needed when checking for available hours in a restaurant.

    • typestringRequired

      Provide Reservation type. Current selection is only reservations.

    • attributesformData, objectRequired

      Attributes object.

      • datedateRequired

        Date should be formated as a ISO date.

    • relationshipsformData, objectRequired

      Relationships object with business object.

      • businessformData, objectRequired

        Add a Business relationships link.

        • idstringRequired

          Related Business id.

        • typestringRequired

          Business type; business.

GET/api/v1/reservations/available_hours

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/available_hours`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Create Reservation

Create a reservation of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new reservation of a business.

    • typestringRequired

      Provide Reservation type. Current selection is only reservations.

    • attributesformData, objectRequired

      Attributes object.

      • namestringRequired

        Reservation name.

      • datedateRequired

        Date should be formated as a ISO date.

      • fromintegerRequired

      • tointegerRequired

      • party_sizeintegerRequired

        Reservation party size.

      • emailstring

        Email for Reservation.

      • phonestring

        Phone number for Reservation.

      • phone_country_codestring

        Phone number country code for Reservation.

      • phone_country_prefixstring

        Phone number prefix for Reservation.

      • tablesformData, objectRequired

        Reservation table info.

        • idstring[]Required

          Provide multiple table id, atleast one is required.

        • seats_takeninteger[]Required

          Provide multiple values, atleast one is required.

    • relationshipsformData, objectRequired

      Relationships object with business or user objects.

      • businessformData, objectRequired

        Add a Business relationships link.

        • idstringRequired

          Related Business id.

        • typestringRequired

          Business type; business.

      • userformData, object

        Add a User relationships link.

        • idstring

          Related User id.

        • typestring

          User type; business.

POST/api/v1/reservations

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Update Reservation

Update reservation.

Parameters
  • idpath integerRequired

    Update a Reservation by specific id.

  • dataformData, objectRequired

    Form Data needed when updating a Reservation.

    • idstringRequired

      Provide Reservation id.

    • typestringRequired

      Provide Reservation type. Current selection is only reservations.

    • attributesformData, object

      Attributes object.

      • namestring

        Reservation name.

      • emailstring

        Email for Reservation.

      • datedate

        Date should be formated as a ISO date.

      • frominteger

      • tointeger

      • party_sizeinteger

        Reservation party size.

      • phonestring

        Phone number for Reservation.

      • phone_country_codestring

        Phone number country code for Reservation.

      • phone_country_prefixstring

        Phone number prefix for Reservation.

      • tablesformData, objectRequired

        Reservation table info.

        • idstring[]Required

          Provide multiple table id, atleast one is required.

        • seats_takeninteger[]Required

          Provide multiple values, atleast one is required.

PATCH/api/v1/reservations/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/${id}`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Delete Reservation

Delete a Reservation.

Parameters
  • idpath integerRequired

    Delete a Reservation by specific id.

DELETE/api/v1/reservations/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/${id}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    }});
  const data = await res.json();
}

Cancel Reservation

Cancel a reservation - erase all tables from reservation and delete bookings.

Parameters
  • idpath integerRequired

    Cancel a Reservation by specific id.

  • dataformData, objectRequired

    Form Data needed when canceling a Reservation.

    • idstringRequired

      Provide Reservation id.

    • typestringRequired

      Provide Reservation type. Current selection is only reservations.

PATCH/api/v1/reservations/{id}/cancel

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/${id}/cancel`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Reject Reservation

Reject a reservation.

Parameters
  • idpath integerRequired

    Reject a Reservation by specific id.

  • dataformData, objectRequired

    Form Data needed when canceling a Reservation.

    • idstringRequired

      Provide Reservation id.

    • typestringRequired

      Provide Reservation type. Current selection is only reservations.

    • attributesformData, object

      Attributes object.

      • reject_reasonstring

        Reservation rejected reason; other, restuarant_full, almost_closing_time.

      • other_rejection_reasonstring

        If reject reason is other. Provided written reason not fitting to other categories.

PATCH/api/v1/reservations/{id}/reject

{
  const res = await fetch(`${BASE_URL}/api/v1/reservations/${id}/reject`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE