Skip to Content
HomeLink Hub
Bookings

Confirm a booking

PATCH
/api/v1/booking/{id}/confirm

Access: Bearer token required. Also requires: Caller must be the booking's landlordId.

Accepts a booking: sets status to confirmed, stores dates.confirmedDate and, when sent, overwrites dates.visitDuration. Only the user stored as the booking's landlordId may call it; a listing agent who received the request notification but is not the property's landlord gets the 403.

Side effects: a booking:updated event ({ bookingId, propertyId, status, type }) is pushed over SSE and Socket.IO to both the tenant and the landlord, and the tenant is notified. For reservation and shortlet bookings that is a payment_request_accepted notification with the Your Payment Request Was Accepted email, which is the tenant's cue to pay; for viewing it is booking_confirmed.

The current status is not checked, so a cancelled or already confirmed booking can be confirmed again (and the tenant is notified again). The validator requires confirmedDate for every booking type, including stays whose dates are already fixed.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

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

Path Parameters

id*string

ObjectId of the booking to confirm.

Request Body

application/json
  1. body
confirmedDate*string

Agreed date and time. Required by validation for all booking types; for a viewing it is the visit time, for a reservation or stay it is only recorded.

Formatdate-time
visitDuration?number

Viewings: visit length in hours (0.5 to 8). Replaces the value requested by the tenant.

Formatfloat
Range0.5 <= value <= 8

Response Body

Booking confirmed. data is the updated booking (ids not populated).

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X PATCH 'http://localhost:4000/api/v1/booking/string/confirm' \  -H 'Content-Type: application/json' \  -d '{  "confirmedDate": "2026-12-04T10:00:00.000Z",  "visitDuration": 1}'
Example Response
{  "status": 200,  "success": true,  "message": "Booking confirmed successfully",  "data": {    "_id": "665f1c2e9b1d4a0012ab34cd",    "propertyId": "664a0b7e3f2c1d0012ef5a01",    "tenantId": "663d9a1c5e4b2a0012cd7f10",    "landlordId": "6629e4f08a7b3c0012aa9e42",    "status": "confirmed",    "type": "viewing",    "dates": {      "requestedDate": "2026-12-04T10:00:00.000Z",      "confirmedDate": "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-25T11:02:40.007Z",    "__v": 0  }}