getRateAmount

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

HeaderValueRequired
Content-Typeapplication/jsonYes
Authorizationrefer to this documentYes

Body Structure

NoLevel 1Level 2Level 3Level 4Data TypeMandatoryDescriptionExample
1requestIDStringYUnique ID generated by the booking channel and returned in the response. Used to track each request.c3a0e458155e11eebe560242ac120002
2timeStampStringYRequest time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS.000Z2023-06-28T10:50:42.179Z
3hotelCodeStringYUnique code assigned to each hotel8-FWHC
4ratePlanCodeArrayYArray of rate plan entries (1 to n)
5codeStringYRate plan codeFOTAC
6invTypeCodeStringYRoom type codeTRP
7currencyStringYCurrency code. Default currency: MYRMYR
8calendarArrayYArray of calendar date entries (1 to n)
9startStringYRate effective start date. Format: YYYY-MM-DD2023-06-28
10endStringYRate effective end date. Format: YYYY-MM-DD2023-06-28
11occupancyArrayYArray of occupancy-based rates (1 to n)
12ageQualifyingCodeIntegerYGuest type. Possible values: 8 (Children), 10 (Adults). Default = 1010
13numberOfGuestsIntegerYNumber of guests for this rate tier. Must be > 0.2
14amountFloatYProduct price, formatted as 0.00. Amount = Rate + Commission + Tax112.00
15taxAmountFloatYTax amount for the product, formatted as 0.000.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)

NoFieldData TypeDescriptionExample
1requestIDStringEchoed from the requestc3a0e458155e11eebe560242ac120002
2hotelCodeStringEchoed from the requestPMS001
3timeStampStringEchoed from the request, in ISO 8601 format2023-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

FieldRule
requestIDMandatory, cannot be empty
timeStampMandatory, must be in ISO 8601 format (e.g., 2023-06-28T10:50:42.179Z)
hotelCodeMandatory, cannot be empty
ratePlanCodeMandatory, must contain at least one entry
ratePlanCode[].codeMandatory, cannot be empty
ratePlanCode[].currencyMandatory, cannot be empty
ratePlanCode[].invTypeCodeMandatory, cannot be empty
ratePlanCode[].calendarMandatory, must contain at least one entry
calendar[].startMandatory, must be in YYYY-MM-DD format
calendar[].endMandatory, must be in YYYY-MM-DD format, must be >= start date
calendar[].occupancyMandatory, must contain at least one entry
occupancy[].ageQualifyingCodeMust be 8 (Children) or 10 (Adults)
occupancy[].numberOfGuestsMust be > 0
occupancy[].amountMust be >= 0
occupancy[].taxAmountMust be >= 0