In order to create an own contract linked to a certain hotel, you need to use method POST /accommodationContract with the possibility to choose to which hotel this contract should be linked.
Example of the request POST /accommodationContract API method:
For example:
{ "supplierId": 5654899, "hotelId": 11814738, "active": true, "transactionsCurrency": "USD", "sameBoard": false, "name": { "en": "Hotel Charles OLD" } } |
Response Body
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "contract": { "id": 6025425, "accommodationName": "Hotel Charles OLD", "supplierId": 5654899, "transactionsCurrency": "USD", "sameBoard": false, "hotelId": 11814738, "active": true } } |
2. In order to add prices on price-lists, it is required to create price-list first with API method PUT /accommodationPrices:
to specify for which contact it is to be done use method GET /contracts;
to specify for which room to add prices use method GET /availability (roomTypeId=categoryId and serviceId);
to specify which meal type are included into room price you add, please use method GET /prices (secondaryServiceId and mealTypeId).
Example of the request PUT /accommodationPrices API method to create a price-list:
{ "priceLists": [ { "prices": [ { "roomTypeId": 2290035, "amount": 80, "placeType": "Base", "formula": "80", "currency": "USD", "mealTypeId": 2290041, "serviceId": 6025393 } ], "priceTypeCode": "PerUnit", "calculationType": "PRICE_PER_SERVICE", "active": true, "name": "Low Season" } ] } |
Response Body
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "accommodationContractId": 6025425, "touristCategories": [], "extraServices": [], "discounts": [], "priceLists": [ { "id": 6025469, "name": "Low Season", "prices": [ { "roomTypeId": 2290035, "mealTypeId": 2290041, "amount": 80, "currency": "USD", "formula": "80", "serviceId": 6025393, "placeType": "Base" } ], "active": true, "priceTypeCode": "PerUnit", "calculationType": "PRICE_PER_SERVICE", "tariffLinks": [] } ], "surcharges": [], "extraServicesPriceLists": [], "commissions": [], "penalties": [], "availabilityTerms": [], "tariffs": [] } |
3. After price-list is created you need to link it to a certain tariff using the same method PUT /accommodationPrices specifying additional details like dates, week days and etc.
Example of the request PUT /accommodationPrices API method to create tariff:
{ "tariffs": [ { "priceLists": [ { "weekDays": [ true, true, true, true, true, true, true ], "dateFrom": "2023-01-02", "dateTo": "2023-12-31", "referedToId": 6025469, "minDay": 3, "maxDay": 14 } ] } ] } |
Response Body
Panel | ||||
---|---|---|---|---|
|
...
| |||
{ "accommodationContractId": 6025425, "touristCategories": [], "extraServices": [], "discounts": [], "priceLists": [], "surcharges": [], "extraServicesPriceLists": [], "commissions": [], "penalties": [], "availabilityTerms": [], "tariffs": [ { "id": 6025471, "priceLists": [ { "referedToId": 6025469, "dateFrom": "2023-01-02", "dateTo": "2023-12-31", "weekDays": [ true, true, true, true, true, true, true ], "minDay": 3, "maxDay": 14 } ], "bruttoPriceLists": [], "surcharges": [], "extraServicesPriceLists": [], "commissions": [], "penalties": [], "mealTypes": [], "useTerms": [], "availabilityTerms": [], "tags": [], "orderModification": {}, "pricesApplicationType": "NETTO_PRICES", "limitsOnCitizenship": [], "membershipLevels": [], "byFirstNight": false, "inheritPrices": {} } ] } |