getRateAmount
Update rates for one room type in a single hotel per one request message. You can update multiple rate plans and calendar date ranges within one message.
Endpoint:
POST https://supplyota.agoda.com/b2b/ota/v1/gentings/merchant/getRateAmount
Request
Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Authorization | refer to this document | Yes |
Body Structure
| No | Level 1 | Level 2 | Level 3 | Level 4 | Data Type | Mandatory | Description | Example |
|---|---|---|---|---|---|---|---|---|
| 1 | requestID | String | Y | Unique ID generated by the booking channel and returned in the response. Used to track each request. | c3a0e458155e11eebe560242ac120002 | |||
| 2 | timeStamp | String | Y | Request time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS.000Z | 2023-06-28T10:50:42.179Z | |||
| 3 | hotelCode | String | Y | Unique code assigned to each hotel | 8-FWHC | |||
| 4 | ratePlanCode | Array | Y | Array of rate plan entries (1 to n) | ||||
| 5 | code | String | Y | Rate plan code | FOTAC | |||
| 6 | invTypeCode | String | Y | Room type code | TRP | |||
| 7 | currency | String | Y | Currency code. Default currency: MYR | MYR | |||
| 8 | calendar | Array | Y | Array of calendar date entries (1 to n) | ||||
| 9 | start | String | Y | Rate effective start date. Format: YYYY-MM-DD | 2023-06-28 | |||
| 10 | end | String | Y | Rate effective end date. Format: YYYY-MM-DD | 2023-06-28 | |||
| 11 | occupancy | Array | Y | Array of occupancy-based rates (1 to n) | ||||
| 12 | ageQualifyingCode | Integer | Y | Guest type. Possible values: 8 (Children), 10 (Adults). Default = 10 | 10 | |||
| 13 | numberOfGuests | Integer | Y | Number of guests for this rate tier. Must be > 0. | 2 | |||
| 14 | amount | Float | Y | Product price, formatted as 0.00. Amount = Rate + Commission + Tax | 112.00 | |||
| 15 | taxAmount | Float | Y | Tax amount for the product, formatted as 0.00 | 0.00 |
Request Example
{
"requestID": "c3a0e458155e11eebe560242ac120002",
"timeStamp": "2023-03-01T07:17:42.179Z",
"hotelCode": "PMS001",
"ratePlanCode": [
{
"code": "BAR",
"invTypeCode": "A1K",
"currency": "MYR",
"calendar": [
{
"start": "2023-03-01",
"end": "2023-03-01",
"occupancy": [
{
"ageQualifyingCode": 10,
"numberOfGuests": 1,
"amount": 112.00,
"taxAmount": 12.00
}
]
}
]
}
]
}
Response
Success Response (200 OK)
| No | Field | Data Type | Description | Example |
|---|---|---|---|---|
| 1 | requestID | String | Echoed from the request | c3a0e458155e11eebe560242ac120002 |
| 2 | hotelCode | String | Echoed from the request | PMS001 |
| 3 | timeStamp | String | Echoed from the request, in ISO 8601 format | 2023-06-28T10:50:42.179Z |
{
"requestID": "c3a0e458155e11eebe560242ac120002",
"timeStamp": "2023-06-28T10:50:42.179Z",
"hotelCode": "PMS001"
}
Error Responses
All error responses return a JSON object with a message field.
Invalid JSON or Validation Error (400):
{
"message": "Validation failed: ratePlanCode[0].currency is mandatory and cannot be empty"
}
Invalid JSON Format (400):
{
"message": "Invalid JSON format: expected json value got 'x' (line 1, column 1)"
}
See Overview - Common Error Responses for authentication, hotel not found, and server error responses.
Validation Rules
| Field | Rule |
|---|---|
| requestID | Mandatory, cannot be empty |
| timeStamp | Mandatory, must be in ISO 8601 format (e.g., 2023-06-28T10:50:42.179Z) |
| hotelCode | Mandatory, cannot be empty |
| ratePlanCode | Mandatory, must contain at least one entry |
| ratePlanCode[].code | Mandatory, cannot be empty |
| ratePlanCode[].currency | Mandatory, cannot be empty |
| ratePlanCode[].invTypeCode | Mandatory, cannot be empty |
| ratePlanCode[].calendar | Mandatory, must contain at least one entry |
| calendar[].start | Mandatory, must be in YYYY-MM-DD format |
| calendar[].end | Mandatory, must be in YYYY-MM-DD format, must be >= start date |
| calendar[].occupancy | Mandatory, must contain at least one entry |
| occupancy[].ageQualifyingCode | Must be 8 (Children) or 10 (Adults) |
| occupancy[].numberOfGuests | Must be > 0 |
| occupancy[].amount | Must be >= 0 |
| occupancy[].taxAmount | Must be >= 0 |
