openapi: 3.0.3
info:
title: "LOS Pricing API"
description: "LOS Pricing APIs are only for to set/get the price and not support setting inventory yet, hence, partner will need to call other endpoint (SetARIV2) to set the inventory too."
version: "0.0.1"
servers:
- url: https://sandbox-distribution-xml.agoda.com
description: "new api service"
security: []
paths:
/api/rate/fplos:
post:
summary: Set or Update LOS Pricing
externalDocs:
url: https://github.com/agoda-com/ycs5-pricing-api-spec/blob/master/docs/los-pricing.md
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PostRateLosRequest'
responses:
200:
description: Price Rule already setted up
content:
application/json:
schema:
$ref: '#/components/schemas/PostRateLosResponse'
403:
description: Failing request
content:
application/json:
schema:
$ref: '#/components/schemas/GenericResponse'
/api/rate/fplos/search:
post:
summary: Get LOS Pricing
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SearchLosRequest'
responses:
200:
description: Create response
content:
application/json:
schema:
$ref: '#/components/schemas/SearchLosResponse'
403:
description: Failing request
content:
application/json:
schema:
$ref: '#/components/schemas/GenericResponse'
components:
schemas:
PropertyId:
type: integer
format: int32
description: Valid Agoda Property ID that partner has access to
example: 123
RoomId:
type: integer
format: int32
description: |
Agoda Room ID related to the property inventory element.
Agoda active Room IDs can be returned with Getproduct request.
example: 12301
RatePlanId:
type: integer
format: int32
description: Agoda Rateplan ID related to a particular offer active on a room.
Agoda active Rate Type IDs can be returned with Getproduct request.
Currency:
type: string
description: Rate plan's rate currency (must be the same currency as set up in property level)
example: USD
LOSPrice:
type: object
required:
- los
- value
properties:
los:
type: integer
description: Length of Stay
value:
type: number
description: Price Value (with the currrency described in property level)
Occupancy:
type: object
required:
- min
- max
properties:
min:
type: integer
description: minimum occupancy
max:
type: integer
description: maximum occupancy
OccupancyPrice:
type: object
required:
- occupancy
- prices
description: Occupancy price object
properties:
occupancy:
$ref: '#/components/schemas/Occupancy'
prices:
type: array
items:
$ref: '#/components/schemas/LOSPrice'
OfferRate:
type: object
required:
- checkIn
- occupancyPrices
properties:
checkIn:
$ref: '#/components/schemas/CheckInDateRange'
occupancyPrices:
type: array
items:
$ref: '#/components/schemas/OccupancyPrice'
CheckInDateRange:
required:
- start
- end
description: Date range of interested check-in date
type: object
properties:
start:
type: string
format: "YYYY-MM-DD"
description: Start of check-in date range to get rate in the format YYYY-MM-DD
example: "2021-12-10"
end:
type: string
description: End of check-in date range to get rate in the format YYYY-MM-DD
format: "YYYY-MM-DD"
example: "2021-12-31"
LOS:
required:
- start
- end
properties:
start:
type: integer
format: int32
description: Start length of stay range
example: 1
end:
type: integer
format: int32
description: End length of stay range
example: 10
RateList:
description: Rate list for each check-in date
properties:
checkInDate:
type: string
format: "YYYY-MM-DD"
description: "Check-in date"
example: "2022-03-02"
rate:
$ref: "#/components/schemas/Rate"
restriction:
$ref: "#/components/schemas/RateRestriction"
Rate:
properties:
currency:
$ref: "#/components/schemas/Currency"
prices:
description: Price List
type: array
items:
$ref: "#/components/schemas/Price"
Price:
description: Price object
type: object
properties:
los:
type: integer
description: Length of stay
example: 1
value:
type: number
description: Price Value (with the currrency described in property level)
example: 123.45
occupancy:
type: object
properties:
min:
type: integer
description: minimum occupancy
max:
type: integer
description: maximum occupancy
Closed:
type: boolean
description: Controls if rate type is open for sale or closed to sale. Close will stop room type regular inventory being sold even if inventory is available.
default: false
Cta:
type: boolean
default: false
description: |
Close to arrival: Make a room unavailable to book if the guest check-in on a certain date.
Set to make rate type open or closed for arrival on this date. Customer can still stay through this date if they arrive on past date.
Ctd:
type: boolean
default: false
description: |
Close to departure: Make a room unavailable to book if the guest check-out on a certain date.
Set to make rate type open or closed for departure on this date. Customer can still stay through this date if they depart on future date.
MinStay:
type: integer
format: int32
description: |
Minimum length of stay that is required to search and book this room type. minStay cannot be greater than maxStay.
default: 1
MaxStay:
type: integer
format: int32
description: |
Maximum length of stay that is required to search and book this room type. maxStay cannot be less than minStay.
-1 stands for infinity, or no maxStay defined
default: -1
MinStayThrough:
type: integer
format: int32
description: |
Minimum stay through - Minimum length of stay that is required to search and book this room type for stay through.
default: -1
MinAdvPurchase:
type: integer
format: int32
description: |
Minimum Days in advance that rate must be booked to be eligible for a specific rateplan.
default: -1
maximum: 90
MaxAdvPurchase:
type: integer
format: int32
description: |
Maximum Days in advance that rate must be booked to be eligible for a specific rateplan.
default: -1
maximum: 365
LosRestriction:
type: string
description: |
Restriction per los, only valid if closed flag is false. Length of this field is equal to max LOS sent in the request.
Example, date: 2021-12-01 and losRestriction: 1110111101, this means user won't see the allotment for 4 and 9 los, if he wants to checkin on this date.
example: "1110111101"
SetRateRestriction:
description: the object inidicate the default rate restriction
type: object
required:
- startDate
- endDate
properties:
startDate:
type: string
format: "YYYY-MM-DD"
description: "Start date when this restrcition will be applied"
example: "2022-03-02"
endDate:
type: string
format: "YYYY-MM-DD"
description: "End date when this restrcition will be applied"
example: "2022-03-02"
closed:
$ref: "#/components/schemas/Closed"
cta:
$ref: "#/components/schemas/Cta"
ctd:
$ref: "#/components/schemas/Ctd"
minStay:
$ref: "#/components/schemas/MinStay"
maxStay:
$ref: "#/components/schemas/MaxStay"
minStayThrough:
$ref: "#/components/schemas/MinStayThrough"
minAdvPurchase:
$ref: "#/components/schemas/MinAdvPurchase"
maxAdvPurchase:
$ref: "#/components/schemas/MaxAdvPurchase"
losRestriction:
$ref: "#/components/schemas/LosRestriction"
Offer:
description: Offer object
type: object
required:
- roomId
- ratePlanId
- rates
properties:
roomId:
$ref: "#/components/schemas/RoomId"
ratePlanId:
$ref: "#/components/schemas/RatePlanId"
rates:
type: array
items:
$ref: '#/components/schemas/OfferRate'
restrictions:
type: array
items:
$ref: '#/components/schemas/SetRateRestriction'
RateRestriction:
description: the object inidicate the rate restriction
type: object
properties:
closed:
$ref: "#/components/schemas/Closed"
cta:
$ref: "#/components/schemas/Cta"
ctd:
$ref: "#/components/schemas/Ctd"
minStay:
$ref: "#/components/schemas/MinStay"
maxStay:
$ref: "#/components/schemas/MaxStay"
minStayThrough:
$ref: "#/components/schemas/MinStayThrough"
minAdvPurchase:
$ref: "#/components/schemas/MinAdvPurchase"
maxAdvPurchase:
$ref: "#/components/schemas/MaxAdvPurchase"
losRestriction:
$ref: "#/components/schemas/LosRestriction"
# Request/Response Object
GenericResponse:
description: General Api response, to indicate the operation's status
type: object
properties:
status:
type: string
enum: [SUCCESS,ERROR]
description: Response status
example: ERROR
tuid:
type: string
description: A Track Unique Identifier (TUID) is an identifier which is guaranteed to be unique and it has a specific tracking purpose.
example: 49ecd740-34c9-11e9-bef4-137e7754803f
error:
type: object
properties:
code:
type: integer
description: error code
example: 1503
description:
type: string
description: Error description
example: |
Authentication failed: The resource requires authentication, which was not supplied with the request
SearchLosRequest:
type: object
description: The request body
required:
- propertyId
- roomId
- ratePlanId
- checkInDateRange
properties:
propertyId:
$ref: "#/components/schemas/PropertyId"
roomId:
$ref: "#/components/schemas/RoomId"
ratePlanId:
$ref: "#/components/schemas/RatePlanId"
checkInDateRange:
$ref: "#/components/schemas/CheckInDateRange"
los:
$ref: "#/components/schemas/LOS"
SearchLosResponse:
type: object
description: The search query result
properties:
propertyId:
$ref: "#/components/schemas/PropertyId"
roomId:
$ref: "#/components/schemas/RoomId"
ratePlanId:
$ref: "#/components/schemas/RatePlanId"
rates:
type: array
items:
$ref: "#/components/schemas/RateList"
PostRateLosRequest:
type: object
description: The setup/update price offer 's request
required:
- propertyId
- currency
- offers
properties:
propertyId:
$ref: "#/components/schemas/PropertyId"
currency:
$ref: "#/components/schemas/Currency"
offers:
type: array
items:
$ref: "#/components/schemas/Offer"
PostRateLosResponse:
type: object
properties:
status:
type: string
description: Response status
example: "SUCCESS"
tuid:
type: string
description: A Track Unique Identifier (TUID) is an identifier which is guaranteed to be unique and it has a specific tracking purpose.
example: 49ecd740-34c9-11e9-bef4-137e7754803f