Rate
This is the expected return value format for rate scripts:
{
'meta_data'?: <dict>,
'rate': <dec>,
# One of 'per unit' or 'per reservable'.
'rate_basis': <str>,
'rate_description': <str>,
'rate_int'?: <int>,
'prorate_half_interval_multiplier'?: <dec>,
# One of 'per hour', 'per use', 'per block', 'each', 'per request',
# 'per session', 'per sample', 'per day', 'per week', 'per month'.
'rate_unit': <str>,
'sku?': <str>,
'tax_code'?: <str>,
'tax_note'?: <str>,
'tax_rate'?: <str>,
}
When executing a rate script, the base rate is also accessible in the script iself, under the context variable script["rate"]
. The format of this object is slightly different:
{
'blackouts': {
'blackout_id': <int>,
'weekday': <int>, # Integer from 0-6, representing Monday-Sunday.
'start': <str>, # HH:MM:SS where HH is 24 hour time
'end': <str>, # HH:MM:SS where HH is 24 hour time
'reason': <str>,
},
'currency'?: <str>,
'currency_decimal'?: <str>,
'currency_thousand'?: <str>,
'currency_code'?: <str>,
'invoice_automatically': <bool>,
'meta_data'?: <dict>,
'public': <bool>,
'rate': <dec>,
# One of 'per unit' or 'per reservable'.
'rate_basis': <str>,
'rate_description': <str>,
'rate_duration_maximum': <int|None>, # Seconds
'rate_duration_minimum': <int|None>, # Seconds
'rate_duration_step': <int|None>, # Seconds
'rate_int'?: <int>,
'prorate_half_interval_multiplier'?: <dec>,
# One of 'per hour', 'per use', 'per block', 'each', 'per request',
# 'per session', 'per sample', 'per day', 'per week', 'per month'.
'rate_unit': <str>,
'require_account_number': <bool>,
'site_reservation_script_id': <str|None>,
'sku?': <str>,
'tax_code'?: <str>,
'tax_note'?: <str>,
'tax_rate'?: <str>,
'usergroup_name'?: <str>,
'usergroup_id': <int|None>,
}