This API endpoint allows you to create a new booking.
Method
POST
URL
https://api.mosler.in/api/v3/booking/create
Request Body
|
bookingStartDate | string | Yes | Start date of the booking. Must be provided in ISO 8601 format. |
bookingEndDate | string | Yes | End date of the booking. Must be provided in ISO 8601 format. |
roomNumber | string | Yes | The room number for the booking. |
customerEmail | string | No | The email address of the customer. |
customerPhone | string | No | The phone number of the customer. Either email or phone required. |
siteId | string | Yes | The unique identifier for the site. |
bedNumber | string | No | The bed number for the booking. |
referenceId | string | Yes | The unique identifier for the booking. |
customerName | string | Yes | The name of the customer. |
accessType | string | No | Type of access. Valid values: "EKEY", "PASSCODE", "CARD". Default: "EKEY" |
cardId | string | No | Card 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
|
message | string | The message returned by the API. |
code | number | The status code returned by the API. |
error | boolean | Indicates if an error occurred during the API call. |
data | object | The 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
}
]
}
}