Skip to content

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.

SetRestrictionParameters
object
ClientToken
required

Token identifying the client application.

string
>= 1 characters
AccessToken
required

Access token of the client application.

string
>= 1 characters
Client
required

Name and version of the client application.

string
>= 1 characters
ServiceId
required

Unique identifier of the Service restrictions will be set in.

string
>= 1 characters
Data
required

Parameters of restrictions.

Array<object>
>= 1 items <= 1000 items
Restriction set data
object
Type
required
Restriction type

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.)

string
Allowed values: Stay Start End
ExactRateId

Unique identifier of the exact Rate to which the restriction applies.

string
nullable
BaseRateId

Unique identifier of the base Rate to which the restriction applies.

string
nullable
RateGroupId

Unique identifier of the Rate group to which the restriction applies.

string
nullable
ResourceCategoryId

Unique identifier of the Resource category to which the restriction applies.

string
nullable
ResourceCategoryType

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

string
Allowed values: 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
StartUtc

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.

string format: date-time
nullable
EndUtc

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.

string format: date-time
nullable
Days
required
Days parameters

The restricted days of week.

object
Monday
required

Monday enabled

boolean
Tuesday
required

Tuesday enabled

boolean
Wednesday
required

Wednesday enabled

boolean
Thursday
required

Thursday enabled

boolean
Friday
required

Friday enabled

boolean
Saturday
required

Saturday enabled

boolean
Sunday
required

Sunday enabled

boolean
MinAdvance

The minimum time before the reservation starts, you can reserve in ISO 8601 duration format.

string format: date-time
nullable
MaxAdvance

The maximum time before the reservation starts, you can reserve in ISO 8601 duration format.

string format: date-time
nullable
MinLength

Minimal reservation length in ISO 8601 duration format.

string format: date-time
nullable
MaxLength

Maximal reservation length in ISO 8601 duration format.

string format: date-time
nullable
MinPrice
Currency value (ver 2023-02-02)

Value of the minimum price per time unit.

object
Currency
required
string format: currency
>= 1 characters
Value
required
number format: double
MaxPrice
Currency value (ver 2023-02-02)

Value of the maximum price per time unit.

object
Currency
required
string format: currency
>= 1 characters
Value
required
number format: double
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"
}
]
}

OK

object
Example
{}

Server has successfully fulfilled the request and there is no additional information to send back.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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).

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable