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
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Token identifying the client application. |
| string | required | Access token of the client application. |
| string | required | Name and version of the client application. |
| 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. |
| array of string | required, max 1000 items | Unique identifiers of the Services from which the restrictions are requested. |
| array of string | optional, max 1000 items | Unique identifiers of Resource categories. |
| array of string | optional, max 1000 items | Unique identifiers of Rates. 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 groups of specified rates, or ones inherited from base rates. |
| array of string | optional, max 1000 items | Unique identifiers of Rates. Returns only those restrictions which have matching |
| array of string | optional, max 1000 items | Unique identifiers of Rates. Returns only those restrictions which have matching |
| string | optional | Restriction origin. Returns only those restrictions which have matching |
| optional, max length 3 months | Interval in which the Restriction is active. Required if no other filter is provided. | |
| optional, max length 3 months | Interval in which the Restriction was created. | |
| optional, max length 3 months | Interval in which the Restriction was updated. | |
| required | Limitation on the quantity of data returned. |
Response
Property | Type | Contract | Description |
---|---|---|---|
| array of Restriction | required | Restrictions of the default service. |
| 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. |
Restriction
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Unique identifier of the restriction. |
| string | required | Unique identifier of the Service. |
| string | optional | External identifier of the restriction. |
| string | required | |
| required | The conditions or rules that must be met by a reservation for the restriction to apply. | |
| optional | The rules that prevent the restriction from applying to a reservation, even when all conditions have been met. |
Restriction Conditions
Property | Type | Contract | Description |
---|---|---|---|
| string | required | |
| string | optional | Unique identifier of the restricted exact Rate. |
| string | optional | Unique identifier of the restricted base Rate. |
| string | optional | Unique identifier of the restricted Rate group. |
| string | optional | Unique identifier of the restricted Resource category. |
| string | optional | Name of the restricted Resource category type. |
| 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. |
| 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. |
| array of string Day | optional | The restricted days of week. Will automatically be set to all values when not provided or when the service uses a time unit longer than a day. |
Restriction Exceptions
Property | Type | Contract | Description |
---|---|---|---|
| string | optional | The minimum time before the reservation starts, you can reserve in ISO 8601 duration format. |
| string | optional | The maximum time before the reservation starts, you can reserve in ISO 8601 duration format. |
| string | optional | Minimal reservation length in ISO 8601 duration format. |
| string | optional | Maximal reservation length in ISO 8601 duration format. |
| optional | Value of the minimum price per time unit. | |
| optional | Value of the maximum price per time unit. |
Day
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
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.
Restriction origin
User
- Restriction was created by a user in Mews.Integration
- Restriction was created by a 3rd-party integration.
Add restrictions
Deprecated!This operation is deprecated, please use Set restrictions 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 new operation Set restrictions.
Request
[PlatformAddress]/api/connector/v1/restrictions/add
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Token identifying the client application. |
| string | required | Access token of the client application. |
| string | required | Name and version of the client application. |
| string | required | Unique identifier of the Service restrictions will be added in. |
| array of Restriction parameters | required | Parameters of restrictions. |
Restriction parameters
Property | Type | Contract | Description |
---|---|---|---|
| string | optional | Identifier of the restriction within the transaction. |
| string | optional | External identifier of the restriction. |
| required | The conditions or rules that must be met by a reservation for the restriction to apply. | |
| optional | The rules that prevent the restriction from applying to a reservation, even when all conditions have been met. |
Response
Property | Type | Contract | Description |
---|---|---|---|
| array of Added restriction | required | The added restrictions. |
Added restriction
Property | Type | Contract | Description |
---|---|---|---|
| string | optional | Identifier of the restriction within the transaction. |
| required | The added restriction. |
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
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Token identifying the client application. |
| string | required | Access token of the client application. |
| string | required | Name and version of the client application. |
| array of string | required | Unique identifiers of the Restrictions. |
Response
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
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Token identifying the client application. |
| string | required | Access token of the client application. |
| string | required | Name and version of the client application. |
| string | required | Unique identifier of the Service restrictions will be set in. |
| array of Restriction set data | required | Parameters of restrictions. |
Restriction set data
Property | Type | Contract | Description |
---|---|---|---|
| string | required | |
| string | optional | Unique identifier of the restricted exact Rate. |
| string | optional | Unique identifier of the restricted base Rate. |
| string | optional | Unique identifier of the restricted Rate group. |
| string | optional | Unique identifier of the restricted Resource category. |
| string | optional | Name of the restricted Resource category type. |
| 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. |
| 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. |
| required | The restricted days of week. | |
| string | optional | The minimum time before the reservation starts, you can reserve in ISO 8601 duration format. |
| string | optional | The maximum time before the reservation starts, you can reserve in ISO 8601 duration format. |
| string | optional | Minimal reservation length in ISO 8601 duration format. |
| string | optional | Maximal reservation length in ISO 8601 duration format. |
| optional | Value of the minimum price per time unit. | |
| optional | Value of the maximum price per time unit. |
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
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Token identifying the client application. |
| string | required | Access token of the client application. |
| string | required | Name and version of the client application. |
| string | required | Unique identifier of the Service to which the restrictions apply. |
| Array of Restriction clear data | required | Details of the matching conditions and time intervals for clearing restrictions. |
Restriction clear data
Property | Type | Contract | Description |
---|---|---|---|
| string | required | |
| string | optional | Unique identifier of the exact Rate to which the restriction applies. |
| string | optional | Unique identifier of the base Rate to which the restriction applies. |
| string | optional | Unique identifier of the Rate group to which the restriction applies. |
| string | optional | Unique identifier of the Resource category to which the restriction applies. |
| string | optional | Name of the Resource category type to which the restriction applies. |
| 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 Datetime. |
| string | optional | Inclusive 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 Datetime. |
| required | The days of week to which the restriction applies. |
Response
Days parameters
Property | Type | Contract | Description |
---|---|---|---|
| boolean | required | Monday enabled. |
| boolean | required | Tuesday enabled. |
| boolean | required | Wednesday enabled. |
| boolean | required | Thursday enabled. |
| boolean | required | Friday enabled. |
| boolean | required | Saturday enabled. |
| boolean | required | Sunday enabled. |
Last updated