# Get booking events

POS only.

This endpoint is for fetching the events associated with a booking. The events are ordered with the most recent event first.

Endpoint: GET /bookings/{bookingId}/events
Version: 1.0
Security: JWT

## Path parameters:

  - `bookingId` (string, required)
    Id of the booking in Tyro Connect that should be retrieved

## Header parameters:

  - `Authorization` (string, required)

## Response 200 fields (application/json):

  - `events` (array)
    The list of events associated with the booking

  - `events.id` (string, required)
    The id of the booking in the Tyro Connect system
    Example: "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149"

  - `events.locationId` (string, required)
    The id of the location as specified by the Tyro Connect system

  - `events.type` (string, required)
    The event type.
    Enum: "BOOKING_CREATED", "BOOKING_UPDATED", "BOOKING_SEATED", "BOOKING_DINING", "BOOKING_CLOSING", "BOOKING_FINALISED"

  - `events.sourceOfChange` (string, required)
    Partner that triggered the update
    Enum: "POS", "APP", "TYRO_CONNECT"

  - `events.eventData` (object, required)
    The data that was updated as a part of the event

  - `events.eventData.id` (string)
    The id of the booking in the Tyro Connect system
    Example: "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149"

  - `events.eventData.locationId` (string)
    The id of the location as specified by the Tyro Connect system

  - `events.eventData.origin` (object)
    Information relevant to the booking partner that this booking was created with

  - `events.eventData.origin.name` (string)
    Name of the booking app

  - `events.eventData.origin.bookingReference` (string, required)
    Reference for the booking. It is used to facilitate identification of the booking in the app and pos systems and must be unique per location and booking partner.

  - `events.eventData.bookingStatus` (string)
    The current status of the booking
    Enum: "CREATED", "ACCEPTED", "CANCELLED_BY_CUSTOMER", "CANCELLED_BY_MERCHANT", "REJECTED"

  - `events.eventData.asset` (any)

  - `events.eventData.numberOfPeople` (number)
    The number of expected guests

  - `events.eventData.payments` (array)
    A list of payments applied to the booking.

  - `events.eventData.payments.amount` (integer)
    This is the amount in cents. e.g 12520 is $125.20

  - `events.eventData.payments.currency` (string)
    This is always AUD
    Enum: "AUD"

  - `events.eventData.payments.description` (string)
    A description of what this payment amount represents
    Example: "Deposit for booking"

  - `events.eventData.startTime` (string)
    The date and time the booking starts at the venue. The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)
    Example: "2018-05-02T17:30:00Z"

  - `events.eventData.endTime` (string)
    The date and time the booking ends at the venue. The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)
    Example: "2018-05-02T18:30:00Z"

  - `events.eventData.customer` (object)
    The customer making the booking

  - `events.eventData.customer.id` (string)

  - `events.eventData.customer.name` (string)
    Customer's name

  - `events.eventData.customer.notes` (string)
    Notes specific to the customer. For example, 'Loves red wine'.

  - `events.eventData.customer.email` (string)
    Customer's email address

  - `events.eventData.customer.address` (object)
    The customer address

  - `events.eventData.customer.address.line1` (string)

  - `events.eventData.customer.address.line2` (string)

  - `events.eventData.customer.address.suburb` (string)

  - `events.eventData.customer.address.state` (string)

  - `events.eventData.customer.address.postcode` (string)

  - `events.eventData.customer.address.country` (string)

  - `events.eventData.customer.phoneNumber` (string)
    Customer's phone number

  - `events.eventData.customer.birthday` (string)
    Customer's birthday

  - `events.eventData.notes` (string)
    Notes specific to the booking. Example: 'Window seat please'

  - `events.eventData.reason` (string)
    The reason the booking was rejected or cancelled. Provided only when bookingStatus is REJECTED, CANCELLED_BY_MERCHANT or CANCELLED_BY_CUSTOMER

  - `events.outcome` (object, required)
    The resulting updated booking.

  - `events.outcome.asset` (any)

  - `events.outcome.customer` (object)
    The customer making the booking

  - `events.outcome.numberOfPeople` (number)
    The number of expected guests

  - `events.outcome.payments` (array)
    A list of payments applied to the booking.

  - `events.outcome.bookingStatus` (string)
    The current status of the booking
    Enum: "CREATED", "ACCEPTED", "CANCELLED_BY_CUSTOMER", "CANCELLED_BY_MERCHANT", "REJECTED"

  - `events.outcome.reason` (string)
    The reason the booking was rejected or cancelled. Provided only when bookingStatus is REJECTED, CANCELLED_BY_MERCHANT or CANCELLED_BY_CUSTOMER

  - `events.outcome.startTime` (string)
    The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)

  - `events.outcome.endTime` (string)
    The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)

  - `events.createdAt` (string, required)
    The date and time the update happened. The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)
    Example: "2018-05-02T17:30:00Z"

## Response 400 fields (application/json):

  - `error` (string)

  - `errorCode` (string)

  - `errors` (array)

  - `message` (string)


## Response 403 fields

## Response 404 fields
