Skip to content

Add restrictions

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

AddRestrictionParameters
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 added in.

string format: uuid
Restrictions
required

Parameters of restrictions.

Array<object>
>= 1 items <= 1000 items
Restriction data
object
Identifier

Identifier of the restriction within the transaction.

string
nullable
ExternalIdentifier

External identifier of the restriction.

string
nullable
Conditions
required
Restriction condition data

The conditions or rules that must be met by a reservation for the restriction to apply.

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

The restricted days of week. Defaults to all days when not provided. Ignored when the service uses a time unit longer than a day.

Array<string>
nullable
Hours
Hours

The restricted hours. Defaults to all hours when not provided.

object
Zero
required

Hour 0 enabled

boolean
One
required

Hour 1 enabled

boolean
Two
required

Hour 2 enabled

boolean
Three
required

Hour 3 enabled

boolean
Four
required

Hour 4 enabled

boolean
Five
required

Hour 5 enabled

boolean
Six
required

Hour 6 enabled

boolean
Seven
required

Hour 7 enabled

boolean
Eight
required

Hour 8 enabled

boolean
Nine
required

Hour 9 enabled

boolean
Ten
required

Hour 10 enabled

boolean
Eleven
required

Hour 11 enabled

boolean
Twelve
required

Hour 12 enabled

boolean
Thirteen
required

Hour 13 enabled

boolean
Fourteen
required

Hour 14 enabled

boolean
Fifteen
required

Hour 15 enabled

boolean
Sixteen
required

Hour 16 enabled

boolean
Seventeen
required

Hour 17 enabled

boolean
Eighteen
required

Hour 18 enabled

boolean
Nineteen
required

Hour 19 enabled

boolean
Twenty
required

Hour 20 enabled

boolean
TwentyOne
required

Hour 21 enabled

boolean
TwentyTwo
required

Hour 22 enabled

boolean
TwentyThree
required

Hour 23 enabled

boolean
Exceptions
Restriction exception data

The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.

object
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 2018-06-07)

Value of the minimum price per time unit.

object
Currency
required
string format: currency
>= 1 characters
Value
number format: double
nullable
Net
number format: double
nullable
Tax
number format: double
nullable
TaxRate
number format: double
nullable
MaxPrice
Currency value (ver 2018-06-07)

Value of the maximum price per time unit.

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

OK

RestrictionAdditionResult
object
Restrictions

The added restrictions.

Array<object>
nullable
Added restriction
object
Identifier

Identifier of the restriction within the transaction.

string
nullable
Restriction

The added restriction.

object
Id
required

Unique identifier of the restriction.

string format: uuid
ServiceId
required

Unique identifier of the Service.

string format: uuid
ExternalIdentifier

External identifier of the restriction.

string
nullable
Origin
required
Restriction origin

Restriction origin

User (Restriction was created by a user in Mews.)

Integration (Restriction was created by a 3rd-party integration.)

string
Allowed values: User Integration
Conditions
required
Restriction condition

The conditions or rules that must be met by a reservation for the restriction to apply.

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 restricted exact Rate.

string format: uuid
nullable
BaseRateId

Unique identifier of the restricted base Rate.

string format: uuid
nullable
RateGroupId

Unique identifier of the restricted Rate group.

string format: uuid
nullable
ResourceCategoryId

Unique identifier of the restricted Resource category.

string format: uuid
nullable
ResourceCategoryType

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

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 restriction time interval, specified in ISO 8601 format and adjusted to UTC - see Datetimes for important information on format and implementation.

string
nullable
EndUtc

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.

string
nullable
Days

The restricted days of week. Defaults to all days when not provided. Ignored when the service uses a time unit longer than a day.

Array<string>
nullable
Hours
Hours

The restricted hours. Defaults to all hours when not provided.

object
Zero
required

Hour 0 enabled

boolean
One
required

Hour 1 enabled

boolean
Two
required

Hour 2 enabled

boolean
Three
required

Hour 3 enabled

boolean
Four
required

Hour 4 enabled

boolean
Five
required

Hour 5 enabled

boolean
Six
required

Hour 6 enabled

boolean
Seven
required

Hour 7 enabled

boolean
Eight
required

Hour 8 enabled

boolean
Nine
required

Hour 9 enabled

boolean
Ten
required

Hour 10 enabled

boolean
Eleven
required

Hour 11 enabled

boolean
Twelve
required

Hour 12 enabled

boolean
Thirteen
required

Hour 13 enabled

boolean
Fourteen
required

Hour 14 enabled

boolean
Fifteen
required

Hour 15 enabled

boolean
Sixteen
required

Hour 16 enabled

boolean
Seventeen
required

Hour 17 enabled

boolean
Eighteen
required

Hour 18 enabled

boolean
Nineteen
required

Hour 19 enabled

boolean
Twenty
required

Hour 20 enabled

boolean
TwentyOne
required

Hour 21 enabled

boolean
TwentyTwo
required

Hour 22 enabled

boolean
TwentyThree
required

Hour 23 enabled

boolean
Exceptions
Restriction exception

The rules that prevent the restriction from applying to a reservation, even when all conditions have been met.

object
MinAdvance

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

string
nullable
MaxAdvance

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

string
nullable
MinLength

Minimal reservation length in ISO 8601 duration format.

string
nullable
MaxLength

Maximal reservation length in ISO 8601 duration format.

string
nullable
MinPrice
Currency value (ver 2018-06-07)

Value of the minimum price per time unit.

object
Currency
required
string format: currency
>= 1 characters
Value
number format: double
nullable
Net
number format: double
nullable
Tax
number format: double
nullable
TaxRate
number format: double
nullable
MaxPrice
Currency value (ver 2018-06-07)

Value of the maximum price per time unit.

object
Currency
required
string format: currency
>= 1 characters
Value
number format: double
nullable
Net
number format: double
nullable
Tax
number format: double
nullable
TaxRate
number format: double
nullable
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.

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

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