Managing Rates

4.6. Managing Rates

POST /cm/rateplans

Description

Build new or modify rates for properties which are authorized under your API credentials

Body parameter

List of RatePlans in OTA2017B format which need to be created

Name : body
Flags : required
Type : OTA_HotelRatePlanNotifRQ

Responses

HTTP CodeDescriptionSchema
200The request has been accepted for processingOTA_HotelRatePlanNotifRS
400The request content was malformedOTA_HotelRatePlanNotifRS
401The supplier was unauthorizedOTA_HotelRatePlanNotifRS

Consumes

  • application/xml

Produces

  • application/xml

Tags

  • RatePlans

Security

TypeName
apiKeyapiKey

Example HTTP request

Request path

/cm/rateplans

Request for create property's rates

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/2017B/OTA_HotelRatePlanNotifRQ.xsd">
  <RatePlans HotelCode="9612080">
    <RatePlan RatePlanID="RatePlan12" RatePlanNotifType="New" RatePlanType="1">
      <Description Name="Standard Rate"/>
      <TPA_Extensions>
        <Channels>
          <Channel ChannelCode="1"/>
        </Channels>
      </TPA_Extensions>
    </RatePlan>
    <RatePlan RatePlanID="RatePlan13" RatePlanNotifType="New" RatePlanType="2">
      <Description Name="Exclusive Rate"/>
      <TPA_Extensions>
        <Channels>
          <Channel ChannelCode="1"/>
        </Channels>
      </TPA_Extensions>
    </RatePlan>
  </RatePlans>
</OTA_HotelRatePlanNotifRQ>

Request for partial update property's rates

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/2017B/OTA_HotelRatePlanNotifRQ.xsd">
  <RatePlans HotelCode="9612080">
    <RatePlan RatePlanCode="3236124" RatePlanNotifType="Delta">
      <Description Name="Standard Rate updated"/>
      <TPA_Extensions>
        <Channels>
          <Channel ChannelCode="1" Status="Active"/>
          <Channel ChannelCode="6" Status="Inactive"/>
        </Channels>
      </TPA_Extensions>
    </RatePlan>
  </RatePlans>
</OTA_HotelRatePlanNotifRQ>

Request for update property's rates

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/2017B/OTA_HotelRatePlanNotifRQ.xsd">
  <RatePlans HotelCode="9612080">
    <RatePlan RatePlanCode="3236124" RatePlanNotifType="Overlay">
      <Description Name="Standard Rate updated"/>
    </RatePlan>
  </RatePlans>
</OTA_HotelRatePlanNotifRQ>

Example HTTP response

Response 200

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRS CorrelationID="8b417d6a-f3df-4d65-870c-240378b8xxxx">
  <Success/>
  <RatePlanCrossRefs>
    <RatePlanCrossRef RequestRatePlanCode="RatePlan12" ResponseRatePlanCode="123"/>
  </RatePlanCrossRefs>
</OTA_HotelRatePlanNotifRS>

Response 400

<OTA_HotelRatePlanNotifRS CorrelationID="325d8000-48cf-11ea-9337-8950898fxxxx">
  <Errors>
    <Error Code="321" ShortText="Required field missing" Status="NotProcessed"/>
  </Errors>
</OTA_HotelRatePlanNotifRS>

Response 401

<OTA_HotelRatePlanNotifRS CorrelationID="325d8000-48cf-11ea-9337-8950898fxxxx">
  <Errors>
    <Error Code="497" ShortText="Authorization error" Status="NotProcessed"/>
  </Errors>
</OTA_HotelRatePlanNotifRS>

Response 401

<OTA_HotelRatePlanNotifRS CorrelationID="83be9c05-21aa-11f1-8270-dd93b562xxxx">
  <Errors>
    <Error Status="NotProcessed" ShortText="Limit exceed for Rateplan creation. Please contact your Agoda Partner services representative." Code="9209"/></Errors>
</OTA_HotelRatePlanNotifRS>

Please refer Error Code details here for more details.