Add rates
POST /api/connector/v1/rates/add
Adds rates to the enterprise. Note this operation supports Portfolio Access Tokens. Rate type of AvailabilityBlock
cannot be created via this operation.
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 enterprise. Required when using Portfolio Access Tokens, ignored otherwise.
Information about rates to be created.
object
Unique identifier of the service.
Unique identifier of the rate group under which rate is assigned.
Whether the rate is available to customers. false
will be used as a default when not provided.
Type of the rate.
Public
Private
Unique identifier of the accounting category the rate belongs to.
Unique identifier of the business segment.
All translations of the name of the rate.
object
All translations of the short name of the rate.
object
All translations of the external name of the rate.
object
All translations of the description.
object
Discriminator in which field inside Pricing
contains additional data.
BaseRatePricing
DependentRatePricing
Identifier of the rate from external system.
Contains additional data about pricing of the rate.
object
Additional data for rates with base rate pricing. Used when PricingType
is BaseRatePricing
. Defaults are applied if not specified: amount is set to 10000 in default Enterprise’s currency and with its default accommodation tax rate code.
object
Price of the product that overrides the price defined in Mews.
object
This is the amount added to the price when occupancy of the space is less than the Space Category Capacity. To provide a discount price for under-occupancy, simply use a negative value.
This is the amount added to the price when the Space Category Capacity is exceeded.
Additional data for rate with dependent rate pricing. Required when PricingType
is DependentRatePricing
.
object
Unique identifier of the base rate.
Relative amount which shows the difference between this rate and the base rate.
Specific amount which shows the difference between this rate and the base rate.
Example
{ "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D", "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D", "Client": "Sample Client 1.0.0", "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Rates": [ { "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "RateGroupId": "b9f25a45-9b9a-4b33-99bd-b06f008eb6f5", "IsEnabled": true, "Type": "Public", "AccountingCategoryId": "3620c660-a4ec-4e0f-a0bc-b06f008eb8bf", "Names": { "EN": "My rate" }, "ExternalIdentifier": "D001", "PricingType": "DependentRatePricing", "Pricing": { "DependentRatePricing": { "BaseRateId": "1a1ddd3b-e106-4a70-aef1-54a75b483943", "RelativeAdjustment": 0.15, "AbsoluteAdjustment": 10 } } } ]}
Responses
Section titled “ Responses ”OK
object
Rates that have been added.
object
Unique identifier of the rate.
Unique identifier of Rate Group
where the rate belongs.
Unique identifier of the Service
.
Unique identifier of the base Rate
.
Indicates if this is a base rate.
Unique identifier of the Business Segment
.
Indicates if this rate is active.
Indicates if this rate is currently available to customers.
Indicates if this rate is publicly available.
Indicates if this rate is the default rate for the service. Assigned automatically to the first rate of a service.
Type of the rate.
Public
Private
AvailabilityBlock
Name of the rate (in the default language).
All translations of the name.
object
Short name of the rate (in the default language).
Interval in which the rates were updated.
All translations of the external name of the rate.
object
All translations of the description of the rate.
object
Identifier of the rate from external system.
Specifies the reason a rate is exempt from tax.
IT_N1 (N1 - Escluse ex art.15)
IT_N2_2 (N2.2 - Non soggette – altri casi)
IT_N3_5 (N3.5 - Non imponibili – a seguito di dichiarazioni d’intento)
IT_N4 (N4 - Esenti)
IT_N5 (N5 - Regime del margine / IVA non esposta in fattura)
PL_ZW (ZW - Zwolniony)
PL_NP (NP - Nie podlega)
Legal reference that states why this rate is exempt from tax.
Example
{ "Rates": [ { "Id": "ed4b660b-19d0-434b-9360-a4de2ea42eda", "GroupId": "b9f25a45-9b9a-4b33-99bd-b06f008eb6f5", "BaseRateId": "1a1ddd3b-e106-4a70-aef1-54a75b483943", "BusinessSegmentId": null, "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "IsActive": true, "IsEnabled": true, "IsPublic": true, "Type": "Public", "Name": "My rate", "ShortName": "FF", "ExternalNames": { "en-US": "Long Stay Flexible Rate" }, "ExternalIdentifier": "D001" } ]}
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
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.