v3/Booking API's

Create Booking

This API endpoint allows you to create a new booking.

Method

POST

URL

https://api.mosler.in/api/v3/booking/create

Headers

NameTypeRequiredDescription
apikeystringYesAPI Key

Request Body

NameTypeRequiredDescription
bookingStartDatestringYesStart date of the booking. Must be provided in ISO 8601 format.
bookingEndDatestringYesEnd date of the booking. Must be provided in ISO 8601 format.
roomNumberstringYesThe room number for the booking.
customerEmailstringNoThe email address of the customer.
customerPhonestringNoThe phone number of the customer. Either email or phone required.
siteIdstringYesThe unique identifier for the site.
bedNumberstringNoThe bed number for the booking.
referenceIdstringYesThe unique identifier for the booking.
customerNamestringYesThe name of the customer.
accessTypestringNoType of access. Valid values: "EKEY", "PASSCODE", "CARD". Default: "EKEY"
cardIdstringNoCard identifier (if applicable).

Request Example

fetch('https://api.mosler.in/api/v3/booking/create', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        apikey: 'YOUR_API_KEY',
    },
    body: JSON.stringify({
        bookingStartDate: '2025-07-18T14:48:00.000Z',
        bookingEndDate: '2025-11-30T14:48:00.000Z',
        roomNumber: '101',
        customerEmail: 'johndoe@gmail.com',
        customerPhone: '9991239874',
        siteId: '64f5fc4aad93a7fadbf013d6',
        bedNumber: 'a',
        referenceId: 'ABCDEF-123',
        customerName: 'John Doe',
        accessType: 'EKEY',
        cardId: '12345',
    }),
});

Response Parameters

NameTypeDescription
messagestringThe message returned by the API.
codenumberThe status code returned by the API.
errorbooleanIndicates if an error occurred during the API call.
dataobjectThe data returned by the API.

Response Example

{
    "message": "Successfully created Booking.",
    "code": 7000,
    "error": false,
    "data": {
        "customerEmail": "johndoe@gmail.com",
        "keyId": 118483626,
        "lockId": "62486",
        "referenceId": "ABCDEF-123",
        "moslerEmail": "",
        "additionalLocksWithKey": [
            {
                "lockId": "863357",
                "keyId": 118483628
            },
            {
                "lockId": "573634",
                "keyId": 118483630
            }
        ]
    }
}