Prices and restrictions
This endpoint allows you to import prices and restrictions.
post
https://api.mobile-calendar.com
/get/pricing
Import prices and restrictions
The request below gets prices for January 1, 2021, through January 2, 2021
and for rooms with ID 5630 and 5645.
If there is no
room_ids
parameter, the API will return prices for all rooms.{
"from" : "2021-01-01",
"to" : "2021-01-02",
"room_ids" : [5630, 5645]
}
You can find the room ID in the rooms details form.
Field | Level | Type | Description |
status | L0 | string | Responsne status success | errror |
errors | L0 | array | Informations about errors |
data | L0 | object | Main object "Pricing" |
currency | L1 | string(3) | Price list currency, 3-character currency format compatilbe with ISO 4217 Standard |
room | L1 | array | List of rooms, the key of given room is it's ID |
room_name | L3 | string | Room name |
pricing_type | L3 | string | Type of price list. Allowed formats: PRICE_PER_ROOM | PRICE_PER_PERSON | DERIVED_PRICE_MODEL |
options | L3 | array | Prices for different person. Only available in the pricing model DERIVED_PRICE_MODEL |
leading_occupancy | L4 | integer | Leading occupancy. Only occur with the parent field options |
persons | L4 | array | Individual options. Only occur with the parent field options |
person | L5 | integer | Number of people referenced by prices |
type | L5 | string | Indicates whether the discount is to be a percentage or an amount. Formats: additional - currency / amount discount % - percentage discount |
prefix | L5 | string(1) | Indicates whether the amount should be negative or positive. Formats: + | - |
amount | L5 | float | Amount, correct format: 100 | 100.00 |
prices_and_restrictions | L3 | array | Prices and restrictions for a given day, the key of a given day is its date |
price | L5 | float | Price, correct format: 100 | 100.00 |
min_price | L5 | float | Minimal price, Only available in the pricing model PRICE_PER_PERSON
correct format: 100 | 100.00 |
price_child | L5 | float | Price for a child, Only available in the pricing model PRICE_PER_PERSON
correct format: 100 | 100.00 |
min_stay | L5 | integer | Minimum period of stay |
max_stay | L5 | integer | Maximum period of stay |
avail_arrival | L5 | bool | Available arrival, format: 0 | 1 |
avail_departure | L5 | bool | Available departure, format 0 | 1 |
discount | L5 | array | Discount for the stay |
discount.min_stay | L6 | integer | The minimum period of stay for which the discount begins |
discount.price | L6 | float | Amount or % discount, correct format: 100 | 100.00 |
discount.type | L6 | integer | Percentage or currency discount type. 0 - oznacza procentowy 1 - oznacza walutowy |
PRICE_PER_ROOM
PRICE_PER_PERSON
DERIVED_PRICE_MODEL
"Price per room" pricing model. Means that the price per room is fixed, regardless of the number of people.
"Price per person" pricing model. The price is calculated on the basis of the number of people and / or the number of children. You can set a minimum price. If the price for people / children is lower than the minimum price, the minimum price is selected.
"Derived pricing model" - in this pricing model we can set a different price for any number of people.
There is always in the derived pricing model field
options
.
Leading_occupany
denotes the base price. The basic price is set in the field price
field.
For the example below, if the base price is 200:
Price for 5 people = 200 (leading_occupancy)
Price for 4 people = 150 (leading_occupany - 25%)
Price for 3 people = 140 (leading_occupany - 30%)
Price for 2 people = 130 (leading_occupany - 35%)
Price for 1 person = 120 (leading_occupany - 40%) "options": [
"leading_occupancy": "5",
"persons": [
{
"person": 4,
"type": "%",
"prefix": "-",
"amount": "25"
},
{
"person": 3,
"type": "%",
"prefix": "-",
"amount": "30"
},
{
"person": 2,
"type": "%",
"prefix": "-",
"amount": "35"
},
{
"person": 1,
"type": "%",
"prefix": "-",
"amount": "40"
}
]
]
Error | Description |
Set date range.
Field "From" and "To" is required. | Field From and To are required parameters |
Incorrect format of "From" and/or "To" fields. Correct format YYYY-MM-DD | Invalid date format. The correct format is: YYYY-MM-DD |
"From" date can not be greater than or equal to "To" date. Incorrect date "From" or "To" | Date From can not be greather than to date |
Maximum date range is 90 days | The maximum range for dates is 90 days |
Add room IDs | If you set room_ids parameter, then you must enter value |
Wrong room IDs | You entered the wrong room ID or the rooms are not assigned to your account |
HTTP status 200 OK.
Note that the HTTP 200 OK code does not mean the answer is correct at all!
{
"status": "error",
"data": [],
"errors": [
"Incorrect format of \"From\" and/or \"To\" fields. Correct format YYYY-MM-DD",
"Incorrect date \"From\" or \"To\""
]
}
Last modified 4mo ago