openapi: 3.0.0
info:
  title: 'SynXis Property Hub - Reservation'
  description: "This API provides information pertaining to all the Reservations present in a hotel and matching with the specified request criteria\n"
  version: v1.0.0
servers:
  -
    url: 'https://services-c1.synxis.com/v1'
    description: '*** C1 / SPH Community Cert ***'
  -
    url: 'https://services-c2.synxis.com/v1'
    description: '*** C2 / SPH Enterprise Cert ***'
paths:
  /sph/reservations/outbound/data/reservations-details:
    post:
      tags:
        - Reservations
      summary: 'Gets a list of reservations'
      operationId: reservation
      parameters:
        -
          name: Content-Type
          in: header
          description: 'Indicates the media type of the resource.'
          required: true
          schema:
            type: string
            default: application/json
        -
          name: tenantId
          in: header
          description: '1 – Community Hotel, 2 – Enterprise Hotel'
          required: true
          schema:
            enum:
              - 1
              - 2
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/ReservationRequest'
      responses:
        '200':
          description: 'A list of reservations'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationResponse'
        '400':
          description: 'Invalid Request'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: 'Not found'
        '500':
          description: 'Internal service exception'
  /sph/reservations/room-request:
    post:
      tags:
        - Reservations
      summary: 'Get all the room request for given room for arrivals and stayovers'
      operationId: fetchRoomRequest
      parameters:
        -
          name: Content-Type
          in: header
          description: 'Indicates the media type of the resource.'
          required: true
          schema:
            type: string
            default: application/json
        -
          name: tenantId
          in: header
          description: '1 – Community Hotel, 2 – Enterprise Hotel'
          required: true
          schema:
            enum:
              - 1
              - 2
            type: integer
        -
          name: chainId
          in: header
          description: 'Chain Id for the Hotel'
          required: true
          schema:
            type: integer
        -
          name: hotelId
          in: header
          description: 'Hotel Id'
          required: true
          schema:
            type: integer
        -
          name: vendorCode
          in: header
          description: 'Vendor Code for accessing api'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Room Numbers'
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
        required: true
      responses:
        '200':
          description: 'Room request fetched successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoomRequestApiResponse'
        '400':
          description: 'Invalid Request'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: 'Not found'
        '412':
          description: 'Precondition failed'
        '500':
          description: 'Internal service exception'
  '/sph/reservations/{confirmationNumber}/check-in':
    put:
      tags:
        - Reservations
      summary: 'Pre-Checkin Reservation'
      operationId: checkInReservation
      parameters:
        -
          name: Content-Type
          in: header
          description: 'Indicates the media type of the resource.'
          required: true
          schema:
            type: string
            default: application/json
        -
          name: tenantId
          in: header
          description: '1 – Community Hotel, 2 – Enterprise Hotel'
          required: true
          schema:
            enum:
              - 1
              - 2
            type: integer
        -
          name: chainId
          in: header
          description: 'Chain Id for the Hotel'
          required: true
          schema:
            type: integer
        -
          name: hotelId
          in: header
          description: 'Hotel Id'
          required: true
          schema:
            type: integer
        -
          name: vendorCode
          in: header
          description: 'Vendor Code for accessing api'
          required: true
          schema:
            type: string
        -
          name: confirmationNumber
          in: path
          description: 'Reservation Confirmation Number to Pre Checkin'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Reservation Pre Checked-In successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationCheckInResponse'
        '400':
          description: 'Invalid Request'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: 'Not found'
        '412':
          description: 'Precondition failed'
        '500':
          description: 'Internal service exception'
  '/sph/reservations/{confirmationNumber}/check-out':
    put:
      tags:
        - Reservations
      summary: 'CheckOut Reservation'
      operationId: checkOutReservation
      parameters:
        -
          name: Content-Type
          in: header
          description: 'Indicates the media type of the resource.'
          required: true
          schema:
            type: string
            default: application/json
        -
          name: tenantId
          in: header
          description: '1 – Community Hotel, 2 – Enterprise Hotel'
          required: true
          schema:
            enum:
              - 1
              - 2
            type: integer
        -
          name: chainId
          in: header
          description: 'Chain Id for the Hotel'
          required: true
          schema:
            type: integer
        -
          name: hotelId
          in: header
          description: 'Hotel Id'
          required: true
          schema:
            type: integer
        -
          name: vendorCode
          in: header
          description: 'Vendor Code for accessing api'
          required: true
          schema:
            type: string
        -
          name: confirmationNumber
          in: path
          description: 'Reservation Confirmation Number to Checkout'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Reservation Checked Out Successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationCheckOutResponse'
        '400':
          description: 'Invalid Request'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: 'Not found'
        '412':
          description: 'Precondition failed'
        '500':
          description: 'Internal service exception'
  '/sph/reservations/{confirmationNumber}/room':
    put:
      tags:
        - Reservations
      summary: 'Update Room Number for Reservation'
      operationId: updateReservationRoom
      parameters:
        -
          name: Content-Type
          in: header
          description: 'Indicates the media type of the resource.'
          required: true
          schema:
            type: string
            default: application/json
        -
          name: tenantId
          in: header
          description: '1 – Community Hotel, 2 – Enterprise Hotel'
          required: true
          schema:
            enum:
              - 1
              - 2
            type: integer
        -
          name: chainId
          in: header
          description: 'Chain Id for the Hotel'
          required: true
          schema:
            type: integer
        -
          name: hotelId
          in: header
          description: 'Hotel Id'
          required: true
          schema:
            type: integer
        -
          name: vendorCode
          in: header
          description: 'Vendor Code for accessing api'
          required: true
          schema:
            type: string
        -
          name: confirmationNumber
          in: path
          description: 'Reservation Confirmation Number whose room needs to be updated'
          required: true
          schema:
            type: string
        -
          name: roomNumber
          in: query
          description: 'Room number to update for Reservation'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Room number updated successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReservationRoomUpdateResponse'
        '400':
          description: 'Invalid Request'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: 'Not found'
        '412':
          description: 'Precondition failed'
        '500':
          description: 'Internal service exception'
  '/sph/reservations/{confirmationNumber}/rooms/available':
    get:
      tags:
        - Reservations
      summary: 'Get all availables rooms for reservation'
      operationId: reservationRoomsAvailable
      parameters:
        -
          name: Content-Type
          in: header
          description: 'Indicates the media type of the resource.'
          required: true
          schema:
            type: string
            default: application/json
        -
          name: tenantId
          in: header
          description: '1 – Community Hotel, 2 – Enterprise Hotel'
          required: true
          schema:
            enum:
              - 1
              - 2
            type: integer
        -
          name: chainId
          in: header
          description: 'Chain Id for the Hotel'
          required: true
          schema:
            type: integer
        -
          name: hotelId
          in: header
          description: 'Hotel Id'
          required: true
          schema:
            type: integer
        -
          name: vendorCode
          in: header
          description: 'Vendor Code for accessing api'
          required: true
          schema:
            type: string
        -
          name: confirmationNumber
          in: path
          description: 'Reservation Confirmation Number to Checkout'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'List of available rooms'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvailableRoomsResponse'
        '400':
          description: 'Invalid Request'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: 'Not found'
        '412':
          description: 'Precondition failed'
        '500':
          description: 'Internal service exception'
