Add restrictions
POST /api/connector/v1/restrictions/add
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 Body
Section titled “Request Body ”object
Token identifying the client application.
Access token of the client application.
Name and version of the client application.
Unique identifier of the Service restrictions will be added in.
Parameters of restrictions.
object
Identifier of the restriction within the transaction.
External identifier of the restriction.
The conditions or rules that must be met by a reservation for the restriction to apply.
object
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.)
Unique identifier of the exact Rate
to which the restriction applies.
Unique identifier of the base Rate
to which the restriction applies.
Unique identifier of the Rate group
to which the restriction applies.
Unique identifier of the Resource category
to which the restriction applies.
Name of the Resource category type
to which the restriction applies.
Room
Bed
Dorm
Apartment
Suite
Villa
Site
Office
MeetingRoom
ParkingSpot
Desk
TeamArea
Membership
Tent
CaravanOrRV
UnequippedCampsite
Bike
ExtraBed
Cot
Crib
ConferenceRoom
Rooftop
Garden
Restaurant
Amphitheater
PrivateSpaces
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.
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.
The restricted days of week. Defaults to all days when not provided. Ignored when the service uses a time unit longer than a day.
The restricted hours. Defaults to all hours when not provided.
object
Hour 0 enabled
Hour 1 enabled
Hour 2 enabled
Hour 3 enabled
Hour 4 enabled
Hour 5 enabled
Hour 6 enabled
Hour 7 enabled
Hour 8 enabled
Hour 9 enabled
Hour 10 enabled
Hour 11 enabled
Hour 12 enabled
Hour 13 enabled
Hour 14 enabled
Hour 15 enabled
Hour 16 enabled
Hour 17 enabled
Hour 18 enabled
Hour 19 enabled
Hour 20 enabled
Hour 21 enabled
Hour 22 enabled
Hour 23 enabled
The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.
object
The minimum time before the reservation starts, you can reserve in ISO 8601 duration format.
The maximum time before the reservation starts, you can reserve in ISO 8601 duration format.
Minimal reservation length in ISO 8601 duration format.
Maximal reservation length in ISO 8601 duration format.
Value of the minimum price per time unit.
object
Value of the maximum price per time unit.
object
Example
{ "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D", "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D", "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "Restrictions": [ { "Identifier": "1234", "ExternalIdentifier": "5678", "Conditions": { "Type": "Start", "ExactRateId": "7c7e89d6-69c0-4cce-9d42-35443f2193f3", "ResourceCategoryId": "86336EAC-4168-46B1-A544-2A47251BF864", "Days": [ "Friday", "Saturday", "Sunday" ] }, "Exceptions": { "MinLength": "P0M2DT0H0M0S", "MaxLength": "P0M7DT0H0M0S" } }, { "Identifier": "1235", "ExternalIdentifier": "5678", "Conditions": { "Type": "Start", "BaseRateId": "e5b538b1-36e6-43a0-9f5c-103204c7f68e", "Days": [ "Friday", "Saturday", "Sunday" ] }, "Exceptions": { "MinAdvance": "P0Y0M1DT0H0M0S", "MaxAdvance": "P0Y0M3DT0H0M0S" } } ]}
Responses
Section titled “ Responses ”OK
object
The added restrictions.
object
Identifier of the restriction within the transaction.
The added restriction.
object
Unique identifier of the restriction.
Unique identifier of the Service
.
External identifier of the restriction.
Restriction origin
User (Restriction was created by a user in Mews.)
Integration (Restriction was created by a 3rd-party integration.)
The conditions or rules that must be met by a reservation for the restriction to apply.
object
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.)
Unique identifier of the restricted exact Rate
.
Unique identifier of the restricted base Rate
.
Unique identifier of the restricted Rate group
.
Unique identifier of the restricted Resource category
.
Name of the restricted Resource category type
.
Room
Bed
Dorm
Apartment
Suite
Villa
Site
Office
MeetingRoom
ParkingSpot
Desk
TeamArea
Membership
Tent
CaravanOrRV
UnequippedCampsite
Bike
ExtraBed
Cot
Crib
ConferenceRoom
Rooftop
Garden
Restaurant
Amphitheater
PrivateSpaces
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.
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.
The restricted days of week. Defaults to all days when not provided. Ignored when the service uses a time unit longer than a day.
The restricted hours. Defaults to all hours when not provided.
object
Hour 0 enabled
Hour 1 enabled
Hour 2 enabled
Hour 3 enabled
Hour 4 enabled
Hour 5 enabled
Hour 6 enabled
Hour 7 enabled
Hour 8 enabled
Hour 9 enabled
Hour 10 enabled
Hour 11 enabled
Hour 12 enabled
Hour 13 enabled
Hour 14 enabled
Hour 15 enabled
Hour 16 enabled
Hour 17 enabled
Hour 18 enabled
Hour 19 enabled
Hour 20 enabled
Hour 21 enabled
Hour 22 enabled
Hour 23 enabled
The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.
object
The minimum time before the reservation starts, you can reserve in ISO 8601 duration format.
The maximum time before the reservation starts, you can reserve in ISO 8601 duration format.
Minimal reservation length in ISO 8601 duration format.
Maximal reservation length in ISO 8601 duration format.
Value of the minimum price per time unit.
object
Value of the maximum price per time unit.
object
Example
{ "Restrictions": [ { "Identifier": "1234", "Restriction": { "Id": "40c24757-c16e-4094-91d3-4ca952e488a1", "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "ExternalIdentifier": "5678", "Conditions": { "Type": "Stay", "ExactRateId": "7c7e89d6-69c0-4cce-9d42-35443f2193f3", "BaseRateId": null, "RateGroupId": null, "ResourceCategoryId": "86336EAC-4168-46B1-A544-2A47251BF864", "ResourceCategoryType": null, "StartUtc": "2018-10-09T00:00:00Z", "EndUtc": "2018-10-31T00:00:00Z", "Days": [ "Saturday", "Sunday" ] }, "Exceptions": { "MinAdvance": null, "MaxAdvance": null, "MinLength": "P0M2DT0H0M0S", "MaxLength": "P0M7DT0H0M0S", "MinPrice": null, "MaxPrice": null } } }, { "Identifier": "1235", "Restriction": { "Id": "b40ac4a8-f5da-457d-88fe-7a895e1580ab", "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "ExternalIdentifier": "5678", "Conditions": { "Type": "Start", "ExactRateId": null, "BaseRateId": "e5b538b1-36e6-43a0-9f5c-103204c7f68e", "RateGroupId": null, "ResourceCategoryId": null, "ResourceCategoryType": "Room", "StartUtc": "2018-10-01T00:00:00Z", "EndUtc": "2018-10-31T00:00:00Z", "Days": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ] }, "Exceptions": { "MinAdvance": "P0M1DT0H0M0S", "MaxAdvance": "P0M3DT0H0M0S", "MinLength": null, "MaxLength": null, "MinPrice": null, "MaxPrice": null } } } ]}
Server has successfully fulfilled the request and there is no additional information to send back.
object
Error caused by the client app, e.g. in case of malformed request or invalid identifier of a resource. In most cases, such an error signifies a bug in the client app (consumer of the API).
object
Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.
object
Server error that should be reported to the end user of the client app. Happens for example when the server-side validation fails or when a business-logic check is violated.
object
Error caused by heavy request that takes too long to process (typically tens of seconds). To get around this, request data in smaller batches. For more information, see Request timeouts
object
Error caused by too many requests sent in a given amount of time. Response contains Retry-After
header indicating how long the user agent should wait before making a follow-up request. For more information, see Request limits.
object
Unexpected error on the Mews side. This may be due to a software fault. If such a situation occurs, the error will be logged and the development team notified, however you can raise an issue through GitHub on our documentation repository.