Traveloka Rate API

The Rate API from Traveloka — 2 operation(s) for rate.

Documentation

Specifications

Other Resources

OpenAPI Specification

traveloka-rate-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LOKA Rate API
  version: 2.4.8
  description: ''
servers:
- url: https://api.travelokapartnersnetwork.com/v2/
  description: Production server
- url: https://api.travelokapartnersnetwork.com/v2/
  description: Staging server
security:
- OAuthStaging:
  - auth
tags:
- name: Rate
paths:
  /properties/:getRates:
    get:
      summary: Retrieve Price and availability for properties
      description: The Price/Rate API provides real-time access to pricing information for different accommodations. By utilizing this API, developers can retrieve cached rates for various room types, allowing users to compare prices and make cost-effective decisions.
      tags:
      - Rate
      parameters:
      - name: propertyIds
        in: query
        description: 'Property Id, You can use a single query parameter and separate multiple values with a comma (or any other delimiter). For example: GET /endpoint?id=a&id=b&id=c'
        required: true
        schema:
          type: array
          items:
            type: string
            example: '[72900, 48666]'
          minItems: 1
          maxItems: 100
      - name: checkInDate
        in: query
        description: Check-in date (YYYY-MM-DD)
        required: true
        schema:
          type: string
          example: '2024-01-01'
      - name: checkOutDate
        in: query
        description: Check-out date (YYYY-MM-DD)
        required: true
        schema:
          type: string
          example: '2024-01-02'
      - name: numRooms
        in: query
        description: Number of rooms
        required: true
        schema:
          type: integer
          example: 1
      - name: numAdults
        in: query
        description: Number of adults
        required: true
        schema:
          type: integer
          example: 1
      - name: numChildren
        in: query
        description: Number of children
        required: false
        schema:
          type: integer
          example: 1
          minimum: 0
      - name: childrenAges
        in: query
        description: A comma-separated list of ages of children
        required: false
        schema:
          type: array
          items:
            type: integer
            minimum: 1
            maximum: 15
            example: '[1]'
      - name: displayCurrency
        in: query
        description: Currency code
        required: true
        schema:
          type: string
          example: IDR
      - name: language
        in: query
        description: 'language. with default value ''en'', example: ''en'', ''id'''
        required: true
        schema:
          type: string
          example: id
      - name: userNationality
        in: query
        description: Nationality of the user using ISO 3166 Alpha-2, e.g ID
        required: true
        schema:
          type: string
          example: ID
      - name: isExtended
        in: query
        description: Enable if buyer need detailed rates
        example: true
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response with rates and availability
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRatesResponse'
        '400':
          description: Bad request. We cannot understand your intention.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '408':
          description: Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error408'
        '422':
          description: Request is understood, but the server couldn't process it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCode422PropertiesGetRatesResponse'
        '429':
          description: Exceed rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error429'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
      security:
      - api_gateway_lambda_authorizer: []
      x-amazon-apigateway-integration:
        httpMethod: GET
        uri: https://${stageVariables.afisaBasePath}/v3/properties/:getRates
        connectionType: VPC_LINK
        connectionId: ${stageVariables.afisaVpcLinkId}
        type: http_proxy
        requestParameters:
          integration.request.header.X-Authorizer-Client-Id: context.authorizer.claims.sub
          integration.request.header.X-Authorizer-Scopes: context.authorizer.claims.scope
          integration.request.header.X-Amzn-Apigateway-Request-Id: context.requestId
        passthroughBehavior: when_no_match
      servers:
      - url: https://api.travelokapartnersnetwork.com/v2
        description: Production
      - url: https://api.staging-travelokapartnersnetwork.com/v2
        description: Staging
  /properties/checkRate:
    post:
      summary: Price Check
      description: The Price Check API enables developers to dynamically calculate the estimated cost of a potential stay. By inputting check-in and check-out dates along with room preferences, users can obtain an instant quote for their desired booking before proceeding with the reservation. The result itself is dynamic and it is recommended to update the content regularly (XX-XX hours)
      tags:
      - Rate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckRateRequest'
      responses:
        '200':
          description: List of rates for rooms
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckRateResponse'
        '400':
          description: Bad request. We cannot understand your intention.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '408':
          description: Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error408'
        '422':
          description: Request is understood, but the server couldn't process it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorCode422PropertiesCheckRateResponse'
        '429':
          description: Exceed rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error429'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
      security:
      - api_gateway_lambda_authorizer: []
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: https://${stageVariables.afisaBasePath}/v3/properties/checkRate
        connectionType: VPC_LINK
        connectionId: ${stageVariables.afisaVpcLinkId}
        type: http_proxy
        requestParameters:
          integration.request.header.X-Authorizer-Client-Id: context.authorizer.claims.sub
          integration.request.header.X-Authorizer-Scopes: context.authorizer.claims.scope
          integration.request.header.X-Amzn-Apigateway-Request-Id: context.requestId
        passthroughBehavior: when_no_match
      servers:
      - url: https://api.travelokapartnersnetwork.com/v2
        description: Production
      - url: https://api.staging-travelokapartnersnetwork.com/v2
        description: Staging
