openapi: 3.0.2
info:
  title: Reservation APIs
  description: API supported for Property Reservation
  version: 1.0.0
  contact:
    name: API Support
    url: 'https://www.lastminute.com'
    email: info@lastminute.com
  termsOfService: 'https://www.lastminute.com/terms/terms-and-conditions.html'
servers:
  - url: 'https://qa-partner.momorooms.com'
    description: qa server
  - url: 'https://partner.momorooms.com'
    description: production server
tags:
  - name: Reservation
    description: API related to Reservation.
paths:
  /v1/reservation:
    post:
      description: API supported for Property Reservation
      operationId: CreateReservation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReservationRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationResponse'
        '400':
          description: Client Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationClientErrorResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Create Reservation
  /v1/reservation/cancel:
    post:
      description: API which will do the cancellation of the given reservation.
      operationId: CancelReservation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReservationCancelRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationCancelResponse'
        '400':
          description: Client Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationCancelClientErrorResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Cancel Reservation
  /v1/reservations/list:
    post:
      description: API to retrieve all the reservations for given criteria.
      operationId: ReservationList
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReservationListRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationListResponse'
        '400':
          description: Client Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationErrorResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Reservation List
  /v1/reservations/detail:
    post:
      description: API to retrieve details the reservations for given criteria.
      operationId: ReservationDetail
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReservationDetailRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationDetailResponse'
        '400':
          description: Client Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ReservationErrorResponse'
        '500':
          description: Server Side Error
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ServerErrorResponse'
      summary: Reservation Detail
