Set restrictions
POST /api/connector/v1/restrictions/set
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 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 set in.
Parameters of restrictions.
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.
object
Monday enabled
Tuesday enabled
Wednesday enabled
Thursday enabled
Friday enabled
Saturday enabled
Sunday enabled
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", "Client": "Sample Client 1.0.0", "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "Data": [ { "Type": "Start", "ExactRateId": "ed4b660b-19d0-434b-9360-a4de2ea42eda", "ResourceCategoryId": "773d5e42-de1e-43a0-9ce6-f940faf2303f", "StartUtc": "2023-02-15T00:00:00Z", "EndUtc": "2023-02-22T00:00:00Z", "Days": { "Monday": false, "Tuesday": false, "Wednesday": false, "Thursday": false, "Friday": true, "Saturday": true, "Sunday": true }, "MinLength": "P0M2DT0H0M0S", "MaxLength": "P0M7DT0H0M0S" }, { "Type": "Start", "BaseRateId": "e5b538b1-36e6-43a0-9f5c-103204c7f68e", "StartUtc": "2023-02-23T00:00:00Z", "EndUtc": "2023-03-03T00:00:00Z", "Days": { "Monday": true, "Tuesday": true, "Wednesday": true, "Thursday": true, "Friday": true, "Saturday": false, "Sunday": false }, "MinAdvance": "P0Y0M1DT0H0M0S", "MaxAdvance": "P0Y0M3DT0H0M0S" } ]}
Responses
Section titled “ Responses ”OK
object
Example
{}
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
The request cannot be completed because the data has changed, causing conflict between the state on the client and the server. To get around this error, try refreshing the data on the client and resubmitting the request.
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.