components:
  schemas:
    Error401:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              description: "A code that identifies this type of error. \n - 401: Unauthorized."
              enum:
              - '401'
            message:
              type: string
              description: Error message
              example: Unauthorized, the token might be expired.
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    MealPlan:
      type: object
      properties:
        mealInclusionOptions:
          type: array
          items:
            $ref: '#/components/schemas/MealInclusionOption'
        mealPackageDetails:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MealPackageDetail'
    MealInclusionOption:
      type: object
      properties:
        mealInclusionDetails:
          type: object
          description: 'Map of meal type to meal inclusion detail. Meal type values can be: BREAKFAST, LUNCH, DINNER.'
          additionalProperties:
            $ref: '#/components/schemas/MealInclusionDetail'
    ExtraCharge:
      type: object
      properties:
        name:
          type: string
          description: ''
        currency:
          type: string
          description: currency
        value:
          type: string
          format: double
          description: Amount of the extra charge in the specified currency
        isIncluded:
          type: boolean
          description: Indicates if the extra charge is included in the total rate
      example:
        name: COUNTRY_TAX_ADJUSTMENT
        currency: USD
        value: '12.1'
        isIncluded: false
    CheckRateResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            rateStatus:
              type: string
              description: Rate status
              enum:
              - Rates Available
              - Rates Sold Out
            propertyId:
              type: string
              description: Property Id
              example: '72900'
            roomId:
              type: string
              description: Room Id
              example: '11477200'
            roomName:
              type: string
              description: Room name
              example: Deluxe Room
            roomType:
              type: string
              description: Room type
              example: Deluxe
            checkInDate:
              type: string
              description: Check-in date (YYYY-MM-DD)
              example: '2024-01-01'
            checkOutDate:
              type: string
              description: Check-out date (YYYY-MM-DD)
              example: '2024-01-02'
            numRooms:
              type: integer
              description: Number of rooms requested
              minimum: 1
              maximum: 10
              example: 1
            numAdults:
              type: integer
              description: Number of adults requested
              minimum: 1
              example: 1
            numChildren:
              type: integer
              description: Number of children requested
              minimum: 0
              example: 1
            maxOccupancy:
              type: integer
              description: Max adult occupancy per room
              minimum: 1
              example: 1
            maxChildOccupancy:
              type: integer
              description: Max child occupancy per room
              minimum: 0
              example: 1
            maxChildAge:
              type: integer
              description: Max child age
              minimum: 0
              example: 12
            roomOccupancy:
              $ref: '#/components/schemas/RoomOccupancy'
            bedArrangement:
              type: array
              items:
                $ref: '#/components/schemas/BedArrangement'
            mealType:
              type: string
              description: Meal type
              enum:
              - RO
              - BF
            roomMealPlan:
              $ref: '#/components/schemas/MealPlan'
            isRefundable:
              type: boolean
              description: Is booking can be refunded
              example: true
            benefits:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  name:
                    type: string
            extraBenefits:
              type: array
              items:
                $ref: '#/components/schemas/ExtraBenefits'
            totalRates:
              type: object
              properties:
                displayCurrency:
                  type: string
                  example: IDR
                displaySellAmount:
                  type: number
                  example: 1000000
                displayNetAmount:
                  type: number
                  example: 900000
                partnerCurrency:
                  type: string
                  example: IDR
                partnerSellAmount:
                  type: number
                  example: 1000000
                partnerNetAmount:
                  type: number
                  example: 900000
            nightlyRates:
              type: object
              properties:
                displayCurrency:
                  type: string
                  example: IDR
                displaySellAmount:
                  type: number
                  example: 1000000
                displayNetAmount:
                  type: number
                  example: 900000
                partnerCurrency:
                  type: string
                  example: IDR
                partnerSellAmount:
                  type: number
                  example: 1000000
                partnerNetAmount:
                  type: number
                  example: 900000
            charges:
              $ref: '#/components/schemas/Charge'
            extraCharges:
              type: array
              items:
                $ref: '#/components/schemas/ExtraCharge'
            rateKey:
              type: string
              description: Rate key
              example: povEwB3ZzsU2C6pd+6...
            cancellationPolicy:
              $ref: '#/components/schemas/CancellationPolicy'
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    MealTimeRange:
      type: object
      properties:
        from:
          $ref: '#/components/schemas/MealTime'
        to:
          $ref: '#/components/schemas/MealTime'
    Charge:
      type: array
      items:
        type: object
        properties:
          type:
            type: string
            enum:
            - TAX
            - FEE
          displayCurrency:
            type: string
            example: IDR
          displayAmount:
            type: number
            example: 50000
          isIncluded:
            type: boolean
            example: true
    Error408:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              description: "A code that identifies this type of error. \n - 408: Timeout."
              enum:
              - '408'
            message:
              type: string
              description: Error message
              example: Timeout. Your request exceeds the timeout limit.
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    RatesResponse:
      type: object
      properties:
        propertyId:
          type: string
          description: Property Id
          example: '72900'
        rateStatus:
          type: string
          description: Rate status
          enum:
          - AVAILABLE
          - NOT_AVAILABLE
        roomId:
          type: string
          description: Room Id
          example: '11477200'
        roomName:
          type: string
          description: Room name
          example: Deluxe Room
        roomType:
          type: string
          description: Room type
          example: Deluxe
        numRooms:
          type: integer
          description: Number of rooms requested
          minimum: 1
          maximum: 10
          example: 1
        numAdults:
          type: integer
          description: Number of adults requested
          minimum: 1
          example: 1
        numChildren:
          type: integer
          description: Number of children requested
          minimum: 0
          example: 1
        maxOccupancy:
          type: integer
          description: Max adult occupancy per room
          minimum: 1
          example: 1
        maxChildOccupancy:
          type: integer
          description: Max child occupancy per room
          minimum: 0
          example: 1
        maxChildAge:
          type: integer
          description: Max child age
          minimum: 0
          example: 12
        roomOccupancy:
          $ref: '#/components/schemas/RoomOccupancy'
        mealType:
          type: string
          description: Meal type
          enum:
          - RO
          - BF
        roomMealPlan:
          $ref: '#/components/schemas/MealPlan'
        isRefundable:
          type: boolean
          description: Is booking can be refunded
          example: true
        isSmokingAllowed:
          type: boolean
          description: Is smoking allowed in the room
          example: true
        totalRates:
          type: object
          properties:
            displayCurrency:
              type: string
              example: IDR
            displaySellAmount:
              type: number
              example: 1000000
            displayNetAmount:
              type: number
              example: 900000
            partnerCurrency:
              type: string
              example: IDR
            partnerSellAmount:
              type: number
              example: 1000000
            partnerNetAmount:
              type: number
              example: 900000
        extraCharges:
          type: array
          items:
            $ref: '#/components/schemas/ExtraCharge'
        rateKey:
          type: string
          description: Rate key
          example: povEwB3ZzsU2C6pd+6...
        cancellationPolicy:
          $ref: '#/components/schemas/CancellationPolicy'
        checkInPolicy:
          type: object
          properties:
            checkInDate:
              type: string
              description: Check-in date (YYYY-MM-DD)
              example: '2024-01-01'
            checkOutDate:
              type: string
              description: Check-out date (YYYY-MM-DD)
              example: '2024-01-02'
        extraBenefits:
          type: array
          items:
            $ref: '#/components/schemas/ExtraBenefits'
    Error429:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              description: "A code that identifies this type of error. \n - 429: Exceed rate limit."
              enum:
              - '429'
            message:
              type: string
              description: Error message
              example: Exceed rate limit. Your request count exceeds the allowed QPS rate limit.
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    CancellationPolicy:
      type: object
      properties:
        text:
          type: string
          description: Cancellation policy text
          example: Cancellation Policy
        displayText:
          type: string
          description: Display cancellation policy display text
          example: Cancellation Policy
        propertyTimezone:
          type: string
          description: Timezone of the property
          example: GMT+07:00
        policies:
          type: array
          items:
            type: object
            properties:
              startCancelDateTime:
                type: string
                format: date-time
                example: '2023-07-26T10:00:00+07:00'
                description: Start of cancellation period
              endCancelDateTime:
                type: string
                format: date-time
                example: '2023-07-30T10:00:00+07:00'
                description: End of cancellation period
              cancellationCharge:
                type: object
                properties:
                  currency:
                    type: string
                    description: Currency code for cancellation fee
                    example: IDR
                  amount:
                    type: string
                    description: Amount of cancellation fee
                    example: '100000'
    ExtraBenefits:
      type: object
      properties:
        id:
          type: string
          description: Extra Benefit id
        type:
          type: string
          description: Extra Benefit type
        valueList:
          type: array
          items:
            type: object
            properties:
              value:
                type: integer
                description: Extra Benefit value
              unit:
                type: string
                description: Extra Benefit unit
        renderedName:
          type: string
          description: Display name
          example: Free Breakfast for 2 pax
        additionalInfo:
          type: string
          description: Additional information
          example: Terms and conditions apply
    GetRatesResponse:
      type: object
      properties:
        total:
          type: integer
        data:
          $ref: '#/components/schemas/DisplayRatesResponse'
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    ExtendedRatesResponse:
      type: object
      properties:
        propertyId:
          type: string
          description: Property Id
          example: '72900'
        rateStatus:
          type: string
          description: Rate status
          enum:
          - AVAILABLE
          - NOT_AVAILABLE
        roomId:
          type: string
          description: Room Id
          example: '11477200'
        roomName:
          type: string
          description: Room name
          example: Deluxe Room
        roomType:
          type: string
          description: Room type
          example: Deluxe
        numRooms:
          type: integer
          description: Number of rooms requested
          minimum: 1
          maximum: 10
          example: 1
        numAdults:
          type: integer
          description: Number of adults requested
          minimum: 1
          example: 1
        numChildren:
          type: integer
          description: Number of children requested
          minimum: 0
          example: 1
        maxOccupancy:
          type: integer
          description: Max adult occupancy per room
          minimum: 1
          example: 1
        maxChildOccupancy:
          type: integer
          description: Max child occupancy per room
          minimum: 0
          example: 1
        maxChildAge:
          type: integer
          description: Max child age
          minimum: 0
          example: 12
        roomOccupancy:
          $ref: '#/components/schemas/RoomOccupancy'
        checkInDate:
          type: string
          description: Check-in date (YYYY-MM-DDTHH:mm:ss+GMT)
          example: 2024-01-01T10:00:00+0700
        checkOutDate:
          type: string
          description: Check-out date (YYYY-MM-DDTHH:mm:ss+GMT)
          example: 2024-01-01T10:00:00+0700
        mealType:
          type: string
          description: Meal type
          enum:
          - RO
          - BF
        roomMealPlan:
          $ref: '#/components/schemas/MealPlan'
        isRefundable:
          type: boolean
          description: Is booking can be refunded
          example: true
        isSmokingAllowed:
          type: boolean
          description: Is smoking allowed in the room
          example: true
        bedArrangement:
          type: array
          items:
            $ref: '#/components/schemas/BedArrangement'
        totalRates:
          type: object
          properties:
            displayCurrency:
              type: string
              example: IDR
            displaySellAmount:
              type: number
              example: 1000000
            displayNetAmount:
              type: number
              example: 900000
            partnerCurrency:
              type: string
              example: IDR
            partnerSellAmount:
              type: number
              example: 1000000
            partnerNetAmount:
              type: number
              example: 900000
        nightlyRates:
          type: object
          properties:
            displayCurrency:
              type: string
              example: IDR
            displaySellAmount:
              type: number
              example: 1000000
            displayNetAmount:
              type: number
              example: 900000
            partnerCurrency:
              type: string
              example: IDR
            partnerSellAmount:
              type: number
              example: 1000000
            partnerNetAmount:
              type: number
              example: 900000
        charges:
          $ref: '#/components/schemas/Charge'
        extraCharges:
          type: array
          items:
            $ref: '#/components/schemas/ExtraCharge'
        rateKey:
          type: string
          description: Rate key
          example: povEwB3ZzsU2C6pd+6...
        cancellationPolicy:
          $ref: '#/components/schemas/CancellationPolicy'
        checkInPolicy:
          type: object
          properties:
            checkInDate:
              type: string
              description: Check-in date (YYYY-MM-DDTHH:mm:ss+GMT)
              example: 2023-07-26T10:00:00+0700
            checkOutDate:
              type: string
              description: Check-out date (YYYY-MM-DDTHH:mm:ss+GMT)
              example: 2023-07-26T10:00:00+0700
        extraBenefits:
          type: array
          items:
            $ref: '#/components/schemas/ExtraBenefits'
        lastUpdatedTime:
          type: string
          description: Last updated time
          format: date-time
          example: '2023-07-26T10:00:00+07:00'
    MealPackageDetail:
      type: object
      properties:
        defaultLanguage:
          type: string
        name:
          type: object
          additionalProperties:
            type: string
        servingPlace:
          type: object
          additionalProperties:
            type: string
        servingType:
          type: array
          items:
            $ref: '#/components/schemas/MealSelectOption'
        cuisineSelection:
          type: array
          items:
            $ref: '#/components/schemas/MealSelectOption'
        dietaryRestriction:
          type: array
          items:
            $ref: '#/components/schemas/MealSelectOption'
        servingTime:
          type: object
          description: 'Map of meal type to serving time range. Meal type values can be: BREAKFAST, LUNCH, DINNER.'
          additionalProperties:
            $ref: '#/components/schemas/MealTimeRange'
        notes:
          type: object
          additionalProperties:
            type: string
    Error500:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              description: "A code that identifies this type of error. \n - 500: Server Error."
              enum:
              - '500'
            message:
              type: string
              description: Error message
              example: Server Error. Please contact our support team.
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    Error404:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              description: "A code that identifies this type of error. \n - 404: Not Found."
              enum:
              - '404'
            message:
              type: string
              description: Error message
              example: Not Found. The requested resource is not found.
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    ErrorCode422PropertiesCheckRateResponse:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          properties:
            code:
              type: string
              description: A code that identifies this type of error.
              enum:
              - AFIXXX
            message:
              type: string
              description: Error message
              example: Error message
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    ErrorCode422PropertiesGetRatesResponse:
      type: object
      properties:
        data:
          type: object
          example: null
        error:
          properties:
            code:
              type: string
              description: A code that identifies this type of error.
              enum:
              - AFIXXX
            message:
              type: string
              description: Error message
              example: Error message
            requestId:
              type: string
              description: You may use this value to refer this request when you ask us helping you fix the error.
              example: '1234567890'
    CheckRateRequest:
      type: object
      required:
      - propertyId
      - roomId
      - checkInDate
      - checkOutDate
      - numRooms
      - numAdults
      - displayCurrency
      - language
      - userNationality
      - rateKey
      properties:
        propertyId:
          type: string
          description: Property Id
          example: '72900'
        roomId:
          type: string
          description: Room Id
          example: '11477200'
        checkInDate:
          type: string
          description: Check-in date (YYYY-MM-DD)
          example: '2024-01-01'
        checkOutDate:
          type: string
          description: Check-out date (YYYY-MM-DD)
          example: '2024-01-02'
        numRooms:
          type: integer
          description: Number of rooms
          minimum: 1
        numAdults:
          type: integer
          description: Number of adults
          minimum: 1
          example: 1
        numChildren:
          type: integer
          description: Number of children
          minimum: 0
  

# --- truncated at 32 KB (36 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/traveloka/refs/heads/main/openapi/traveloka-rate-api-openapi.yml