POST
Customer.Rooms.Book
Create a rooms_for_cust booking for the logged-in customer, same availability loop as Clientproject::booking_room_add. Required: room_id (this is rooms_type on the dashboard form), start_date, end_date, days. Dates accept DD/MM/YYYY or YYYY-MM-DD. cust_id always comes from the token. Card payment (payment=1/2) is not supported here; send payment=0 to insert the booking only.
Permissions
- User must be logged in with a valid bearer token.
- The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Runs the Customer.Rooms.Book function and returns JSON.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
Special Instructions
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- Does not store card number/CVC. Dashboard payment=1 also creates an invoice; this route only inserts rooms_for_cust.
- Posted user_id is ignored; org is taken from the token and contactus.user_id (same as the dashboard room form).
- Inserts paid_status=0 for payment=0 (unpaid). The rooms_for_cust.paid_status column is NOT NULL with no default, so omitting it causes a MySQL 500.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
room_idpost | int | 3 | Dashboard field room_id = rooms.rooms_type, not the physical rooms.id. Aliases: rooms_type, type_of_order. |
start_datepost | string | 13/08/2026 | Start date DD/MM/YYYY (dashboard) or YYYY-MM-DD. |
end_datepost | string | 15/08/2026 | End date DD/MM/YYYY or YYYY-MM-DD. |
dayspost | int | 2 | Number of days. Nightly rooms add +1 internally like the dashboard. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
invoice_notepost | string | Late arrival | Stored in rooms_for_cust.notes. Alias: notes. |
customer_namepost | string | Jane | display_title. Defaults to contactus.name. |
paymentpost | int | 0 | Must be 0 on this route. 1 or 2 (card) is rejected. |
Authentication
Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Customer.Rooms.Book",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"room_id": "3",
"start_date": "13\/08\/2026",
"end_date": "15\/08\/2026",
"days": "2",
"payment": "0"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Customer.Rooms.Book",
"url_domain": "https:\/\/{domain}\/app\/Customer.Rooms.Book"
}Endpoint
POST /app/Customer.Rooms.Book
POST https://{user}.bull36.com/app/Customer.Rooms.Book
POST https://{domain}/app/Customer.Rooms.BookSample Output
{
"success": 1,
"insert_id": 77,
"room_id": 4,
"total_price": 400,
"message": "Success"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('room_id', '3');
body.set('start_date', '13/08/2026');
body.set('end_date', '15/08/2026');
body.set('days', '2');
body.set('payment', '0');
const res = await fetch('/app/Customer.Rooms.Book', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data);Error Example
{
"success": 0,
"message": "This days already booked"
}