SET RATES



SET

RATES

SetRates() 

SetRates() allows Revenue Management Partners to set the rates for every unit in a unit group. Existing rates will be overwritten if fully covered by the specified rates.

Request

Endpoint     

https://www.availabilityexchange.com/gateway/setrates
Parameters
    None
Request Body
   
business_id (64-bit integer)
       the unique identifier for the property
   
unit_group_id (64-bit integer)
        the unique id for the unit group.

    rates (list of objects)

        Rate object:

            rate (decimal)
               the rate per night for units in the unit group

            start (date YYYY-MM-dd)
               the first date in the range to set

            end (date YYYY-MM-dd)
               the last date in the range to set (inclusive)

            adults_included_in_rate (32-bit integer) (optional)
               the number of adults included in the price. If omitted, defaults to 2.

            extra_adult_rate (decimal) (optional)
               the cost per additional adult beyond the adults_included_in_rate. Defaults to 0 if omitted.


Request Example

>curl  -X POST https://www.availabilityexchange.com/gateway/setrates
--user username:accesskey 
-H 'Content-Type: application/json'
-d '{

    "unit_group_id": 18128,

    "business_id": 16609,

    "rates": [

        {

            "rate": 65.50,

            "start": "2024-10-13",

            "end": "2024-10-13",

            "extra_adult_rate": 10.0,

            "adults_included_in_rate": 2

        },

        {

            "rate": 70.50,

            "start": "2024-10-14",

            "end": "2024-10-17",

            "adults_included_in_rate": 4

        },

        {

            "rate": 90.50,

            "start": "2024-10-18",

            "end": "2024-10-19",

            "adults_included_in_rate": 4

        }

    ]

}'

Response

response_errors (See Response Errors)
business_id, unit_group_id, etc
    the fields used in the request will be returned in the response
success (boolean)
   the result of whether the set rates was successful. False may denote a validation failure which will result in no rates created (including the valid rates) or it may denote that the process failed partway through creating the rates, which may result in some of the rates being formed and others not.

Response Example

{

  "unit_group_id": 18128,

  "business_id": 16609,

  "rates": [

    {

      "rate": 65.50,

      "start": "2024-10-13",

      "end": "2024-10-13",

      "extra_adult_rate": 10.0,

      "adults_included_in_rate": 2

    },

    {

      "rate": 70.50,

      "start": "2024-10-14",

      "end": "2024-10-17",

      "extra_adult_rate": 0.0,

      "adults_included_in_rate": 4

    },

    {

      "rate": 90.50,

      "start": "2024-10-18",

      "end": "2024-10-19",

      "extra_adult_rate": 0.0,

      "adults_included_in_rate": 4

    }

  ],

  "success": true,

  "response_errors": []

}


Response Errors

200

    response_errors (list of strings)

  • The start date is after the end date
  • Rates must be greater than 0
  • The query cannot contain dates before today
  • extra_adult_rate should be greater than 0 or omitted
  • adults_included_in_rate should be greater than 0. It defaults to 2 if not included.

401
    The credentials supplied are incorrect or you do not have access to this resource
500
   
Something went wrong (Internal Server Error)
503
    Server in maintenance mode

Response Error Example

>curl -X POST https://availabilityexchange.com/gateway/setrates
--user username:accesskey
-H 'Content-Type: application/json'
-d '{

    "unit_group_id": 18128,

    "business_id": 16609,

    "rates": [

        {

            "rate": 65.50,

            "start": "2024-10-15",

            "end": "2024-10-13",

            "extra_adult_rate": 10.0,

            "adults_included_in_rate": 2

        },

        {

            "rate": 70.50,

            "start": "2024-10-14",

            "end": "2024-10-17",

            "adults_included_in_rate": 4

        },

                {

            "rate": 90.50,

            "start": "2024-10-18",

            "end": "2024-10-19",

            "adults_included_in_rate": 4

        }

    ]

}


RESPONSE:


{

  "unit_group_id": 18128,

  "business_id": 16609,

  "rates": [

    {

      "rate": 65.50,

      "start": "2024-10-15",

      "end": "2024-10-13",

      "extra_adult_rate": 10.0,

      "adults_included_in_rate": 2

    },

    {

      "rate": 70.50,

      "start": "2024-10-14",

      "end": "2024-10-17",

      "extra_adult_rate": 0.0,

      "adults_included_in_rate": 4

    },

    {

      "rate": 90.50,

      "start": "2024-10-18",

      "end": "2024-10-19",

      "extra_adult_rate": 0.0,

      "adults_included_in_rate": 4

    }

  ],

  "success": false,

  "response_errors": [

    "The start date is after the end date"

  ]

}


Return to API Endpoints

Share by: