Skip to main content
POST
Book a resource: a stay on a night resource or a block
Creates a resource booking on behalf of a customer. The body depends on the resource’s booking_unit (see GET resources):
  • Night resource: check_in and check_out, and optionally the arrival and departure times.
  • Block resource: date, start_time and optionally duration_minutes.
Sending night fields to a block resource, or the other way around, returns 400 RESOURCE_BOOKING_UNIT_MISMATCH. Keebai checks the whole stay again when you book (windows, minimum and maximum nights, notice, party size and room every night), so a quote that went stale returns 409 STAY_FULL instead of overbooking. The customer is found or created in the CRM by phone. The booking is recorded with source api. Prepayment. When the resource asks for a prepayment, the booking lands in awaiting_payment with a payment link for that amount and a hold. It occupies its nights until the hold expires; if the customer has not paid by then, Keebai cancels it. Without a prepayment it lands in booked.

Endpoint

Required scope

scheduling:appointments:create

Headers

  • Authorization: Bearer kbai_pk_<token>. Required.
  • Content-Type: application/json. Required.
  • Idempotency-Key: required. 1 to 128 letters, digits, - or _. A retry with the same key returns the first booking instead of creating another.

Body: stay on a night resource

  • resource_id, check_in, check_out, customer.name and customer.phone: required.
  • branch_id: optional. Defaults to the resource’s branch.
  • check_in_time: arrival time, inside the day’s check-in window. Omitted or null: the stay starts when the window opens.
  • check_out_time: departure time, inside the day’s check-out window. Omitted or null: the stay ends when the window closes.
  • party_size: guests. Defaults to 1.
  • customer.customer_id: the CRM customer id, when you already have it.
  • notes: shown to the business on the booking (max 1000 characters).

Body: block on a block resource

  • date and start_time must be a block that GET resources/availability offers.
  • duration_minutes: one of the resource’s durations_minutes. Defaults to the first one.
origin, agent and any other field are rejected with 400: the public API always books as api.

Example request

Response

201 Created: stay

  • number: correlative of the booking, shared with the business’s appointments.
  • check_in, check_out, nights and the times are computed from start and end in time_zone; nothing else is stored.
  • price: the whole booking. balance is price minus amount_paid.
  • contact: the public API never returns the customer’s phone or email here.
  • status: awaiting_payment (hold with a payment link), booked, confirmed, completed, no_show or cancelled.
  • payment_status: pending, partial, paid, refunded or cancelled.

201 Created: block

The booking has the same fields, except that the night fields are replaced by the block’s:

400 Bad Request

Other 400 codes:

404 Not Found

RESOURCE_NOT_FOUND or BRANCH_NOT_FOUND.

409 Conflict

Other 409 codes:
On STAY_FULL or RESOURCE_CONFLICT, quote again and offer the new options. Do not retry the same dates. On RESOURCE_PROFESSIONAL_BUSY, don’t retry that block: check GET resources/availability again for that day and offer another time or day. On RESOURCE_BUSY, retry the same request with the same Idempotency-Key after a short pause.

422 Unprocessable Entity

ONLINE_PAYMENT_UNAVAILABLE: the resource asks for a prepayment and the business can’t take online payments right now. Nothing is booked.

502 Bad Gateway

PAYMENT_LINK_FAILED: the resource asks for a prepayment and the payment link could not be created. Keebai cancels the booking it had just made, so its nights are free again. Try again later.

503 Service Unavailable

RESOURCE_LOCK_UNAVAILABLE with retryable: true: Keebai couldn’t lock the resource to write the booking. Nothing is booked. Retry the same request with the same Idempotency-Key after a short pause.

401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.

Authorizations

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Headers

idempotency-key
string
required
Idempotency-Key
string
required

Body

application/json
resource_id
string
required
customer
object
required
branch_id
string | null

Defaults to the resource branch.

check_in
string

Night only.

Example:

"2026-12-03"

check_out
string

Night only.

Example:

"2026-12-05"

check_in_time
string | null

Night only. Defaults to the opening of the check-in window.

Example:

"11:00"

check_out_time
string | null

Night only. Defaults to the closing of the check-out window.

date
string

Block only.

Example:

"2026-12-03"

start_time
string

Block only.

Example:

"19:00"

duration_minutes
number

Block only.

Required range: x >= 15
party_size
number
default:1
Required range: x >= 1
notes
string | null

Response

201