This API endpoint allows you to create a new booking.
Method
POST
URL
Copy https://api.mosler.in/api/v3/booking/create
Request Body
bookingStartDatestringYes Start date of the booking. Must be provided in ISO 8601 format. bookingEndDatestringYes End date of the booking. Must be provided in ISO 8601 format. roomNumberstringYes The room number for the booking. customerEmailstringNo The email address of the customer. customerPhonestringNo The phone number of the customer. Either email or phone required. siteIdstringYes The unique identifier for the site. bedNumberstringNo The bed number for the booking. referenceIdstringYes The unique identifier for the booking. customerNamestringYes The name of the customer. accessTypestringNo Type of access. Valid values: "EKEY", "PASSCODE", "CARD". Default: "EKEY" cardIdstringNo Card identifier (if applicable).
Request Example
Copy 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
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
Copy {
"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
}
]
}
}