components:
  schemas:
    ReservationErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ReservationError'
    ReservationCancelRequest:
      type: object
      required:
        - reservationId
        - cancelReason
      properties:
        reservationId:
          type: integer
          format: int64
          description: Reservation ID to be cancelled.
        cancelReason:
          type: string
          description: Reason for the cancellation.
    ReservationCancelResponse:
      type: object
      properties:
        cancelStatus:
          type: string
          description: Cancellation Status <table> <thead> <tr> <th>Cancellation Status</th> <th>Cancellation Value</th> </tr> </thead> <tbody> <tr><td>Cancellation is in Success</td><td>SUCCESS</td></tr><tr><td>Cancellation is in Failed</td><td>FAILED</td></tr>   </tbody> </table>
        currencyCode:
          type: string
          description: Currency code of the refundAmount
        refundAmount:
          type: string
          description: The amount to be refunded to the customer after cancellation. Decimal value represented as string to preserve precision.
    ReservationCancelClientErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/CancellationClientError'
    ReservationCancelServerErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/CancellationServerError'
    ReservationResponse:
      type: object
      properties:
        reservationId:
          type: integer
          format: int64
          description: Reservation ID created and used for future reference.
        reservationStatus:
          type: string
          description: Reservation Status <table> <thead> <tr> <th>Reservation Status</th> <th>Reservation Value</th> </tr> </thead> <tbody> <tr><td>Reservation is in Success</td><td>Success</td></tr><tr><td>Reservation is in Failed</td><td>Failed</td></tr>   </tbody> </table>
    ReservationClientErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ReservationClientError'
    ServerErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ServerError'
    ReservationError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>3001</td><td>Reservation does not exist</td></tr> </tbody> </table>'
    ReservationClientError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>4001 </td><td> Missing Mandatory Parameter - Property ID </td></tr> <tr><td>4002 </td><td> Missing Mandatory Parameter - CheckIn </td></tr> <tr><td>4003 </td><td> Missing Mandatory Parameter - checkOut </td></tr> <tr><td>4004 </td><td> Missing Mandatory Parameter - Market Code </td></tr> <tr><td>4005 </td><td> Missing Mandatory Parameter - productType </td></tr> <tr><td>4006 </td><td> RoomStay is required, Please provide a valid value </td></tr> <tr><td>4007 </td><td> RoomStay Id is required, Please provide a valid value </td></tr> <tr><td>4008 </td><td> Adult Count is required, Please provide a valid value </td></tr> <tr><td>4009 </td><td> Guest is required, Please provide a valid value </td></tr> <tr><td>4010 </td><td> Number of Child per room must be within 8 </td></tr> <tr><td>4011 </td><td> Number of Adult per room must be within 9 </td></tr> <tr><td>4012 </td><td> Invalid no of rooms requested - max 9 rooms supported </td></tr> <tr><td>4013 </td><td> Number of propertyId requested must be within 100 </td></tr> <tr><td>4014 </td><td> CheckIn must be in the future </td></tr> <tr><td>4015 </td><td> CheckOut must be in the future </td></tr> <tr><td>4016 </td><td> CheckIn/CheckOut must be in the format: yyyy-MM-dd </td></tr> <tr><td>4017 </td><td> Missing Mandatory Parameter - Guest Email </td></tr> <tr><td>4018 </td><td> Invalid format for Guest Email </td></tr> <tr><td>4019 </td><td> Missing mandatory parameter - Primary Guest Phone Number </td></tr> <tr><td>4020 </td><td> CheckOut must be after checkIn </td></tr> <tr><td>4023 </td><td> Invalid Value for Market, Please provide a valid value FR, DE, IT, ES, GB </td></tr> <tr><td>1022 </td><td> Invalid Value for Product Type, Please provide a valid value Hotel, Package </td></tr> <tr><td>4024 </td><td> PropertyId is required, Please provide a valid value </td></tr> <tr><td>4025 </td><td> Missing Mandatory Parameter - LM Reservation ID </td></tr> <tr><td>4026 </td><td> Missing mandatory parameter - partnerReservationId </td></tr> <tr><td>4027 </td><td> Missing Mandatory Parameter - Product ID </td></tr> <tr><td>4028 </td><td> Missing Mandatory Parameter - RateType </td></tr> <tr><td>4029 </td><td> PropertyId not mapped for distrubution </td></tr> <tr><td>4030 </td><td> Reservation Already Exists with reservationId - <ID> </td></tr> <tr><td>4035 </td><td> Validation Failed for reservationId - <ID> </td></tr> </tbody> </table>'
    ServerError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>500 </td><td> An unexpected error occurred. Please try again later. </td></tr>  </tbody> </table>'
    CancellationServerError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>500 </td><td> An unexpected error occurred. Please try again later. </td></tr>  </tbody> </table>'
    CancellationClientError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
          description: 'Possible error responses:  <table> <thead> <tr> <th>ErrorCode</th> <th>ErrorDesc</th> </tr> </thead> <tbody> <tr><td>4025 </td><td> Missing Mandatory Parameter - LM Reservation ID </td></tr> <tr><td>4031 </td><td> Reservation already cancelled </td></tr> <tr><td>4032 </td><td> Unable to Cancel the reservation, Please Try Again </td></tr> <tr><td>4033 </td><td> Cancel Penalty is Not Available </td></tr> <tr><td>4034 </td><td> Reservation does not exist </td></tr> <tr><td>4036 </td><td> Reason for Cancel is Mandatory </td></tr> </tbody> </table>'
    ReservationListRequest:
      type: object
      description: 'Request to fetch reservation list. Only one filter criteria can be provided at a time: partnerReservationIds, reservationIds, check-in date range (checkInFrom & checkInTo), or booking date range (bookedFrom & bookedTo).'
      allOf:
        - oneOf:
            - required:
                - partnerReservationIds
              properties:
                partnerReservationIds:
                  type: array
                  description: List of partner reservation IDs to filter
                  minItems: 1
                  items:
                    type: string
            - required:
                - reservationIds
              properties:
                reservationIds:
                  type: array
                  description: List of reservation IDs to filter
                  minItems: 1
                  items:
                    type: integer
                    format: int64
            - required:
                - checkInStartDate
                - checkInEndDate
              properties:
                checkInStartDate:
                  type: string
                  format: date
                  description: Start date for check-in range filter in the format (yyyy-MM-dd)
                checkInEndDate:
                  type: string
                  format: date
                  description: End date for check-in range filter in the format (yyyy-MM-dd)
            - required:
                - bookingStartDate
                - bookingEndDate
              properties:
                bookingStartDate:
                  type: string
                  format: date
                  description: Start date for booking date range filter in the format (yyyy-MM-dd)
                bookingEndDate:
                  type: string
                  format: date
                  description: End date for booking date range filter in the format (yyyy-MM-dd)
    ReservationDetailRequest:
      type: object
      description: 'Request to fetch reservation list. Only one filter criteria can be provided at a time: partnerReservationIds, reservationIds, check-in date range (checkInFrom & checkInTo), or booking date range (bookedFrom & bookedTo).'
      allOf:
        - oneOf:
            - required:
                - partnerReservationIds
              properties:
                partnerReservationIds:
                  type: array
                  description: List of partner reservation IDs to filter
                  minItems: 1
                  items:
                    type: string
            - required:
                - reservationIds
              properties:
                reservationIds:
                  type: array
                  description: List of reservation IDs to filter
                  minItems: 1
                  items:
                    type: integer
                    format: int64
            - required:
                - checkInStartDate
                - checkInEndDate
              properties:
                checkInStartDate:
                  type: string
                  format: date
                  description: Start date for check-in range filter in the format (yyyy-MM-dd)
                checkInEndDate:
                  type: string
                  format: date
                  description: End date for check-in range filter in the format (yyyy-MM-dd)
            - required:
                - bookingStartDate
                - bookingEndDate
              properties:
                bookingStartDate:
                  type: string
                  format: date
                  description: Start date for booking date range filter in the format (yyyy-MM-dd)
                bookingEndDate:
                  type: string
                  format: date
                  description: End date for booking date range filter in the format (yyyy-MM-dd)
    ReservationListResponse:
      type: object
      description:
        Response for the reservation list API.
      properties:
        reservations:
          type: array
          description: List of reservations.
          items:
            $ref: '#/components/schemas/ReservationSummary'
    ReservationDetailResponse:
      type: object
      description:
        Response for the reservation Detail API.
      properties:
        reservations:
          type: array
          description: List of reservation details.
          items:
            $ref: '#/components/schemas/ReservationDetailedResponse'
    ReservationSummary:
      type: object
      description: Summary reservation response returned when `showDetails` is false.
      properties:
        partnerReservationId:
          type: string
          description: Reservation ID from the partner side for reference.
        reservationId:
          type: integer
          format: int64
          description: momorooms reservation ID.
        bookingStatus:
          type: string
          description: Current status of the reservation (e.g. Booked, Cancelled).
    ReservationDetailedResponse:
      type: object
      description: >
        Detailed reservation response returned when `showDetails` is true.
        Fields returned vary based on `bookingStatus`:
        - **Booked**: returns all fields including `bookingAmount`, `roomStays`. Does not return `cancelDate` or `refundAmount`.
        - **Cancelled**: returns `cancelDate`, `refundAmount` and `bookingAmount`. Does not return `roomStays`.
      properties:
        partnerReservationId:
          type: string
          description: Reservation ID from the partner side for reference.
        reservationId:
          type: integer
          format: int64
          description: momorooms reservation ID.
        bookDate:
          type: string
          format: date-time
          description: Date and time when the reservation was booked.
        cancelDate:
          type: string
          format: date
          description: Date when the reservation was cancelled. Present only when `bookingStatus` is Cancelled.
        bookingAmount:
          type: number
          description: Total booking amount. Present for both Booked and Cancelled statuses.
        refundAmount:
          type: number
          description: Amount to be refunded. Present only when `bookingStatus` is Cancelled.
        currency:
          type: string
          description: Currency code for the booking/refund amount.
        bookingStatus:
          type: string
          description: Current status of the reservation (e.g. Booked, Cancelled).
        roomStays:
          type: array
          description: List of room stays with cancel penalty details. Present only when `bookingStatus` is Booked.
          items:
            $ref: '#/components/schemas/ReservationListRoomStay'
        checkInDate:
          type: string
          format: date
          description: Check-in date in the format (yyyy-MM-dd).
        checkOutDate:
          type: string
          format: date
          description: Check-out date in the format (yyyy-MM-dd).
    ReservationListRoomStay:
      type: object
      description: Room stay details including cancellation penalty windows.
      properties:
        id:
          type: integer
          format: int32
          description: Unique ID for the room stay.
        cancelPenalties:
          type: array
          description: List of cancellation penalty windows applicable to this room stay.
          items:
            $ref: '#/components/schemas/CancelPenaltyWindow'
    CancelPenaltyWindow:
      type: object
      description: Defines a cancellation penalty window with applicable dates and penalty amount.
      properties:
        penaltyStartDate:
          type: string
          format: yyyy-MM-dd'T'HH:mm:ssXXX
          description: Start date of the penalty window in the format (yyyy-MM-dd).
        penaltyEndDate:
          type: string
          format: yyyy-MM-dd'T'HH:mm:ssXXX
          description: End date of the penalty window in the format (yyyy-MM-dd).
        penaltyAmount:
          type: number
          description: Penalty amount applicable within this window.
        currency:
          type: string
          description: Currency code for the penalty amount.
    ReservationListError:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorDescription:
          type: string
    ReservationRequest:
      type: object
      required:
        - propertyId
        - reservationId
        - checkIn
        - checkOut
        - market
        - rateType
        - productType
        - roomStays
      properties:
        propertyId:
          description: 'momorooms ID of the property against which reservation is triggered.'
          type: integer
          format: int64
        reservationId:
          type: integer
          format: int64
          description: Reservation Id for as returned in the Quote response associated with the Reservation.
        partnerReservationId:
          type: integer
          format: int64
          description: Reservation ID from the Partner Side for reference.
        checkIn:
          type: string
          description: Date of check-in in the format (yyyy-mm-dd)
          format: date
        checkOut:
          type: string
          description: Date of checkout (not included in stay) in the format (yyyy-mm-dd)
          format: date
        market:
          type: string
          description: ISO country codes for the market <table> <thead> <tr> <th>Country Name </th> <th>Country code</th> </tr></thead><tbody> <tr> <td>Austria</td> <td>AT</td> </tr> <tr> <td>Belgium</td> <td>BE</td> </tr> <tr> <td>Bulgaria</td> <td>BG</td> </tr> <tr> <td>Chile</td> <td>CL</td> </tr> <tr> <td>Croatia</td> <td>HR</td> </tr> <tr> <td>Cyprus</td> <td>CY</td> </tr> <tr> <td>Czechia</td> <td>CZ</td> </tr> <tr> <td>Denmark</td> <td>DK</td> </tr> <tr> <td>Estonia</td> <td>EE</td> </tr> <tr> <td>Finland</td> <td>FI</td> </tr> <tr> <td>France</td> <td>FR</td> </tr> <tr> <td>Germany</td> <td>DE</td> </tr> <tr> <td>Hungary</td> <td>HU</td> </tr> <tr> <td>Iceland</td> <td>IS</td> </tr> <tr> <td>India</td> <td>IN</td> </tr> <tr> <td>Ireland</td> <td>IE</td> </tr> <tr> <td>Italy</td> <td>IT</td> </tr> <tr> <td>Latvia</td> <td>LV</td> </tr> <tr> <td>Lithuania</td> <td>LT</td> </tr> <tr> <td>Luxembourg</td> <td>LU</td> </tr> <tr> <td>Malta</td> <td>MT</td> </tr> <tr> <td>Mexico</td> <td>MX</td> </tr> <tr> <td>Netherlands</td> <td>NL</td> </tr> <tr> <td>Norway</td> <td>NO</td> </tr> <tr> <td>Poland</td> <td>PL</td> </tr> <tr> <td>Portugal</td> <td>PT</td> </tr> <tr> <td>Romania</td> <td>RO</td> </tr> <tr> <td>Slovakia</td> <td>SK</td> </tr> <tr> <td>Slovenia</td> <td>SI</td> </tr> <tr> <td>Spain</td> <td>ES</td> </tr> <tr> <td>Sweden</td> <td>SE</td> </tr> <tr> <td>Switzerland</td> <td>CH</td> </tr> <tr> <td>United Kingdom</td> <td>GB</td> </tr> <tr> <td>United States of America</td> <td>US</td> </tr> <tr> <td>Argentina</td> <td>AR</td> </tr> <tr> <td>Greece</td> <td>GR</td> </tr></tbody></table>
        rateType:
          type: string
          description: 'Parameter denoting for which kind of rate is the request triggered as in below table <table> <thead> <tr> <th>Scenario</th> <th>Rate Type</th> </tr> </thead> <tbody> <tr><td>Regular Rate</td><td>BAR</td></tr> </tbody></table>'
        productType:
          type: string
          description: 'Parameter denoting for which kind of product is the request triggered as in below table <table> <thead> <tr> <th>Scenario</th> <th>Search Path</th> </tr> </thead> <tbody> <tr><td>Request includes only hotel accommodations</td><td>Hotel</td></tr> <tr><td>Request includes only packages bundled with hotel stays</td><td>Package</td></tr></tbody></table>'
        roomStays:
          type: array
          maxItems: 9
          minItems: 1
          description: Collection for holding the guest details for each room requested. Collection to be repeated for each room.
          items:
            $ref: '#/components/schemas/RoomStay'
    RoomStay:
      type: object
      required:
        - id
        - productId
        - adultCount
        - guestDetails
      properties:
        id:
          type: integer
          format: int32
          description: Unique identifier for each room stay in the reservation. Room ids must start at 0 and increment by 1 for each additional room (0,1,2,...).
        productId:
          type: integer
          description: ID of the product against which the reservation is triggered. Product ID should be one from the propertyId.
          format: int64
        adultCount:
          type: integer
          format: int32
          minimum: 1
          maximum: 9
          description: Number of Adults in the party mix.
        childAges:
          type: array
          maxItems: 8
          description: 'List of ages of the children in the party mix.Comma separated values. Example - [2,5] denotes 2 children in the party mix of ages 2 & 5.'
          items:
            type: integer
            format: int32
        guestDetails:
          type: array
          maxItems: 9
          minItems: 1
          description: Collection for holding the guest details for each room requested
          items:
            $ref: '#/components/schemas/GuestDetail'
    GuestDetail:
      type: object
      required:
        - firstName
        - contact
      properties:
        firstName:
          type: string
          description: First Name of the Guest
        lastName:
          type: string
          description: Last Name of the Guest
        primary:
          type: boolean
          description: Is this Guest is Primary Guest
        guestType:
          type: string
          description: Guest Type <table> <thead> <tr> <th>Guest Type Name</th> <th>Guest Type</th> </tr> </thead> <tbody> <tr><td>Guest is Adult</td><td>Adult</td></tr> <tr><td>Guest is Child</td><td>Child</td></tr>  </tbody> </table>
        contact:
          $ref: '#/components/schemas/GuestContact'
    GuestContact:
      type: object
      description: Guest Contact details needed only for Primary Guest for any communication
      properties:
        email:
          type: string
          description: Guest Email address
        phone:
          type: string
          description: Guest Email Phone number
  securitySchemes:
    oAuthSecurity:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://qa-partner.momorooms.com/auth/oauth/token
          scopes:
            read_rooms: sample scope to execute read operations
            write_rooms: sample scope to execute write operations

security:
  - oAuthSecurity:
      - read_rooms
      - write_rooms

