This endpoint is used to create booking.
Method | URI | Headers |
---|---|---|
POST | /api/p/booking | Authorization: Bearer <token> Accept: application/json |
None
Param | Description | Type | Required | Notes |
---|---|---|---|---|
number_of_guests | Number of guests. | - | Yes | This form data parameter must have value |
checkin | Check in time. | - | Yes | This form data parameter must have value |
checkout | Checkout time. | - | Yes | This form data parameter must have value and greater than checkin |
customer_name | Your name. | String | Yes | This form data parameter must have value |
customer_phone | Your phone. | String | Yes | This form data parameter must have value |
customer_email | Your email. | String | Yes | This form data parameter must have value |
customer_country | Your country. | String | Yes | This form data parameter must have value |
partner_reservation_id | Your reservation id. | - | Yes | This form data parameter must have value (default value is 0) |
None
Example request
curl \
--request POST \
--url https://api-sandbox.luxstay.com/api/booking/price \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'
--form number_of_guests=4 \
--form checkin=16-06-2019 \
--form checkout=18-06-2019 \
--form checkin_time=23:59
--form customer_name=Nguyen Van A
--form customer_phone=+84384852167
--form customer_email=foo@abc.com
--form payment_method=1
--form customer_country=vn
--form partner_reservation_id=1234567
Example response
{
"data": {
"id": 10751,
"code": "OVNORX",
"auth_code": "YJAFQA79PM",
"status": "Pending",
"checkin": "2019-06-15T00:00:00+00:00",
"checkout": "2019-06-16T00:00:00+00:00",
"total": 3007.65,
"room_id": 10002,
"nights": 1,
"per_night": 1195.09,
"currency": "USD",
"guests": 4,
"payment_method": 1,
"created_at": "2019-06-06T02:52:26+00:00"
},
"code": 200,
"request_id": "3f25f64f-f35e-4865-92b7-7133d9543537"
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason invalid form data
Example response
{
"message": "Wrong {data-form-name}."
}