Sell limits

Get sell limit state

Changed on

Returns the sell limit state of a daily service for the specified rates, resource categories and time interval. For each combination it returns the effective limit, the number of spaces already sold against it, and the number still available, so an integration can apply the same constraint that Mews Operations applies when a reservation is created. The operation returns an error when the property does not have sell limits enabled, or when the service does not use a time unit period of Day. The operation is not paginated, so the amount of state a request can ask for is capped: rates multiplied by requested resource categories (plus one for the across-all-categories dimension) multiplied by time units must not exceed 10000 combinations. A request over that returns an error naming the count, so narrow RateIds, ResourceCategoryIds or the time interval. Unmatched filter identifiers are ignored and do not count toward it. Note this operation supports Portfolio Access Tokens.

post/api/connector/v1/sellLimits/getState

Request

  • Base URL: https://api.mews.com
  • URL: https://api.mews.com/api/connector/v1/sellLimits/getState
  • Auth: none declared

Request body

ClientTokenstring required

Token identifying the client application.

AccessTokenstring required

Access token of the client application.

Clientstring required

Name and version of the client application.

ServiceIdstring uuid required

Unique identifier of the Service whose sell limits are requested. The service must use a time unit period of Day.

RateIdsstring[] required

Unique identifiers of the Rate for which sell limit state is returned. Subject to the combination cap described on the operation, so this bound and the resource category and interval bounds cannot all be used at their maximum together.

ResourceCategoryIdsstring[] nullable

Unique identifiers of the Resource category for which sell limit state is returned. The limit that applies across all resource categories is reported alongside them, as an item whose ResourceCategoryId is null.

FirstTimeUnitStartUtcstring date-time required

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

LastTimeUnitStartUtcstring date-time required

End of the time interval, expressed as the timestamp for the start of the last time unit, in UTC timezone ISO 8601 format. The interval can span at most 100 days.

Response

OK

TimeUnitStartsUtcstring[] required

Starts of the time units covered by the request, in ascending order, in UTC timezone ISO 8601 format. Every metric array in this response has exactly this many elements, in this order.

Changes