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

Request Body

{
    "status": "success",
    "data": {
        "currency": "PLN",
        "rooms": {
            "5630": {
                "room_name": "Room1",
                "pricing_type": "PRICE_PER_ROOM",
                "prices_and_restrictions": {
                    "2021-01-01": {
                        "price": "200",
                        "min_stay": "3",
                        "max_stay": "30",
                        "avail_arrival": "1",
                        "avail_departure": "1",
                        "discount": {
                            "min_stay": "7",
                            "price": "10",
                            "type": "1"
                        }
                    },
                    "2021-01-02": {
                        "price": "200",
                        "min_stay": "3",
                        "max_stay": "30",
                        "avail_arrival": "1",
                        "avail_departure": "1",
                        "discount": {
                            "min_stay": "7",
                            "price": "10",
                            "type": "0"
                        }
                    }
                }
            },
            "5645": {
                "room_name": "Room2",
                "pricing_type": "DERIVED_PRICE_MODEL",
                "prices_and_restrictions": {
                    "2021-01-01": {
                        "price": "200"
                    },
                    "2021-01-02": {
                        "price": "200"
                    }
                },
                "options": {
                    "leading_occupancy": "3",
                    "persons": [
                        {
                            "person": 2,
                            "type": "%",
                            "prefix": "-",
                            "amount": "30"
                        },
                        {
                            "person": 1,
                            "type": "%",
                            "prefix": "-",
                            "amount": "50"
                        }
                    ]
                }
            }
        }
    }
}

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.

{
    "from" : "2021-01-01", 
    "to" : "2021-01-02",
    "room_ids" : [5630, 5645]
}

You can find the room ID in the rooms details form.

The price list object

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

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!

{
    "status": "error",
    "data": [],
    "errors": [
        "Incorrect format of \"From\" and/or \"To\" fields. Correct format YYYY-MM-DD",
        "Incorrect date \"From\" or \"To\""
    ]
}

Last updated