Skip to Content
HomeLink Hub
Bookings

Create a booking request

POST
/api/v1/booking/create

Access: Bearer token required.

Creates a booking in status requested for the authenticated user (stored as tenantId); landlordId is copied from the property. type selects one of three flows:

  • viewing – a visit request for requestedDate (must be in the future). The listing agent (or the landlord when the property has no agentId) gets a booking_requested notification.
  • reservation – the "request payment" step of a property inquiry. Only one reservation in status requested or confirmed is allowed per tenant per property. The agent/landlord gets a payment_request notification with the New Payment Request email.
  • shortlet – a stay on a SHORTLET property. Send checkIn/checkOut instead of requestedDate (which is forbidden for this type). Dates are normalised to midnight UTC, the stay must respect the property's shortLet.minNights/maxNights, and the nights are claimed atomically in property.shortLet.bookedRanges (check-out day is free, so back-to-back stays may share a date). totalPrice is stored as nights * shortLet.nightlyPrice. The agent/landlord gets a payment_request notification titled New Stay Request.

Notifications are delivered per the recipient's preferences (stored in-app + notifications:new socket event, push, email) and never fail the request. You cannot book a property whose landlordId is you. No role, email-verification or KYC check is applied.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Request Body

application/json
  1. body
propertyId*string

ObjectId of the property being booked.

Match^[0-9a-fA-F]{24}$
type*string

Booking flow: viewing, reservation (payment request) or shortlet (stay).

Value in"viewing""reservation""shortlet"
requestedDate?

Required for viewing and reservation, forbidden for shortlet. Must be later than the current server time.

Formatdate-time
checkIn?

Required for shortlet, forbidden otherwise. First night of the stay; truncated to midnight UTC and must not be before today (UTC).

Formatdate-time
checkOut?

Required for shortlet, forbidden otherwise. Must be after checkIn; truncated to midnight UTC. The check-out day itself is not occupied.

Formatdate-time
notes?string

Free-text note for the landlord/agent (max 500 characters).

Lengthlength <= 500
visitDuration?number

Viewings only: expected length of the visit in hours (0.5 to 8). Stored on dates.visitDuration.

Formatfloat
Range0.5 <= value <= 8

Response Body

  • Viewing (or reservation) booking created. data is the new booking document.
  • Short-let stay created. dates carries checkIn, checkOut and nights instead of requestedDate, and totalPrice is set.
application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/booking/create' \  -H 'Content-Type: application/json' \  -d '{  "propertyId": "664a0b7e3f2c1d0012ef5a01",  "type": "viewing",  "requestedDate": "2026-12-04T10:00:00.000Z",  "visitDuration": 1,  "notes": "I would like to see the kitchen and the parking space."}'
Example Response
{  "status": 201,  "success": true,  "message": "Booking created successfully",  "data": {    "_id": "665f1c2e9b1d4a0012ab34cd",    "propertyId": "664a0b7e3f2c1d0012ef5a01",    "tenantId": "663d9a1c5e4b2a0012cd7f10",    "landlordId": "6629e4f08a7b3c0012aa9e42",    "status": "requested",    "type": "viewing",    "dates": {      "requestedDate": "2026-12-04T10:00:00.000Z",      "visitDuration": 1    },    "notes": "I would like to see the kitchen and the parking space.",    "escrowId": null,    "createdAt": "2026-11-25T09:14:22.318Z",    "updatedAt": "2026-11-25T09:14:22.318Z",    "__v": 0  }}