components:
  schemas:
    Address:
      type: object
      properties:
        type:
          type: integer
          description: 'Type of Account Receivables Address'
          example: 1
        line1:
          type: string
          description: 'Address Line 1 of guest'
          example: 'Sample address'
        line2:
          type: string
          description: 'Address Line 2 of guest'
          example: null
        line3:
          type: string
          description: 'Address Line 3 of guest'
          example: null
        city:
          type: string
          description: 'City of guest address'
          example: 'New York'
        state:
          type: string
          description: 'State of guest address'
          example: NY
        country:
          type: string
          description: 'Country of guest address'
          example: US
        zip:
          type: string
          description: 'Zip Code of guest address'
          example: '10001'
        primary:
          type: boolean
          description: 'Flag to indicate whether the address is primary or not'
          example: true
    AvailableRoom:
      type: object
      properties:
        roomNumber:
          type: string
          description: 'Room Number from hotel.'
          example: 1001
        smoking:
          type: boolean
          description: 'Flag to indicate if room is allowed for smoking.'
          example: true
        handicap:
          type: boolean
          description: 'Flag to indicate if room is suitable fo handicap.'
          example: true
    AvailableRooms:
      type: object
      properties:
        availableRooms:
          type: array
          items:
            $ref: '#/components/schemas/AvailableRoom'
    AvailableRoomsResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AvailableRooms'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorData'
    CheckInResponseData:
      type: object
      properties:
        success:
          type: boolean
          description: 'Flag to indicate if reservation is pre-checked-in.'
          example: false
    CheckOutResponseData:
      type: object
      properties:
        checkOutSuccess:
          type: boolean
          description: 'Flag to indicate if reservation is checked out.'
          example: false
        interfaceCheckOutMessageStatus:
          type: boolean
          description: 'Flag to indicate if interface message is sent after checked out.'
          example: false
    Email:
      type: object
      properties:
        type:
          type: integer
          description: "Type of the email\n0 Unknown\n1 Personal\n2 Business\n"
          example: 1
        email:
          type: string
          description: 'Email id of the guest'
          example: sample@gmail.com
        primary:
          type: boolean
          description: "Flag to indicate whether the email is primary or not\n"
          example: true
    Error:
      type: object
      properties:
        code:
          type: string
          description: 'Error / Warning Code'
          example: ERR-OUTBOUND-400
        description:
          type: string
          description: 'Error / Warning Description'
          example: RESERVATION_DATA_ERROR
    ErrorData:
      type: object
      properties:
        code:
          type: string
          description: 'Error Code.'
          example: RESERVATION_ERR
        message:
          type: string
          description: 'Error Message.'
          example: 'Reservation Error Message'
    ErrorResponse:
      type: object
      properties:
        message:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        status:
          type: string
          description: 'Status of the API'
          example: ERROR
        successful:
          type: boolean
          description: 'Status of the API'
          example: false
    Guest:
      type: object
      properties:
        profileId:
          type: string
          description: 'Guest profile ID'
          example: 11111ba-f7f4-4060-b10c-c0f83b124bee
        profileSource:
          type: string
          description: 'Source from which the guest profile is created'
          example: UNIQUEID
        firstName:
          type: string
          description: 'First Name of the guest'
          example: First
        lastName:
          type: string
          description: 'Last name of the guest'
          example: Last
        primary:
          type: boolean
          description: 'To indicate whether the guest is primary guest or not'
          example: true
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        emails:
          type: array
          items:
            $ref: '#/components/schemas/Email'
        phones:
          type: array
          items:
            $ref: '#/components/schemas/Phone'
    Message:
      type: object
      properties:
        errorList:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Phone:
      type: object
      properties:
        type:
          type: integer
          description: "Type of the phone\n0 Unknown\n1 Voice\n2 Fax\n3 Mobile\n"
          example: 1
        countryCode:
          type: string
          description: 'Country code phone number'
          example: null
        phone:
          type: string
          description: 'Phone number of the guest'
          example: '12345678'
        extension:
          type: string
          description: 'Extension of the phone number'
          example: null
        primary:
          type: boolean
          description: 'Flag to indicate whether the phone is primary or not'
          example: true
    Reservation:
      type: object
      properties:
        chainId:
          type: integer
          description: "Chain Id, of the chain the hotel is associated with\n"
          example: 12345
        hotelId:
          type: integer
          description: "Hotel Id, of the hotel for which the reservation is created\n"
          example: 12345
        propertyName:
          type: string
          description: "Name of the hotel\n"
          example: 'My Hotel'
        confirmationNumber:
          type: string
          description: "Reservation confirmation number\n"
          example: 12345SB1234
        itineraryNumber:
          type: string
          description: "Reseravtion itinerary Number        \n"
          example: 12345678910
        rezSource:
          type: string
          description: "Source/Channel from which the reservation is created         \n"
          example: PMS
        status:
          type: string
          description: "Primary status of the reservation\nBooked\nConfirmed\nCancelled\nOn Hold\nIgnored\nWait Listed            \n"
          example: Confirmed
        statusCode:
          type: string
          description: "Short code for the primary status of reservation\n"
          example: R
        onPropertyStatus:
          type: string
          description: "Secondary/On Property Status of the reservation\n  None\n  Checked Out\n  In House\n  No Show\n  Turn Away\n  Pre Arrival\"\n"
          example: None
        roomTypeCode:
          type: string
          description: "Room type code for the created reservation\n"
          example: N2Q
        roomType:
          type: string
          description: "Room type for the created reservation\n"
          example: '2 Queen Beds'
        rateTypeCode:
          type: string
          description: "Rate type code for the created reservation   \n"
          example: 'FEDERAL RATE - GOV'
        rateType:
          type: string
          description: "Rate type for the created reservation \n"
          example: 'FEDERAL RATE - GOVERNMENT'
        nightCount:
          type: integer
          description: "Number of night of a reservation\n"
          example: 1
        roomCount:
          type: integer
          description: "Number of rooms booked for reservation\n"
          example: 1
        adultCount:
          type: integer
          description: "Number of adult in the reservation\n"
          example: 1
        childCount:
          type: integer
          description: "Number of child in the reservation\n"
          example: 0
        cancelReason:
          type: string
          description: "Cancel reason description\n"
          example: null
        cancelReasonCode:
          type: string
          description: "Cancel reason code\n"
          example: null
        cancelComment:
          type: string
          description: "Comment provided during cancellation\n"
          example: null
        bookingDate:
          type: string
          description: "Date when the reservation is booked\n"
          format: 'yyyy-MM-dd HH:mm:ss'
          example: '2019-08-31 15:05:46'
        updatedDate:
          type: string
          description: "Date when the reservation is updated\n"
          format: 'yyyy-MM-dd HH:mm:ss'
          example: '2019-08-31 15:06:12'
        lastUpdatedDate:
          type: string
          description: "Date when the reservation details is updated last time\n"
          format: 'yyyy-MM-dd HH:mm:ss'
          example: '2019-09-04 07:52:21'
        cancelDate:
          type: string
          description: "Date when the reservation Is cancelled\n"
          example: null
        marketSource:
          type: string
          description: "Market source of reservation\n"
          example: GDS
        marketSegment:
          type: string
          description: "Market segment of reservation\n"
          example: GOV
        arrivalDate:
          type: string
          description: "Arrival date of reservation\n"
          format: 'yyyy-MM-dd HH:mm:ss'
          example: '2019-09-04 00:00:00'
        departureDate:
          type: string
          description: "Departure date of reservation\n"
          format: 'yyyy-MM-dd HH:mm:ss'
          example: '2019-09-05 00:00:00'
        packageCode:
          type: string
          description: "Package code if associated with reservation\n"
          example: null
        groupId:
          type: string
          description: "Group id, when reservation id created using group\n"
          example: null
        groupName:
          type: string
          description: "Group name, when reservation is created using group\n"
          example: null
        companyName:
          type: string
          description: "Company name, when reservation is created using company profile.\n"
          example: null
        travelAgencyName:
          type: string
          description: "Travel agency name, when reservation is created by travel agency.\n"
          example: null
        loyaltyNumber:
          type: string
          description: "Loyalty Number of the Reservation.\n"
          example: null
        guests:
          type: array
          items:
            $ref: '#/components/schemas/Guest'
        stayDates:
          type: array
          items:
            $ref: '#/components/schemas/StayDate'
        totalAmount:
          type: number
          description: "Total room amount for the whole stay\n"
          format: double
          example: '94.0'
        totalFees:
          type: number
          description: "Total fees for the whole stay\n"
          format: double
          example: '0.0'
        totalAmountWithTaxesAndFees:
          type: number
          description: "Total amount including taxes and fees for the whole stay\n"
          format: double
          example: 104.46
    ReservationCheckInResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CheckInResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorData'
    ReservationCheckOutResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CheckOutResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorData'
    ReservationRequest:
      type: object
      properties:
        client:
          type: string
          description: 'CRM Client Code.'
          example: CLIENT
        hotelId:
          type: integer
          description: 'Hotel Id for which data is needed.'
          example: 1234
        chainId:
          type: integer
          description: 'Chain Id for which data is needed.'
          example: 12345678
        startDateTime:
          type: string
          description: 'Start date and Time of query in UTC.'
          example: '2019-08-28T17:50:00Z'
        endDateTime:
          type: string
          description: 'End date and Time of query in UTC.'
          example: '2019-08-28T18:00:00Z'
        delta:
          type: boolean
          description: 'If true, fetchs only recently modified details.'
          example: false
        updateDelta:
          type: boolean
          description: 'If true, updates the current end date and time for next available delta information.'
          example: false
    ReservationResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorResponse'
        currencyCode:
          type: string
          description: 'ISO 4217 three alpha currency code'
          example: USD
        nextDeltaStartTime:
          type: string
          description: "Date in UTC from which the next delta will be available.\nformat : yyyy-MM-dd HH:mm:ss\nTime Zone: UTC\n"
          example: '2019-08-31 15:05:46'
        status:
          type: string
          example: SUCCESS
        reservations:
          type: array
          items:
            $ref: '#/components/schemas/Reservation'
        total:
          type: number
          description: 'Count of total number of records returned'
          example: 3
    ReservationRoomUpdateData:
      type: object
      properties:
        success:
          type: boolean
          description: 'Flag to indicate if room is updated for reservation.'
          example: false
    ReservationRoomUpdateResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ReservationRoomUpdateData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorData'
    RoomRequest:
      type: object
      properties:
        code:
          type: string
          description: 'Room Request Code.'
          example: 50002
        description:
          type: string
          description: 'Room Request Description.'
          example: 'Air conditioning (RMA 2)'
    RoomRequestApiResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorData'
        data:
          $ref: '#/components/schemas/RoomRequestResponse'
    RoomRequestData:
      type: object
      properties:
        confirmationNumber:
          type: string
          description: 'Reservation Confirmation Number.'
          example: 9187XT0000122
        status:
          type: string
          description: 'Reservation Primary Status.'
          example: Confirmed
        onPropertyStatus:
          type: string
          description: 'Reservation On Property Status.'
          example: InHouse
        roomRequest:
          type: array
          items:
            $ref: '#/components/schemas/RoomRequest'
    RoomRequestResponse:
      type: object
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/RoomRequestData'
    StayDate:
      type: object
      properties:
        date:
          type: string
          description: 'Individual stay date'
          format: 'yyyy-MM-dd HH:mm:ss'
          example: null
        rateCode:
          type: string
          description: 'Rate plan code for this date'
          example: null
        rate:
          type: string
          description: 'Rate plan name for this date'
          example: null
        roomUnit:
          type: string
          description: 'Room unit/number for this date'
          example: null
        amount:
          type: number
          description: 'Stay amount for this date'
          format: double
          example: null
        tax:
          type: number
          description: 'Tax amount for this date'
          format: double
          example: null
        fee:
          type: number
          description: 'Fee amount for this date'
          format: double
          example: null
        amountWithTaxAndFees:
          type: number
          description: 'Total amount including tax and fee for this date'
          format: double
          example: null
  requestBodies:
    ReservationRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ReservationRequest'
      required: true
  securitySchemes:
    oauth2_authentication:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '/gwauth/token?grant_type=client_credentials&source_ip=127.0.0.1&business_context=Default&user_type=Hotel'
          scopes: {  }
      x-base64-encode-client-credentials: true
security:
  -
    oauth2_authentication: []
x-devstudio-disable-autoprovisioned-credentials: true
x-project-id: shsphubreservationv1
