Skip to content

Add availability blocks

POST
/api/connector/v1/availabilityBlocks/add

Adds availability blocks which are used to group related Availability updates. This makes limiting public availability easier and more organized. Note this operation supports Portfolio Access Tokens.

MultipleAvailabilityBlockAddParameters
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
EnterpriseId

Unique identifier of the enterprise. Required when using Portfolio Access Tokens, ignored otherwise.

string format: uuid
nullable
AvailabilityBlocks
required

Availability blocks to be added.

Array<object>
>= 1 items <= 1000 items
Availability block parameters
object
ServiceId
required

Unique identifier of the Service to assign block to.

string format: uuid
RateId
required

Unique identifier of the Rate to assign block to.

string format: uuid
FirstTimeUnitStartUtc
required

Start of the time interval, expressed as the timestamp for the start of the first time unit, in UTC timezone ISO 8601 format.

string
>= 1 characters
LastTimeUnitStartUtc
required

End of the time interval, expressed as the timestamp for the start of the first time unit, in UTC timezone ISO 8601 format.

string
>= 1 characters
ReleasedUtc

The moment when the block and its availability is released, in UTC timezone ISO 8601 format. Takes precedence over RollingReleaseOffset.

string format: date-time
nullable
RollingReleaseOffset

Exact offset from the start of availability adjustments to the moment the availability adjustment should be released, in ISO 8601 duration format. Ignored if ReleasedUtc is specified.

string
nullable
Name

The name of the block.

string
nullable
VoucherCode

Voucher code providing access to specified private Rate.

string
nullable
BookerId

Unique identifier of the Booker as a creator of an availability block.

string format: uuid
nullable
CompanyId

Unique identifier of Company.

string format: uuid
nullable
TravelAgencyId

Unique identifier of travel agency (Company with a TravelAgencyContract).

string format: uuid
nullable
Budget
Currency value (ver 2018-06-07)

The tentative budget for the total price of reservations.

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
ReservationPurpose

The purpose of the block.

Leisure

Business

Student

string
Allowed values: Leisure Business Student
ExternalIdentifier

Identifier of the block from external system.

string
nullable <= 255 characters
Notes

Additional notes of the block.

string
nullable
State
required

State of the availability block.

Confirmed (The block deducts availability and can have reservations assigned.)

Optional (The block deducts availability and cannot have reservations assigned.)

Inquired (The block does not deduct availability and cannot have reservations assigned (waitlist).)

Canceled (The block does not deduct availability and cannot have reservations assigned (waitlist).)

string
Allowed values: Confirmed Optional Inquired Canceled
QuoteId

Unique identifier of the Mews Events quote associated with the availability block.

string format: uuid
nullable
PurchaseOrderNumber

Unique number of the purchase order. This number is propagated to any newly picked up Reservation within the block.

