Restrictions
Get all restrictions
Returns all restrictions of the default service provided by the enterprise. Note this operation uses Pagination and supports Portfolio Access Tokens.
Request
[PlatformAddress]/api/connector/v1/restrictions/getAll
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
EnterpriseIds
array of string
optional, max 1000 items
Unique identifiers of the Enterprises. If not specified, the operation returns data for all enterprises within scope of the Access Token.
RestrictionIds
array of string
optional, max 1000 items
Unique identifiers of the Restriction
.
ResourceCategoryIds
array of string
optional, max 1000 items
Unique identifiers of Resource category
.
RateIds
array of string
optional, max 1000 items
Unique identifiers of Rate
. Returns all restrictions that affect the given rates, i.e. ones without any Restriction Conditions
, ones assigned directly to specified rates, ones assigned to Rate group
of specified rates, or ones inherited from base rates.`.
ExactRateIds
array of string
optional, max 1000 items
Unique identifiers of Rate
. Returns only those restrictions which have matching ExactRateId
set in Restriction Condition
.
BaseRateIds
array of string
optional, max 1000 items
Unique identifiers of Rate
. Returns only those restrictions which have matching BaseRateId
set in Restriction Condition
.
Origin
required
Restriction origin. Returns only those restrictions which have matching Origin or all if not specified.
ServiceIds
array of string
required, max 1000 items
Unique identifiers of the Service
from which the restrictions are requested.
Limitation
required
Limitation on the quantity of data returned and optional Cursor for the starting point of data.
TimeFilter
string
optional
Deprecated!
StartUtc
string
optional
Deprecated!
EndUtc
string
optional
Deprecated!
Restriction origin
User
- Restriction was created by a user in Mews.Integration
- Restriction was created by a 3rd-party integration.
Response
Cursor
string
optional
Unique identifier of the item one newer in time order than the items to be returned. If Cursor is not specified, i.e. null, then the latest or most recent items will be returned.
Add restrictions
Deprecated!This operation is deprecated. Please use Set restriction instead.
Adds new restrictions with the specified conditions. Care is needed to specify StartUtc
and EndUtc
in the correct format - see Datetimes. Important: If consecutive restrictions are sent with the exact same conditions and exceptions, no attempt at merging them into a single restriction is made. This means that there can be a large number of restrictions per service, leading to sub-optimal performance. A quota limit of 150,000 has been introduced for this reason. To mitigate the issue, the preferred way to add restrictions is operation Set restriction.
Request
[PlatformAddress]/api/connector/v1/restrictions/add
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
Restriction data
Identifier
string
optional
Identifier of the restriction within the transaction.
ExternalIdentifier
string
optional
External identifier of the restriction.
Conditions
required
The conditions or rules that must be met by a reservation for the restriction to apply.
Exceptions
optional
The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.
Restriction condition data
ExactRateId
string Hybrid identifier
optional
Unique identifier of the exact Rate
to which the restriction applies.
BaseRateId
string Hybrid identifier
optional
Unique identifier of the base Rate
to which the restriction applies.
RateGroupId
string Hybrid identifier
optional
Unique identifier of the Rate group
to which the restriction applies.
ResourceCategoryId
string Hybrid identifier
optional
Unique identifier of the Resource category
to which the restriction applies.
ResourceCategoryType
optional
Name of the Resource category type
to which the restriction applies.
StartUtc
string
optional
Start date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.
EndUtc
string
optional
End date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.
Days
array of string
optional
The restricted days of week. Defaults to all days when not provided. Ignored when the service uses a time unit longer than a day.
Restriction exception data
MinAdvance
string
optional
The minimum time before the reservation starts, you can reserve in ISO 8601 duration format.
MaxAdvance
string
optional
The maximum time before the reservation starts, you can reserve in ISO 8601 duration format.
MinLength
string
optional
Minimal reservation length in ISO 8601 duration format.
MaxLength
string
optional
Maximal reservation length in ISO 8601 duration format.
Response
Added restriction
Identifier
string
optional
Identifier of the restriction within the transaction.
Restriction
The added restriction.
Id
string
required
Unique identifier of the restriction.
ServiceId
string
required
Unique identifier of the Service
.
ExternalIdentifier
string
optional
External identifier of the restriction.
Conditions
required
The conditions or rules that must be met by a reservation for the restriction to apply.
Exceptions
optional
The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.
Restriction origin
User
- Restriction was created by a user in Mews.Integration
- Restriction was created by a 3rd-party integration.
Restriction condition
The conditions or rules that must be met by a reservation for the restriction to apply.
ExactRateId
string
optional
Unique identifier of the restricted exact Rate
.
BaseRateId
string
optional
Unique identifier of the restricted base Rate
.
RateGroupId
string
optional
Unique identifier of the restricted Rate group
.
ResourceCategoryId
string
optional
Unique identifier of the restricted Resource category
.
StartUtc
string
optional
Start date of the restriction time interval, specified in ISO 8601 format and adjusted to UTC - see Datetimes for important information on format and implementation.
EndUtc
string
optional
End date of the restriction time interval, specified in ISO 8601 format and adjusted to UTC - see Datetimes for important information on format and implementation.
Days
array of string
optional
The restricted days of week. Defaults to all days when not provided. Ignored when the service uses a time unit longer than a day.
Restriction type
Stay
- Guests can't stay within specified dates.Start
- Guests can't check in within specified dates.End
- Guests can't check out within specified dates.
Resource category type
Room
Bed
Dorm
Apartment
Suite
Villa
Site
Office
MeetingRoom
ParkingSpot
Desk
TeamArea
Membership
Tent
CaravanOrRV
UnequippedCampsite
Bike
ExtraBed
Cot
Crib
Hours
Zero
boolean
required
Hour 0 enabled
One
boolean
required
Hour 1 enabled
Two
boolean
required
Hour 2 enabled
Three
boolean
required
Hour 3 enabled
Four
boolean
required
Hour 4 enabled
Five
boolean
required
Hour 5 enabled
Six
boolean
required
Hour 6 enabled
Seven
boolean
required
Hour 7 enabled
Eight
boolean
required
Hour 8 enabled
Nine
boolean
required
Hour 9 enabled
Ten
boolean
required
Hour 10 enabled
Eleven
boolean
required
Hour 11 enabled
Twelve
boolean
required
Hour 12 enabled
Thirteen
boolean
required
Hour 13 enabled
Fourteen
boolean
required
Hour 14 enabled
Fifteen
boolean
required
Hour 15 enabled
Sixteen
boolean
required
Hour 16 enabled
Seventeen
boolean
required
Hour 17 enabled
Eighteen
boolean
required
Hour 18 enabled
Nineteen
boolean
required
Hour 19 enabled
Twenty
boolean
required
Hour 20 enabled
TwentyOne
boolean
required
Hour 21 enabled
TwentyTwo
boolean
required
Hour 22 enabled
TwentyThree
boolean
required
Hour 23 enabled
Restriction exception
The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.
MinAdvance
string
optional
The minimum time before the reservation starts, you can reserve in ISO 8601 duration format.
MaxAdvance
string
optional
The maximum time before the reservation starts, you can reserve in ISO 8601 duration format.
MinLength
string
optional
Minimal reservation length in ISO 8601 duration format.
MaxLength
string
optional
Maximal reservation length in ISO 8601 duration format.
Set restrictions
Adds new restrictions with the specified conditions. For improved efficiency, multiple similar restrictions will be merged into a single restriction. A quota of 150,000 restrictions per service applies, although it is unlikely to be exceeded because of the merging algorithm. For more information about the merging algorithm, see Concepts > Restrictions.
Care is needed to specify StartUtc
and EndUtc
in the correct format - see Datetimes. If migrating from deprecated operation Add restrictions, note that the validation of these properties is stronger in this operation.
Only restrictions created through the API are affected by this operation, not restrictions created by the user within Mews Operations. Similarly, if a user creates a restriction in Mews Operations, this will not affect restrictions created through the API.
Request
[PlatformAddress]/api/connector/v1/restrictions/set
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
ServiceId
string Hybrid identifier
required
Unique identifier of the Service restrictions will be set in.
Restriction set data
ExactRateId
string Hybrid identifier
optional
Unique identifier of the exact Rate
to which the restriction applies.
BaseRateId
string Hybrid identifier
optional
Unique identifier of the base Rate
to which the restriction applies.
RateGroupId
string Hybrid identifier
optional
Unique identifier of the Rate group
to which the restriction applies.
ResourceCategoryId
string Hybrid identifier
optional
Unique identifier of the Resource category
to which the restriction applies.
ResourceCategoryType
optional
Name of the Resource category type
to which the restriction applies.
StartUtc
string
optional
Start date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.
EndUtc
string
optional
End date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.
MinAdvance
string
optional
The minimum time before the reservation starts, you can reserve in ISO 8601 duration format.
MaxAdvance
string
optional
The maximum time before the reservation starts, you can reserve in ISO 8601 duration format.
MinLength
string
optional
Minimal reservation length in ISO 8601 duration format.
MaxLength
string
optional
Maximal reservation length in ISO 8601 duration format.
Days parameters
Monday
boolean
required
Monday enabled
Tuesday
boolean
required
Tuesday enabled
Wednesday
boolean
required
Wednesday enabled
Thursday
boolean
required
Thursday enabled
Friday
boolean
required
Friday enabled
Saturday
boolean
required
Saturday enabled
Sunday
boolean
required
Sunday enabled
Response
Delete restrictions
Deprecated!This operation is deprecated. Please use Clear restrictions instead.
Removes restrictions from the service. This operation is intended to be used alongside Add restrictions.
Request
[PlatformAddress]/api/connector/v1/restrictions/delete
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
RestrictionIds
array of string
required
Unique identifiers of the Restriction
.
Response
Clear restrictions
Deletes restrictions that exactly match the specified conditions, using a splicing algorithm. This operation is intended to be used alongside Set restrictions. The specified conditions must be met exactly. The time interval, however, does not need to correspond to an existing restriction in the system, instead the API uses a splicing algorithm to work out how to divide up any existing restrictions to meet the specified time interval. For details about matching conditions and the splicing algorithm, see Concepts > Restrictions.
Only restrictions created through the API are affected by this operation, not restrictions created by the user within Mews Operations. Similarly, if a user creates a restriction in Mews Operations, this will not affect restrictions created through the API.
Request
[PlatformAddress]/api/connector/v1/restrictions/clear
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
Data
array of Restriction clear data
required, max 1000 items
Details of the matching conditions and time intervals for clearing restrictions.
ServiceId
string Hybrid identifier
required
Unique identifier of the Service to which the restrictions apply.
Restriction clear data
ExactRateId
string Hybrid identifier
optional
Unique identifier of the exact Rate
to which the restriction applies.
BaseRateId
string Hybrid identifier
optional
Unique identifier of the base Rate
to which the restriction applies.
RateGroupId
string Hybrid identifier
optional
Unique identifier of the Rate group
to which the restriction applies.
ResourceCategoryId
string Hybrid identifier
optional
Unique identifier of the Resource category
to which the restriction applies.
ResourceCategoryType
optional
Name of the Resource category type
to which the restriction applies.
StartUtc
string
optional
Start date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.
EndUtc
string
optional
End date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.
Response
Last updated