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.
  • 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

  • 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

NameTypeSampleExplanation
room_id
post
int3Dashboard field room_id = rooms.rooms_type, not the physical rooms.id. Aliases: rooms_type, type_of_order.
start_date
post
string13/08/2026Start date DD/MM/YYYY (dashboard) or YYYY-MM-DD.
end_date
post
string15/08/2026End date DD/MM/YYYY or YYYY-MM-DD.
days
post
int2Number of days. Nightly rooms add +1 internally like the dashboard.

Optional Parameters

NameTypeSampleWhat it gives
invoice_note
post
stringLate arrivalStored in rooms_for_cust.notes. Alias: notes.
customer_name
post
stringJanedisplay_title. Defaults to contactus.name.
payment
post
int0Must be 0 on this route. 1 or 2 (card) is rejected.

Authentication

Send the bearer token returned by Login in the request header.

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.Book

Sample 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"
}