Booking Hotels
  1. Bookings
Booking Hotels
  • About API
  • Auth
    • Register
      POST
    • Login by Password
      POST
    • Login by Access Token
      GET
    • Renew Access Token
      GET
    • Update Password
      PATCH
    • Update Profile
      PATCH
    • Request Forgot Password
      POST
    • Verify Forgot Password
      POST
    • Confirm Forgot Password
      PATCH
    • Logout
      DELETE
  • Hotels
    • Get Hotel List
      GET
    • Get Hotel by Id
      GET
    • Create Hotel
      POST
    • Update Hotel by Id
      PATCH
    • Delete Hotel by Id
      DELETE
  • Rooms
    • Get Room List
      GET
    • Get Room by Id
      GET
    • Create Room
      POST
    • Update Room by Id
      PATCH
    • Delete Room by Id
      DELETE
  • Bookings
    • Actions
      • Pay Booking by Id
      • Cancel Booking by Id
      • Check In Booking by Id
    • Get Booking List
      GET
    • Get Booking by Id
      GET
    • Create Booking
      POST
  • Check Service Status
    GET
  1. Bookings

Create Booking

POST
/api/v1/bookings
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/bookings' \
--header 'Content-Type: application/json' \
--data-raw '{
    "room_id": 1,
    "check_in_date": "2025-04-10",
    "check_out_date": "2024-10-16"
}'
Response Response Example
201 - Example 1
{
    "status_code": 201,
    "message": "Create Booking success"
}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
room_id
number 
required
check_in_date
string 
required
check_out_date
string 
required
Examples

Responses

🟢201Created
application/json
Body
status_code
number 
required
message
string 
required
🟠400Room fully booked
Previous
Get Booking by Id
Next
Check Service Status
Built with