v3/Booking API's

Update Booking

This API endpoint allows you to update an existing booking.

Method

PUT

URL

https://api.mosler.in/api/v3/booking/update
https://api.mosler.in/api/v3/booking/update/:referenceId

Headers

NameTypeRequiredDescription
apikeystringYesAPI Key

Event Types

No.ValueDescription
1updateUpdate the booking details and regenerate keys accordingly.
2check_inGenerate Ekey for existing booking.
3check_outFreeze Ekey for existing booking.
4cancelDelete Ekeys for existing booking.
5room_moveGenerate Ekey for new room and delete Ekey for old room.
6date_changeUpdate the booking dates.

Request Body

NameTypeRequiredDescription
bookingStartDatestringNoStart date of the booking. Must be provided in ISO 8601 format.
bookingEndDatestringNoEnd date of the booking. Must be provided in ISO 8601 format.
roomNumberstringNoThe room number for the booking.
customerEmailstringNoThe email address of the customer.
bedNumberstringNoThe bed number for the booking.
referenceIdstringYesThe unique identifier for the booking.
customerNamestringNoThe name of the customer.
eventTypestringNoThe event type of the update query. Defaults to update.

Request Example

fetch('https://api.mosler.in/api/v3/booking/update', {
    method: 'PUT',
    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: 'johndoe2@gmail.com',
        bedNumber: 'a',
        referenceId: 'ABCDEF-123',
        customerName: 'John Doe',
        eventType: 'update',
    }),
});

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 updated Booking.",
    "code": 7001,
    "error": false,
    "data": {
        "customerEmail": "johndoe2@gmail.com",
        "keyId": 118483660,
        "lockId": "123456",
        "referenceId": "ABCDEF-123",
        "moslerEmail": "",
        "additionalLocksWithKey": [
            {
                "lockId": "547353",
                "keyId": 118483664
            },
            {
                "lockId": "463634",
                "keyId": 118483666
            }
        ]
    }
}