Create YieldRules
Creates a YieldRule for each offering supplied.
Rules are per-offering. Applying one definition to several offerings is a convenience at creation only: it produces an independent rule for each, so editing or deleting one afterwards leaves the rest untouched, and offerings created later do not pick the rule up.
Every offering must belong to the site and have a standard price for the adjustment to work from, and they must all be the same offering_type: what a rule may contain differs between types, since an appointment has a practitioner to measure utilisation against and an area booking type does not. If any offering is rejected, no rules are created.
Selections of more than 200 offerings are written by a background job and answered with 202 and the created_batch_id the rules will carry, rather than holding the response open for several seconds. Poll the list endpoint with that id to follow them appearing.
A rule that lowers a price needs the offering to say when reductions may start. Send reduction_advance_interval to set that window on every offering the rule is created for, or leave it out where they are already configured. Creating a rule is the only time it can be set through this resource; changing it afterwards is done from the offering.
Requires the advanced_yield_management feature and the same permission as editing an offering's price rules.
Request body
Example request
{
"time_from": "12:00",
"time_to": "21:00",
"triggers": {
"practitioner_utilisation": {
"from": 70,
"to": 90
},
"room_occupancy": {
"from": 70,
"to": 90
}
},
"adjustment": {
"value": 15
},
"reduction_advance_interval": "P2D"
}Response
The yield rules were successfully created. One rule is returned per offering supplied, each independent of the others.
Example response
{
"data": [
{
"time_from": "12:00",
"time_to": "21:00",
"triggers": {
"practitioner_utilisation": {
"from": 70,
"to": 90
},
"room_occupancy": {
"from": 70,
"to": 90
}
},
"adjustment": {
"value": 15
}
}
]
}Changes
No recorded changes to this endpoint across all 1 revision of this API.