Reservations

This endpoint allows you to import reservations.

Import reservations

POST https://api.mobile-calendar.com/get/reservations

This enpoint resturn the reservations 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 reservations Correct format: YYYY-MM-DD

to

string

"Date to" to import reservations Correct format: YYYY-MM-DD

room_ids

array

Room IDs for which the reservations should be imported. This field is not required. If it is not set, the API will return reservations for all rooms.

{
    "status": "success",
    "data": [
     {
            "reservation_id": "4753990",
            "reservation_number": "4028",
            "room_id": "5630",
            "room_name": "Room 1",
            "days_of_stay": "4",
            "arrival": "2021-01-28",
            "checkin": "15:00",
            "departure": "2021-02-10",
            "checkout": "11:00",
            "checkin_status": "CHEKCED_IN",
            "adults": "2",
            "children": "1",
            "client_id": "105886",
            "forename": "John",
            "name": "Smith",
            "phone": "+48123456789",
            "email": "john@smith.com",
            "payment_status": "NO_PAYMENT",
            "prepayment": "1400",
            "prepayment_to": "2021-01-10",
            "price_per_stay": "2800",
            "currency": "PLN",
            "additional_informations": "Will arrive with dog",
            "source_id": "3",
            "source": "booking.com",
            "display_color": "#ff0000",
            "add_date": "2022-01-11 11:07:43",
            "edit_date": "2022-01-15 13:00:16"
        }   
    ]
}

Example of request

The request below gets reservations for January 1, 2021, through January 28, 2021 and for rooms with ID 5630 and 5645.

If there is no room_ids parameter, the API will return reservations for all rooms.

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

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

The reservation object

Field

Level

Type

Description

status

L0

string

Responsne status success | errror

data

L0

array

Main object "Reservations"

errors

L0

array

Informations about erros

reservation_id

L1

integer

Reservation ID

reservation_number

L1

integer

Number of reservation

room_id

L1

integer

Room ID

room_name

L1

string

Room name

days_of_stay

L1

integer

Days of stay

arrival

L1

date

Arrival date format : YYYY-MM-DD

departure

L1

date

Departure date format : YYYY-MM-DD

checkin

L1

string

Check-in time format : HH:ss

checkout

L1

string

Check-out time format : HH:ss

check_in_status

L1

string

Check-in status, values: NONE, CHECKED-IN, CHECKED-OUT

adults

L1

integer

Adults count

children

L1

integer

Children count

client_id

L1

integer

Client's ID

forename

L1

string

Client's forename

name

L1

string

Client's name

phone

L1

string

Client's phone number

email

L1

string

Client's e-mail address

payment_status

L1

string

Payment status values: NO_PAYMENT, PREPAYMENT_PAID, FULL_AMOUNT_PAID, WAITING_FOR_PAYMENT

prepayment

L1

decimal

prepayment amount format: 100 / 100.00

prepayment_to

L1

date

Prepayment to date format : YYYY-MM-DD

price_per_stay

L1

decimal

Price per stay format: 100 / 100.00

currency

L1

string(3)

Price currency, 3-character currency format compatilbe withISO 4217 Standard

additional_informations

L1

string

Additional informations about booking

source_id

L1

integer

Source ID

source

L1

string

Source name i.e. booking.com / airbnb

display_color

L1

string(#hex)

Reservation color displayed on the calendar format(HEX): #ff1122

door_code

L1

string

Code to open the door

add_date

L1

date

Add date format : YYYY-MM-DD HH:ii:ss

edit_date

L1

date

Last edit date format : YYYY-MM-DD HH:ii:ss

Troubleshooting

Informations about errors

Error

Description

Set date range. Field "From" and "To" is required.

FieldFrom 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_idsparameter, then you must enter value

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!

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

Last updated