Getting started
Get your token and base URL. Both are issued by the Rental Planner team. One token belongs to one account — every unit and booking you can reach through the API belongs to that account.
Check what is already taken. Use your external id for the unit.
curl "$BASE/getFutureUnavailableDates?unitId=UNIT_ID" \ -H "Authorization: Bearer $TOKEN"Create a booking. The minimum is a unit, your booking id, the dates, a guest name and a price.
curl -X POST "$BASE/bookings" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{"unitId":"UNIT_ID","externalBookingId":"RES-90210", "start":"2026-12-01","end":"2026-12-05", "clientName":"John Ternus","fullPrice":400}'
Authorization
Every request carries a bearer token. Tokens are scoped, and the scope is hierarchical: a write token can also read, so one token is enough for both endpoints.
| Scope | Grants |
|---|---|
| read | Reading availability |
| write | Everything a read token can do, plus creating bookings |
A token without the scope an endpoint needs gets 403 with "Forbidden: write scope required".
Rate limits
60 requests per minute per token. Above that you get 429; sustained abuse (300 requests per minute) temporarily blocks the token and answers 403 Forbidden. Back off and retry rather than hammering.
How dates work
All dates are calendar days in YYYY-MM-DD, in the property's own calendar. No timezone, no time-of-day.
end is the check-out date. It is not occupied — the next guest can arrive that same day. A booking from the 1st to the 5th of December covers four nights and leaves the 5th open.
start: 2026-12-01 … end: 2026-12-05
Check-out day — free for the next arrival
The same rule applies to the ranges returned by the availability endpoint: a range's end is a check-out day, so you may book a stay that starts on it.
Read availability
read
Returns the dates a unit is already taken, from today onwards. Past stays are never returned.
Query parameters
| Name | Required | Notes |
|---|---|---|
| unitId | yes | Your external id for the unit, up to 64 characters |
Response · 200
{
"success": true,
"unitId": "UNIT_ID",
"unavailable": [
{ "start": "2026-12-01", "end": "2026-12-05" },
{ "start": "2026-12-20", "end": "2027-01-08" }
]
}
Ranges are merged: two stays that touch or overlap come back as one range. Sorted by start date.
Answers are cached for up to 60 seconds. Bookings you create through this API drop that cache immediately, so your own writes are visible on the next call.
Errors
| Code | Body | Meaning |
|---|---|---|
| 404 | {"success": false, "error": "Unit not found"} | No unit with that id on your account |
| 401 | {"success": false, "error": "Unauthorized"} | Missing or unknown token |
Create a booking
write
Writes a booking into the owner's calendar. It appears in the Rental Planner app exactly like one entered by hand: guest, dates, payment schedule, deposit. Body up to 100 KB, Content-Type: application/json.
Unknown top-level fields are ignored, so you can send extra keys without breaking the call.
Request body
| Field | Required | Type / limits | Notes |
|---|---|---|---|
| unitId | yes | string, ≤ 64 | Your external id for the unit |
| externalBookingId | yes | string, 1–128 | Your booking id. Idempotency key — see below |
| start | yes | YYYY-MM-DD | Check-in day |
| end | yes | YYYY-MM-DD | Check-out day, after start, stay ≤ 730 days |
| clientName | yes | string, 1–200 | Guest name |
| fullPrice | price* | number ≥ 0 | Total for the whole stay |
| unitPrice | price* | number ≥ 0 | Per night or per month; send together with unitType |
| unitType | price* | night | month | Send together with unitPrice |
| locale | no | 2-letter code | Language of generated payment titles. Defaults to en |
| adultsCount | no | integer 1–50 | Defaults to 1 |
| childrenCount | no | integer 0–50 | |
| phone | no | string, ≤ 50 | Also used to match an existing guest |
| additionalContacts | no | string, ≤ 1000 | Email, messenger, anything else |
| notes | no | string, ≤ 5000 | Free-form note for the owner |
| sellChannel | no | string, ≤ 100 | Name of an existing sales channel |
| checkInTime | no | "HH:mm" | Shown on the owner's calendar |
| checkOutTime | no | "HH:mm" | |
| prePayment | no | object | {"price": 100} or {"percentage": 20}, plus optional "paid" |
| pledge | no | number or object | Refundable deposit |
| isStrict | no | boolean | Refuse on overlap. Defaults to true |
* price — see the rules below; it may be omitted entirely if the unit has a default price.
Full example
{
"unitId": "UNIT_ID",
"externalBookingId": "RES-90210",
"start": "2026-12-01",
"end": "2026-12-05",
"clientName": "John Ternus",
"phone": "+1 555 0142",
"fullPrice": 400,
"locale": "en",
"adultsCount": 2,
"prePayment": { "percentage": 20, "paid": true },
"pledge": 100,
"checkInTime": "14:00",
"checkOutTime": "11:00",
"sellChannel": "Booking.com",
"notes": "Late arrival, approx. 23:00"
}
Response · 201
{
"success": true,
"externalBookingId": "RES-90210",
"unitId": "UNIT_ID",
"start": "2026-12-01",
"end": "2026-12-05",
"fullPrice": 400,
"warnings": []
}
fullPrice is the total the system computed. warnings is always an array and usually empty — see Guest & channel.
Price rules
Send the price in one of three ways. They are checked in this order:
unitPrice+unitType— the total is calculated from the stay. AddfullPriceas well to override that total, for example for a negotiated discount.fullPricealone — treated as a nightly stay; the per-night rate is derived from it.- Nothing — the unit's own default price is used, if the owner set one.
If none of the three applies, the answer is 400 with "field": "price".
Prepayment & deposit
prePayment takes either a fixed price or a percentage of the stay — never both. paid marks it as already received and defaults to false. Omit prePayment and the unit's own default prepayment applies, if the owner set one. A prepayment larger than the stay total is rejected.
pledge records a refundable deposit: a number, or {"price": 100}.
Both appear in the app as payment entries, with titles written in the body's locale. Supported: en, ru, th, ar, de, es, fr, he, pt, tr. An unknown locale quietly falls back to en — never an error.
Guest & channel
The booking is linked to an existing guest of the account: by phone digits when you send a phone, otherwise by name. Nothing is created if no guest matches — the booking simply carries the name and phone you sent.
sellChannel is matched by name against the owner's existing channels, ignoring case, spacing and punctuation, so "booking com" matches "Booking.com". If nothing matches, the booking is still created and the response carries a warning:
{
"code": "sell_channel_not_found",
"field": "sellChannel",
"message": "No sell channel named \"NoSuchChannel\" exists for this account; the booking was saved without a sell channel."
}
Conflicts
By default (isStrict: true) a booking that overlaps an existing one is refused with 409. Arrival on another guest's check-out day is not an overlap and is always allowed.
Send isStrict: false to record the booking anyway — use it when your own system is the source of truth and handles double bookings itself.
Blocked dates without a guest
Send type: "unavailable" to close dates for maintenance, an owner stay or a hold. The body shrinks to five fields:
{
"type": "unavailable",
"unitId": "UNIT_ID",
"externalBookingId": "BLOCK-7",
"start": "2026-12-20",
"end": "2026-12-24",
// optional: notes, isStrict
}
Booking-only fields — guest name, any price or payment field, guest counts, times, sellChannel — are rejected with 400 naming the field, rather than silently dropped.
Idempotency
externalBookingId is the idempotency key, scoped to your account. Repeating a request with an id that already exists never creates a second booking and never changes the first one — it answers 200:
{ "success": true, "externalBookingId": "RES-90210", "idempotent": true }
So retrying after a timeout is always safe. There is no way to edit a booking in this version — cancel it and create a new one with a new id.
Cancel a booking
write
Removes a booking you created through this API from the owner's calendar, freeing the dates. Address it by your own id — the same one you sent when creating it.
curl -X DELETE "$BASE/bookings/RES-90210" \
-H "Authorization: Bearer $TOKEN"
Response · 200
Two shapes, both with HTTP 200:
| Body | Meaning |
|---|---|
| {"success": true, "deleted": true} | The booking existed and is now gone; its dates are free |
| {"success": true, "deleted": false, "alreadyDeleted": true} | Nothing to delete — no such booking on your account, or it was already cancelled |
There is no 404 here on purpose: we cannot tell "never existed" apart from "already cancelled", and for a retry after a timeout the distinction does not matter. Send the request again and treat either answer as success.
What it will not delete
Only bookings created through this API, and only on your own account. Anything the owner entered by hand or that arrived from a calendar sync stays untouched and answers alreadyDeleted. Cancelling is final — there is no undo, so create the booking again if the guest returns.
The availability cache is dropped immediately, so the freed dates show up on your next read.
Errors
Every failure returns JSON with "success": false and an error string. Validation failures add field, naming the offending field — for example "prePayment.percentage".
| Code | When | What to do |
|---|---|---|
| 400 | Validation failed, or malformed JSON | Read field, fix the value. Do not retry unchanged |
| 401 | Missing or unknown token | Check the Authorization header |
| 403 | Read-only token on a write call, or the token is temporarily blocked for rate-limit abuse | "Forbidden: write scope required" means ask for a write token; plain "Forbidden" means back off |
| 404 | Unit not on your account | Check unitId |
| 405 | Wrong HTTP method for the path | Fix the method |
| 409 | Dates overlap an existing booking while isStrict is on | Read availability, pick other dates, or send isStrict: false |
| 429 | Rate limit exceeded | Back off, then retry |
| 500 | Something broke on our side | Retry with backoff; the write is idempotent, so a retry is safe |
Because externalBookingId is an idempotency key, retrying a booking request after a timeout or a 500 cannot create a duplicate. Retry with backoff rather than giving up.
Integration checklist
- Store our
unitIdnext to each of your listings — every call needs it. - Use your own booking reference as
externalBookingId; keep it stable across retries. - Treat
endas the check-out day on both sides, so a same-day turnover is not read as a conflict. - Read availability before offering dates, and handle
409as a normal outcome rather than an error. - Send
localeso the owner sees payment titles in their language. - Cancel on our side too when a guest cancels on yours, or the dates stay blocked for the owner.
- Log the
warningsarray — an unmatched sales channel is reported there, not as a failure. - Respect the rate limit: back off on
429instead of retrying immediately.