Traveloka 3.1 Booking - Book API

The 3.1 Booking - Book API from Traveloka — 1 operation(s) for 3.1 booking - book.

Documentation

Specifications

Other Resources

OpenAPI Specification

traveloka-3-1-booking-book-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Traveloka Atlas 3.1 Booking - Book API
  version: ''
  description: "Traveloka Specification API for Accommodation Provider\n\n**General Notes**\n* Please ensure that the endpoint is configured to connect using **HTTPS via port 443.**\n* For fields with type \"String\", if there's no value, do not return empty string (e.g. \"\"), instead do not return the field at all\n\nThis API uses custom Basic Authentication.\n\nHow to get a token:\n- Combine username and password using a colon: [username:password]\n- Encode that using Base64\n- Example:\n  ```\n  echo -n 'user:pass' | base64\n  -> dXNlcjpwYXNz\n  ```\n\nThen use:\n```\nAuthorization: Basic dXNlcjpwYXNz\n```\n"
servers:
- url: http://localhost:8080
  description: Generated server url
security: []
tags:
- name: 3.1 Booking - Book
paths:
  /book:
    post:
      tags:
      - 3.1 Booking - Book
      summary: Book a booking
      description: This operation is for Traveloka to send booking details.
      operationId: book
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookRequest'
            examples:
              Simple booking:
                summary: A basic booking for a single adult in one room.
                description: Simple booking
                value:
                  requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                  uniqueId: 1223ertdq
                  numRooms: 1
                  numAdults: 1
                  numChildren: 0
                  checkInDate: '2016-03-29'
                  checkOutDate: '2016-03-31'
                  providerHotelId: '1058'
                  hotelRatePlanType: RETAIL
                  totalSearchRate:
                    currency: USD
                    fees: 10
                    taxes: 10
                    totalFare: 120
                  roomSpecs:
                  - providerHotelRoomId: '123'
                    availabilityToken: ROOM12345
                  rateType: PAY_NOW
              Booking with child:
                summary: A booking that includes a child and a special request.
                description: Booking with child
                value:
                  requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                  numRooms: 1
                  numAdults: 2
                  numChildren: 1
                  childrenAges:
                  - 7
                  checkInDate: '2021-08-27'
                  checkOutDate: '2021-08-28'
                  contact:
                    personTitle: MR
                    firstName: John
                    lastName: Musthafa
                    phone:
                    - '+62'
                    email: john@musthafa.com
                  guests:
                  - firstName: John
                    lastName: Musthafa
                  specialRequest: High Floor, Non Smoking Room
                  hotelRatePlanType: RETAIL
                  providerHotelId: IC;KULHA
                  locale: en_ID
                  roomSpecs:
                  - providerHotelRoomId: KDX
                    availabilityToken: 5TQ
                    promoIds: []
                  rateType: PAY_NOW
              Multiple room booking:
                summary: A booking for multiple rooms of the same type.
                description: Multiple room booking
                value:
                  requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                  uniqueId: 1223ertdq
                  numRooms: 3
                  numAdults: 3
                  numChildren: 0
                  childrenAges: []
                  checkInDate: '2021-12-14'
                  checkOutDate: '2021-12-15'
                  contact:
                    personTitle: MR
                    firstName: John
                    lastName: Musthafa
                    phone:
                    - '+62'
                    email: john@musthafa.com
                  guests:
                  - firstName: John
                    lastName: Musthafa
                  providerHotelId: '256164'
                  locale: en_ID
                  roomSpecs:
                  - providerHotelRoomId: TR2537680
                    availabilityToken: RP:TP5892505512028594917|N:ID|NA:Fix|SS:17|C:USD
                    promoIds: []
                  - providerHotelRoomId: TR2537680
                    availabilityToken: RP:TP5892505512028594917|N:ID|NA:Fix|SS:17|C:USD
                    promoIds: []
                  - providerHotelRoomId: TR2537680
                    availabilityToken: RP:TP5892505512028594917|N:ID|NA:Fix|SS:17|C:USD
                    promoIds: []
                  rateType: PAY_NOW
              Complex multiple room booking:
                summary: A booking for multiple rooms that includes children and special requests.
                description: Complex multiple room booking
                value:
                  requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                  numRooms: 3
                  numAdults: 3
                  numChildren: 3
                  childrenAges:
                  - 10
                  - 10
                  - 10
                  checkInDate: '2021-08-27'
                  checkOutDate: '2021-08-28'
                  contact:
                    personTitle: MR
                    firstName: John
                    lastName: Musthafa
                    phone:
                    - '+62'
                    email: john@musthafa.com
                  guests:
                  - firstName: John
                    lastName: Musthafa
                  specialRequest: High Floor, Connecting Rooms, Non Smoking Room
                  hotelRatePlanType: RETAIL
                  providerHotelId: IC;KULHA
                  locale: en_ID
                  roomSpecs:
                  - providerHotelRoomId: KDX
                    availabilityToken: 5TQ
                    promoIds: []
                  - providerHotelRoomId: KDX
                    availabilityToken: 5TQ
                    promoIds: []
                  - providerHotelRoomId: KDX
                    availabilityToken: 5TQ
                    promoIds: []
                  rateType: PAY_NOW
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookResponse'
              examples:
                Success:
                  summary: Booking created success
                  description: Success
                  value:
                    requestId: '1234567890'
                    bookingToken: DHB170816104137188
                    status: OK
                    bookSpec:
                      numRooms: 2
                      numAdults: 2
                      numChildren: 1
                      childrenAges:
                      - 5
                      checkInDate: '2023-10-01'
                      checkOutDate: '2023-10-02'
                      contact:
                        personTitle: MR
                        firstName: John
                        lastName: Doe
                        phone:
                        - '+6281234567890'
                        - '+6289876543210'
                        email: person@traveloka.com
                      guests:
                      - firstName: John
                        lastName: Doe
                        title: MR
                        passportNo: A12345678
                        passportCountryCode: ID
                      specialRequest: Late check-in
                      hotelRatePlanType: RETAIL
                      providerHotelId: '123123123'
                      totalSearchRate:
                        currency: IDR
                        totalFare: 1000000
                        taxes: 100000
                        fees: 50000
                      locale: en_ID
                      roomSpecs:
                      - providerHotelRoomId: '1234567890'
                        availabilityToken: ROOM12345
                        refundable: true
                        cancellationPolicy:
                          cancellationPolicyDescription: string
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2018-08-27T00:00:00.000+08:00'
                            cancellationFee: 120
                            currency: USD
                            nightCount: 0
                        noShowPolicy:
                          noShowDateTime: '2018-08-27T00:00:00.000+08:00'
                          noShowFee: 120
                          currency: USD
                          nightCount: 1
                        breakfastIncluded: true
                        mealPlan:
                          code: RO
                          pax:
                            adults: 2
                            children: 1
                        wifiIncluded: true
                        ccGuaranteeRequirement:
                          ccRequired: true
                          cvvRequired: true
                          addressRequired: true
                          csTokenRequired: false
                          supportedCCTypes:
                          - VISA
                        sellingRate:
                          currency: IDR
                          totalFare: 1000000
                          taxes: 100000
                          fees: 50000
                        sellingRateInfo:
                          fees:
                          - description: string
                            amount: 0.1
                          taxes:
                          - description: string
                            amount: 0.1
                          surcharges:
                          - description: string
                            amount: 0.1
                        additionalFees:
                          mandatoryFee: 5
                          mandatoryTax: 5
                          resortFee: 5
                          countryTaxFee: 5
                        promoIds:
                        - string
                        promoDescription: string
                      rateType: PAY_NOW
                    errors: []
                Error:
                  summary: Booking not available anymore
                  description: Error
                  value:
                    requestId: '1234567890'
                    bookingToken: DHB170816104137188
                    status: ALREADY_BOOKED
                    error:
                      errorId: PRICE_CHANGED
                      errorMessage: Price changed for this inventory
                    failureReason: NOT_AVAILABLE_ANYMORE
                    bookSpec:
                      numRooms: 2
                      numAdults: 2
                      numChildren: 1
                      childrenAges:
                      - 5
                      checkInDate: '2023-10-01'
                      checkOutDate: '2023-10-02'
                      contact:
                        personTitle: MR
                        firstName: John
                        lastName: Doe
                        phone:
                        - '+6281234567890'
                        - '+6289876543210'
                        email: person@traveloka.com
                      guests:
                      - firstName: John
                        lastName: Doe
                        title: MR
                        passportNo: A12345678
                        passportCountryCode: ID
                      specialRequest: Late check-in
                      hotelRatePlanType: RETAIL
                      providerHotelId: '123123123'
                      totalSearchRate:
                        currency: IDR
                        totalFare: 1000000
                        taxes: 100000
                        fees: 50000
                      locale: en_ID
                      roomSpecs:
                      - providerHotelRoomId: '1234567890'
                        availabilityToken: ROOM12345
                        refundable: true
                        cancellationPolicy:
                          cancellationPolicyDescription: string
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2018-08-27T00:00:00.000+08:00'
                            cancellationFee: 120
                            currency: USD
                            nightCount: 0
                        noShowPolicy:
                          noShowDateTime: '2018-08-27T00:00:00.000+08:00'
                          noShowFee: 120
                          currency: USD
                          nightCount: 1
                        breakfastIncluded: true
                        mealPlan:
                          code: RO
                          pax:
                            adults: 2
                            children: 1
                        wifiIncluded: true
                        ccGuaranteeRequirement:
                          ccRequired: true
                          cvvRequired: true
                          addressRequired: true
                          csTokenRequired: false
                          supportedCCTypes:
                          - VISA
                        sellingRate:
                          currency: IDR
                          totalFare: 1000000
                          taxes: 100000
                          fees: 50000
                        sellingRateInfo:
                          fees:
                          - description: string
                            amount: 0.1
                          taxes:
                          - description: string
                            amount: 0.1
                          surcharges:
                          - description: string
                            amount: 0.1
                        additionalFees:
                          mandatoryFee: 5
                          mandatoryTax: 5
                          resortFee: 5
                          countryTaxFee: 5
                        promoIds:
                        - string
                        promoDescription: string
                      rateType: PAY_NOW
                    errors:
                    - errorId: '3000'
                      errorSeverity: HIGH
                      errorMessage: UNEXPECTED_ERROR
                      timeStamp: '1763621523000'
                Price changed:
                  summary: Response for a simple booking where the price has changed.
                  description: Price changed
                  value:
                    requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                    bookingToken: DHB170816104137188
                    status: PRICE_CHANGED
                    bookSpec:
                      numRooms: 1
                      numAdults: 1
                      numChildren: 0
                      checkInDate: '2016-03-29'
                      checkOutDate: '2016-03-31'
                      providerHotelId: '1058'
                      hotelRatePlanType: RETAIL
                      totalSearchRate:
                        currency: USD
                        fees: 20
                        taxes: 10
                        totalFare: 150
                      roomSpecs:
                      - providerHotelRoomId: '123'
                        availabilityToken: ROOM12345
                        breakfastIncluded: true
                        mealPlan:
                          code: FB
                          pax:
                            adults: 1
                            children: 0
                        wifiIncluded: true
                        refundable: true
                        sellingRate:
                          currency: USD
                          totalFare: 190
                          taxes: 15
                          fees: 5
                        additionalFees:
                          mandatoryFee:
                            currency: USD
                            amount: 12
                          mandatoryTax:
                            currency: USD
                            amount: 12
                          resortFee:
                            currency: USD
                            amount: 12
                          countryTaxFee:
                            amount: 2
                            currency: USD
                        cancellationPolicy:
                          cancellationPolicyDescription: Full refund for cancellation before two days of check-in date
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2018-08-27T00:00:00.000+08:00'
                            cancellationFee: 15
                            currency: USD
                          - cancelDateTime: '2018-08-28T00:00:00.000+08:00'
                            cancellationFee: 17
                            currency: USD
                          - cancelDateTime: '2018-08-29T00:00:00.000+08:00'
                            nightCount: 1
                      rateType: PAY_NOW
                Successful booking with child:
                  summary: Successful response for a booking that includes a child.
                  description: Successful booking with child
                  value:
                    requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                    bookingToken: '1169'
                    status: OK
                    bookSpec:
                      providerHotelId: IC;KULHA
                      hotelRatePlanType: RETAIL
                      numRooms: 1
                      numAdults: 2
                      numChildren: 1
                      childrenAges:
                      - 7
                      checkInDate: '2021-08-27'
                      checkOutDate: '2021-08-28'
                      contact:
                        personTitle: MR
                        firstName: John
                        lastName: Musthafa
                        phone:
                        - '+62'
                        email: john@musthafa.com
                      guests:
                      - firstName: John
                        lastName: Musthafa
                      specialRequest: High Floor, Non Smoking Room
                      totalSearchRate:
                        currency: MYR
                        totalFare: 495.55
                        taxes: 70.55
                        fees: 0
                      locale: en_ID
                      roomSpecs:
                      - providerHotelRoomId: KDX
                        availabilityToken: 5TQ
                        refundable: true
                        cancellationPolicy:
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2021-08-27T18:00:00.000+08:00'
                            cancellationFee: 0
                            nightCount: 1
                            currency: MYR
                        breakfastIncluded: false
                        mealPlan:
                          code: FB
                          pax:
                            adults: 2
                            children: 1
                        wifiIncluded: false
                        sellingRate:
                          currency: MYR
                          totalFare: 495.55
                          taxes: 70.55
                          fees: 0
                        sellingRateInfo:
                          taxes:
                          - description: SalesTax 6.6% GST and 10% Revenue Surcharge
                            amount: 16.6
                        additionalFees:
                          mandatoryFee:
                            currency: USD
                            amount: 12
                          mandatoryTax:
                            currency: USD
                            amount: 12
                          resortFee:
                            currency: USD
                            amount: 12
                          countryTaxFee:
                            amount: 2
                            currency: USD
                        promoIds: []
                      rateType: PAY_NOW
                Successful multiple room booking:
                  summary: Successful response for a booking of multiple rooms.
                  description: Successful multiple room booking
                  value:
                    requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                    bookingToken: '1414833478960328704'
                    status: OK
                    bookSpec:
                      providerHotelId: '256164'
                      numRooms: 3
                      numAdults: 3
                      numChildren: 0
                      childrenAges: []
                      checkInDate: '2021-12-14'
                      checkOutDate: '2021-12-15'
                      contact:
                        personTitle: MR
                        firstName: John
                        lastName: Musthafa
                        phone:
                        - '+62'
                        email: john@musthafa.com
                      totalSearchRate:
                        currency: USD
                        totalFare: 114
                        taxes: 0
                        fees: 0
                      roomSpecs:
                      - providerHotelRoomId: TR2537680
                        availabilityToken: RP:TP5892505512028594917|N:ID|NA:Fix|SS:17|C:USD
                        cancellationPolicy:
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2021-12-08T00:00:00.000+08:00'
                            cancellationFee: 38
                            nightCount: 0
                            currency: USD
                        refundable: true
                        breakfastIncluded: false
                        mealPlan:
                          code: FB
                          pax:
                            adults: 1
                            children: 0
                        wifiIncluded: true
                        sellingRate:
                          currency: USD
                          totalFare: 38
                          taxes: 0
                          fees: 0
                        additionalFees:
                          mandatoryFee:
                            currency: USD
                            amount: 12
                          mandatoryTax:
                            currency: USD
                            amount: 12
                          resortFee:
                            currency: USD
                            amount: 12
                          countryTaxFee:
                            amount: 2
                            currency: USD
                        promoIds:
                        - PAYDAY1234
                        - CITIDISC20
                      - providerHotelRoomId: TR2537680
                        availabilityToken: RP:TP5892505512028594917|N:ID|NA:Fix|SS:17|C:USD
                        cancellationPolicy:
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2021-12-08T00:00:00.000+08:00'
                            cancellationFee: 38
                            nightCount: 0
                            currency: USD
                        refundable: true
                        breakfastIncluded: false
                        mealPlan:
                          code: FB
                          pax:
                            adults: 1
                            children: 0
                        wifiIncluded: true
                        sellingRate:
                          currency: USD
                          totalFare: 38
                          taxes: 0
                          fees: 0
                        additionalFees:
                          mandatoryFee:
                            currency: USD
                            amount: 12
                          mandatoryTax:
                            currency: USD
                            amount: 12
                          resortFee:
                            currency: USD
                            amount: 12
                          countryTaxFee:
                            amount: 2
                            currency: USD
                        promoIds:
                        - PAYDAY1234
                      - providerHotelRoomId: TR2537680
                        availabilityToken: RP:TP5892505512028594917|N:ID|NA:Fix|SS:17|C:USD
                        cancellationPolicy:
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2021-12-08T00:00:00.000+08:00'
                            cancellationFee: 38
                            nightCount: 0
                            currency: USD
                        refundable: true
                        breakfastIncluded: false
                        mealPlan:
                          code: FB
                          pax:
                            adults: 1
                            children: 0
                        wifiIncluded: true
                        sellingRate:
                          currency: USD
                          totalFare: 38
                          taxes: 0
                          fees: 0
                        additionalFees:
                          mandatoryFee:
                            currency: USD
                            amount: 12
                          mandatoryTax:
                            currency: USD
                            amount: 12
                          resortFee:
                            currency: USD
                            amount: 12
                          countryTaxFee:
                            amount: 2
                            currency: USD
                        promoIds:
                        - PAYDAY1234
                      rateType: PAY_NOW
                Successful complex multiple room booking:
                  summary: Successful response for a complex multi-room booking with children.
                  description: Successful complex multiple room booking
                  value:
                    requestId: c2a50648-abb7-45b0-af10-9af4e5bbcfee
                    bookingToken: '1173'
                    status: OK
                    bookSpec:
                      providerHotelId: IC;KULHA
                      hotelRatePlanType: RETAIL
                      numRooms: 3
                      numAdults: 3
                      numChildren: 3
                      childrenAges:
                      - 10
                      - 10
                      - 10
                      checkInDate: '2021-08-27'
                      checkOutDate: '2021-08-28'
                      contact:
                        personTitle: MR
                        firstName: John
                        lastName: Musthafa
                        phone:
                        - '+62'
                        email: john@musthafa.com
                      guests:
                      - firstName: John
                        lastName: Musthafa
                      specialRequest: High Floor, Connecting Rooms, Non Smoking Room
                      totalSearchRate:
                        currency: MYR
                        totalFare: 1486.65
                        taxes: 211.65
                        fees: 0
                      locale: en_ID
                      roomSpecs:
                      - providerHotelRoomId: KDX
                        availabilityToken: 5TQ
                        refundable: true
                        cancellationPolicy:
                          providerCancellationPolicyInfoList:
                          - cancelDateTime: '2021-08-27T18:00:00.000+08:00'
                            cancellationFee: 0
                            nightCount: 1
                            currency: MYR
                        breakfastIncluded: false
                        mealPlan:
                          code: FB
                          pax:
                            adults: 1
                            children: 1
                        wifiIncluded: false
                        sellingRate:
                          currency: MYR
                          totalFare: 1486.65
                          taxes: 211.65
                          fees: 0
                        sellingRateInfo:
                          taxes:
                          - description: SalesTax 6.6% GST and 10% Revenue Surcharge
                            amount: 16.6
                        additionalFees:
                          mandatoryFee:
                            currency: USD
                            amount: 12
                          mandatoryTax:
                            currency: USD
                            amount: 12
                          resortFee:
                            currency: USD
                            amount: 12
                          countryTaxFee:
                            amount: 2
                            currency: USD
                        promoIds: []
                      rateType: PAY_NOW
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookErrorResponse'
              examples:
                Error 400 example:
                  summary: This example is using INVALID_REQUEST_FIELD error
                  description: Error 400 example
                  value:
                    requestId: requestId
                    status: FAILED
                    error:
                      errorId: INVALID_REQUEST_FIELD
                      errorMessage: Invalid request field
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookErrorResponse'
              examples:
                Error 429 example:
                  summary: This example is using TOO_MANY_REQUEST error
                  description: Error 429 example
                  value:
                    requestId: requestId
                    status: FAILED
                    error:
                      errorId: TOO_MANY_REQUEST
                      errorMessage: Too many request
        '500':
          description: Something went wrong
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookErrorResponse'
              examples:
                Error 500 example:
                  summary: This example is using UNKNOWN_SERVER_ERROR error
                  description: Error 500 example
                  value:
                    requestId: requestId
                    status: FAILED
                    error:
                      errorId: UNKNOWN_SERVER_ERROR
                      errorMessage: Unknown server error
      servers:
      - url: http://localhost:8080
        description: Generated server url
components:
  schemas:
    HotelBookingRoomSpecRequest:
      required:
      - availabilityToken
      - breakfastIncluded
      - providerHotelRoomId
      - refundable
      - wifiIncluded
      type: object
      properties:
        providerHotelRoomId:
          type: string
          description: The unique identifier for the hotel room in the provider's system
          example: '1234567890'
        availabilityToken:
          type: string
          description: The token used to check availability for the hotel room
          example: availability-token-12345
        promoIds:
          type: array
          description: List of promo IDs applicable to the booking room
          example:
          - promo123
          - promo456
          items:
            type: string
            description: List of promo IDs applicable to the booking room
            example: '["promo123","promo456"]'
        promoDescription:
          type: string
          description: Description of the promo applied to the booking room
          example: 10% off for early booking
        guestInfo:
     

# --- truncated at 32 KB (60 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/traveloka/refs/heads/main/openapi/traveloka-3-1-booking-book-api-openapi.yml