string
nullable
Example
{
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
"Client": "Sample Client 1.0.0",
"AvailabilityBlocks": [
{
"ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94",
"RateId": "ed4b660b-19d0-434b-9360-a4de2ea42eda",
"FirstTimeUnitStartUtc": "2020-11-05T00:00:00Z",
"LastTimeUnitStartUtc": "2020-11-06T00:00:00Z",
"ReleasedUtc": "2020-11-04T00:00:00Z",
"Name": "Mr. Smith's block",
"Budget": {
"Currency": "USD",
"Value": 48
},
"ExternalIdentifier": "Block-0001",
"State": "Confirmed"
},
{
"ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94",
"RateId": "ed4b660b-19d0-434b-9360-a4de2ea42eda",
"FirstTimeUnitStartUtc": "2021-11-05T00:00:00Z",
"LastTimeUnitStartUtc": "2021-11-06T00:00:00Z",
"Name": "Rolling release block",
"Budget": {
"Currency": "USD",
"Value": 48
},
"ExternalIdentifier": "Block-0002",
"State": "Confirmed"
}
],
"EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

OK

AvailabilityBlockAddResult
object
AvailabilityBlocks
required

Availability blocks.

Array<object>
Availability block
object
Id

Unique identifier of the availability block.

string format: uuid
EnterpriseId

Unique identifier of the enterprise.

string format: uuid
ServiceId

Unique identifier of the Service the block is assigned to.

string format: uuid
RateId

Unique identifier of the Rate the block is assigned to.

string format: uuid
VoucherId

Unique identifier of the Voucher used to access specified private Rate.

string format: uuid
nullable
BookerId

Unique identifier of the Customer on whose behalf the block was made.

string format: uuid
nullable
CompanyId

Unique identifier of the Company linked to the block.

string format: uuid
nullable
TravelAgencyId

Unique identifier of Companywith Travel agency contract the Availability Block is related to.

string format: uuid
nullable
Budget
Currency value (ver 2018-06-07)

The tentative budget for the total price of reservations in the block.

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
State
required
Availability block state

State of the availability block.

Confirmed (The block deducts availability and can have reservations assigned.)

Optional (The block deducts availability and cannot have reservations assigned.)

Inquired (The block does not deduct availability and cannot have reservations assigned (waitlist).)

Canceled (The block does not deduct availability and cannot have reservations assigned (waitlist).)

string
Allowed values: Confirmed Optional Inquired Canceled
ReservationPurpose

The purpose of the block.

Leisure

Business

Student

string
Allowed values: Leisure Business Student
CreatedUtc
required

Creation date and time of the block in UTC timezone in ISO 8601 format.

string
>= 1 characters
UpdatedUtc
required

Last update date and time of the block in UTC timezone in ISO 8601 format.

string
>= 1 characters
FirstTimeUnitStartUtc
required

Start of the time interval, expressed as the timestamp for the start of the first time unit, in UTC timezone ISO 8601 format. See Time units.

string
>= 1 characters
LastTimeUnitStartUtc
required

End of the time interval, expressed as the timestamp for the start of the last time unit, in UTC timezone ISO 8601 format. See Time units.

string
>= 1 characters
ReleasedUtc

The moment when the block and its availability is released in UTC timezone in ISO 8601 format. Mutually exclusive with RollingReleaseOffset; the block will not be automatically released if neither ReleasedUtc nor RollingReleaseOffsetUtc is specified.

string
nullable
RollingReleaseOffset

Exact offset from the start of availability adjustments to the moment the individual days in the adjustment should be released, in ISO 8601 duration format. Mutually exclusive with ReleasedUtc; the block will not be automatically released if neither ReleasedUtc nor RollingReleaseOffsetUtc is specified.

string
nullable
ExternalIdentifier

Identifier of the block from external system.

string
nullable <= 255 characters
Name

The name of the block in Mews.

string
nullable
Notes

Additional notes of the block.

string
nullable
PickupDistribution
required
Pickup distribution

Whether assigning spaces to reservations within an availability block is done as a single group or divided into individual groups.

AllInOneGroup (All created reservations in the block are added to the same reservation group.)

IndividualGroups (Reservations can be picked up in multiple groups, with up to 750 reservations per group.)

string
Allowed values: AllInOneGroup IndividualGroups
IsActive
required

Whether the Availability Block is still active.

boolean
QuoteId

Unique identifier of the Mews Events quote associated with the availability block.

string format: uuid
nullable
AvailabilityBlockNumber
required

Unique number for a specific availability block within the Mews system.

string
>= 1 characters
ReleaseStrategy
required
Release strategy

The strategy for automatic release of the availability block.

FixedRelease (The availability block is released at a fixed time.)

RollingRelease (Each availability adjustment is released at a fixed offset from its start.)

None (The availability block is not automatically released.)

string
Allowed values: FixedRelease RollingRelease None
PurchaseOrderNumber

Unique number of the purchase order. This number is propagated to any newly picked up Reservation within the block.

string
nullable
Example
{
"AvailabilityBlocks": [
{
"Id": "5ee074b1-6c86-48e8-915f-c7aa4702086f",
"EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94",
"RateId": "ed4b660b-19d0-434b-9360-a4de2ea42eda",
"VoucherId": null,
"BookerId": "ebd507c5-6bfd-4ca9-96aa-ffed6fa94f72",
"CompanyId": null,
"TravelAgencyId": null,
"Budget": {
"Currency": "USD",
"Value": 48,
"Net": null,
"Tax": null,
"TaxRate": null
},
"State": "Confirmed",
"ReservationPurpose": "Leisure",
"CreatedUtc": "2020-11-04T13:00:00Z",
"UpdatedUtc": "2020-11-04T13:00:00Z",
"FirstTimeUnitStartUtc": "2020-11-04T13:00:00Z",
"LastTimeUnitStartUtc": "2020-11-04T13:00:00Z",
"ReleasedUtc": "2020-11-04T13:00:00Z",
"RollingReleaseOffset": null,
"ExternalIdentifier": "Block-0001",
"Name": "Wedding group",
"Notes": "Have a nice stay",
"PickupDistribution": "AllInOneGroup",
"IsActive": false,
"QuoteId": null,
"AvailabilityBlockNumber": "478",
"ReleaseStrategy": "FixedRelease",
"PurchaseOrderNumber": "XX-123"
},
{
"Id": "c32386aa-1cd2-414a-a823-489325842fbe",
"EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94",
"RateId": "ed4b660b-19d0-434b-9360-a4de2ea42eda",
"VoucherId": null,
"BookerId": "ebd507c5-6bfd-4ca9-96aa-ffed6fa94f72",
"CompanyId": null,
"TravelAgencyId": null,
"Budget": {
"Currency": "USD",
"Value": 48,
"Net": null,
"Tax": null,
"TaxRate": null
},
"State": "Confirmed",
"ReservationPurpose": "Leisure",
"CreatedUtc": "2022-10-11T13:32:32Z",
"UpdatedUtc": "2022-10-11T13:32:32Z",
"FirstTimeUnitStartUtc": "2022-10-14T00:00:00Z",
"LastTimeUnitStartUtc": "2022-11-17T00:00:00Z",
"ReleasedUtc": null,
"RollingReleaseOffset": "P-3DT4H",
"ExternalIdentifier": "Block-0002",
"Name": "Rolling release",
"Notes": null,
"PickupDistribution": "AllInOneGroup",
"IsActive": false,
"QuoteId": "67eaf3c8-81e0-4ffb-b5f2-2b61803feb9c",
"AvailabilityBlockNumber": "479",
"ReleaseStrategy": "RollingRelease",
"PurchaseOrderNumber": null
}
],
"ServiceOrders": null,
"Adjustments": [
{
"Id": "e19297af-373e-4701-b4ea-afae0129bded",
"AvailabilityBlockId": "5ee074b1-6c86-48e8-915f-c7aa4702086f",
"ResourceCategoryId": "773d5e42-de1e-43a0-9ce6-f940faf2303f",
"StartUtc": null,
"EndUtc": null,
"FirstTimeUnitStartUtc": "2021-10-14T00:00:00Z",
"LastTimeUnitStartUtc": "2021-10-17T00:00:00Z",
"UnitCount": 6,
"ActivityState": "Active",
"ReleaseOverrideUtc": "2021-10-13T00:00:00Z",
"UpdatedUtc": "2021-10-21T13:32:32Z",
"IsActive": false,
"PaxCounts": null,
"FirstTimeUnitReleaseUtc": "2021-10-13T00:00:00Z"
}
],
"Rates": null,
"Cursor": "c32386aa-1cd2-414a-a823-489325842fbe"
}

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