Method to externally manage rate pricing

Table of Contents
  1. URL Endpoint
  2. Request Body
  3. Examples



URL Endpoint

/manage/rates

Warning

This method is only accessible using a Hotelier API account.

This method is only accessible using a POST request.

To get a response in JSON make sure you are also sending the Accept: application/json header.




Request Body

Post a JSON document with the following structure:

{
	"RATECODE": [
		{
			"from":ISO 8601, // Starting date for period updates, mutually exclusive with "date"
			"to":ISO 8601, // Ending date for period update, mutually exclusive with "date"
			"date":ISO 8601, // Single-date update, mutually exclusive with "from" and "to"
			"weekdays":STRING[], // Specific days of week to apply the update ( Sun, Mon, Tue, Wed, Thu, Fri, Sat )
			"pricing":
			[
				{
					"adults":INTEGER,
					"children":INTEGER,
					"price":NUMBER
				}
			],
			"extra_adult":NUMBER,
			"extra_child":NUMBER,
			"closeout":BOOLEAN // 1=Rate is closed, 0=Rate is open ( optional )
			"min_stay":INTEGER // 0=Reset minimum stay override, 1+=Set minimum stay override ( optional )
			"partial":BOOLEAN // 1=Only update combinations present in the request, 0=Update all ( default = 0 )
		}
	]
}

Notice

Request body must be in valid JSON format.

Updates are made only if the entire request body is successfully parsed and validated.

Notice

Updates are transactional, that means that the entire batch of updates included in the request will either succeed or fail in its entirety. We guarantee that no request can partial mutate WebHotelier state.

You can use the Rates Feed method to validate WebHotelier state against your data.

Requirements

  • ALWAYS pack updates in a single request. Each HTTP request may have a big overhead so sending all updates in a single request is critical, even if the updates are for different rates.
  • Always use ranged updates when applicable ( from/to instead of date ). Adjacent dates with the same payload should ALWAYS be converted to a ranged update.
  • Do not send pricing updates for CHILD RATES. Child rate pricing is calculated dynamically from its parent rate based on some rules. To figure out if a rate is child, you should check the parent property in the rates listing response. If parent is greater than 0 for a rate, it means this rate has a parent, thus it is a child rate.

Caution

We closely monitor all updates going in WebHotelier.
If best practices are not followed it may result in the banning of your API account or your IP address.




Examples

The following examples illustrate common use cases and possible combinations:


1. Single Day Pricing Update

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		}
	]
}

2. Period Pricing Update

{
	"28153":
	[
		{
			"from":"2017-05-20",
			"to":"2017-05-27",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		}
	]
}

3. Mixed Pricing Updates

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		},
		{
			"from":"2017-05-20",
			"to":"2017-05-27",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		}
	]
}

4. Multiple rate updates in a single request

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		},
		{
			"from":"2017-05-20",
			"to":"2017-05-27",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		}
	],
	"28154":
	[
		{
			"date":"2017-05-13",
			"pricing":
			[
				{ "adults": 1, "price": 150.0 },
				{ "adults": 2, "price": 180.0 },
				{ "adults": 2, "children": 1, "price": 190.0 }
			],
			"extra_adult": 30.0,
			"extra_child": 10.0
		}
	]
}

5. Closeout ( pricing not changed )

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"closeout": 1
		}
	]
}

6. Remove closeout and change pricing

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0,
			"closeout": 0
		}
	]
}

7. Simple pricing ( e.g. per room )

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"pricing":[{ "adults": 1, "price": 100.0 }]
		}
	]
}

8. Complex pricing ( occupancy based )

{
	"28155":
	[
		{
			"from":"2017-05-20",
			"to":"2017-05-27",
			"pricing":
			[
				{ "adults": 1, "children": 0, "price": 100.0 },
				{ "adults": 2, "children": 0, "price": 120.0 },
				{ "adults": 3, "children": 0, "price": 180.0 },
				{ "adults": 4, "children": 0, "price": 200.0 },
				{ "adults": 5, "children": 0, "price": 250.0 },
				{ "adults": 2, "children": 1, "price": 130.0 },
				{ "adults": 2, "children": 2, "price": 140.0 },
				{ "adults": 3, "children": 1, "price": 190.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0
		}
	]
}

9. Set minimum stay override

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"min_stay": 5
		}
	]
}

10. Reset minimum stay override and change pricing

{
	"28153":
	[
		{
			"date":"2017-05-13",
			"pricing":
			[
				{ "adults": 1, "price": 100.0 },
				{ "adults": 2, "price": 120.0 },
				{ "adults": 2, "children": 1, "price": 130.0 }
			],
			"extra_adult": 50.0,
			"extra_child": 20.0,
			"min_stay": 0
		}
	]
}

11. Period Pricing Update for specific weekdays

{
"28153":
[
	{
		"from":"2017-05-20",
		"to":"2017-05-27",
		"weekdays":
		[
			"Sat",
			"Sun"
		]
		"pricing":
		[
			{ "adults": 1, "price": 100.0 },
			{ "adults": 2, "price": 120.0 },
			{ "adults": 2, "children": 1, "price": 130.0 }
		],
		"extra_adult": 50.0,
		"extra_child": 20.0
	}
]
}

Mixing updates

You will notice that pricing, close-outs, and minimum stay overrides can be independently managed ( send one, two, or all three in a single update ). We recommend sending a single update for all three if possible to avoid roundtrips.

Occupancy Pricing

Pricing overrides the entire rate for that day. If combinations are missing the system will generate the price using the "extra_adult" and "extra_child" information if present, otherwise it will re-use the same price as the closest submitted combination.

You can use the partial flag to change this behavior and only update the combinations present in the update.

Minimum Stay Inheritance

Minimum stay for a date is inherited. There is a minimum stay setting at the availability period level. Then there is a global minimum stay override setting for each rate. Lastly, there is a minimum stay override per day for each rate.

This means that resetting a day's minimum stay does not mean that minimum stay becomes 1. The rate feed API method may return another value based on the above inheritance scheme.