Prices and restrictions
This endpoint allows you to import prices and restrictions.
Import prices and restrictions
POST
https://api.mobile-calendar.com/get/pricing
This enpoint resturn the price list for date range as well as for given rooms.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | API login and password are required header parameters for authentication |
Request Body
Name | Type | Description |
---|---|---|
from | string | "Date from" to import price list
Correct format: |
to | string | "Date to" to import price list
Correct format: |
room_ids | array | Room IDs for which the price list should be imported. This field is not required. If it is not set, the API will return prices for all rooms. |
Example of request
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.
You can find the room ID in the rooms details form.
The price list object
Field | Level | Type | Description |
status | L0 | string | Responsne status |
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 |
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:
|
options | L3 | array | Prices for different person. Only available in the pricing model |
leading_occupancy | L4 | integer | Leading occupancy. Only occur with the parent field |
persons | L4 | array | Individual options. Only occur with the parent field |
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:
|
prefix | L5 | string(1) | Indicates whether the amount should be negative or positive. Formats: |
amount | L5 | float | Amount, correct format: |
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: |
min_price | L5 | float | Minimal price, Only available in the pricing model |
price_child | L5 | float | Price for a child, Only available in the pricing model |
min_stay | L5 | integer | Minimum period of stay |
max_stay | L5 | integer | Maximum period of stay |
avail_arrival | L5 | bool | Available arrival, format: |
avail_departure | L5 | bool | Available departure, format |
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: |
discount.type | L6 | integer | Percentage or currency discount type.
|
Pricing models
"Price per room" pricing model. Means that the price per room is fixed, regardless of the number of people.
Troubleshooting
Informations about errors
Error | Description |
Set date range. Field "From" and "To" is required. | Field |
Incorrect format of "From" and/or "To" fields. Correct format YYYY-MM-DD | Invalid date format. The correct format is: |
"From" date can not be greater than or equal to "To" date. Incorrect date "From" or "To" | Date |
Maximum date range is 90 days | The maximum range for dates is 90 days |
Add room IDs | If you set |
Wrong room IDs | You entered the wrong room ID or the rooms are not assigned to your account |
An example of a respone with an error
HTTP status 200 OK.
Note that the HTTP 200 OK code does not mean the answer is correct at all!
Last updated