Build a booking engine

Your own booking page for a hotel โ€” search, the guest's details, payment โ€” on Quendoo Connect. Quendoo prices every offer as the hotel's own booking engine does, writes the booking into the hotel's book and takes the money into the hotel's own accounts. This page is the whole flow in order; each step links to where it is described in full.

The flow

flowchart TD
    A["<small>BEFORE YOU START</small><br/><code><b>POST /oauth/token</b></code><br/><code><b>GET /properties/{id}/booking_buttons</b></code>"]:::post
    C["<small>1 ยท SEARCH</small><br/><code><b>GET /properties/{id}/booking_offers</b></code><br/>โ†’ offers + search_token"]:::get
    D["<small>2 ยท SUMMARY</small><br/><code><b>POST /properties/{id}/bookings/preview</b></code><br/>โ†’ total, plan, payment_methods"]:::post
    E["<small>3 ยท BOOK</small><br/><code><b>POST /properties/{id}/bookings/from_search</b></code><br/>with payment_method_id"]:::post
    F{"4 ยท PAYMENT<br/>which method?"}:::choice
    G["<b>card / online</b><br/>redirect the guest to <code><b>pay_url</b></code>"]:::out
    H["<b>bank transfer</b><br/>show <code><b>bank_transfer</b></code><br/>IBAN, amount, due date, reference"]:::out
    I["<b>at the property</b><br/>show <code><b>payment_plan</b></code>"]:::out
    J["<small>5 ยท FOLLOW THE PAYMENT</small><br/>webhook <code><b>booking.modified</b></code><br/><code><b>GET /properties/{id}/bookings/{booking_id}</b></code>"]:::get
    K["<small>6 ยท LATER INSTALMENTS</small><br/><code><b>GET โ€ฆ/bookings/{booking_id}/payment_options</b></code><br/><code><b>PUT โ€ฆ/payment_plan/{position}/method</b></code><br/><code><b>POST โ€ฆ/payment_plan/{position}/paid</b></code>"]:::put
    A --> C --> D --> E --> F
    F --> G
    F --> H
    F --> I
    G --> J
    H --> J
    I --> J
    J --> K

    classDef get fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1b3a1e
    classDef post fill:#e3f0fb,stroke:#1565c0,stroke-width:2px,color:#0d2a4a
    classDef put fill:#fff3e0,stroke:#ef6c00,stroke-width:2px,color:#4a2600
    classDef choice fill:#f3e5f5,stroke:#6a1b9a,stroke-width:2px,color:#2e0b3a
    classDef out fill:#ffffff,stroke:#90a4ae,stroke-width:1px,color:#1a2330

Before you start

1. Search

GET โ€ฆ/properties/{id}/booking_offers?booking_button_id=1545
    &checkin=2026-12-18&checkout=2026-12-20&rooms[0][adults]=2

Every offer: room, rate, price, payment_plan and the offer_id that books it, plus one search_token that holds these prices for 30 minutes. Add format=engine for everything a booking page shows โ€” photos, descriptions, amenities, policies, extras, nightly prices. Pass your visitor's guest_ip / guest_user_agent: some rates are sold only in some countries or on mobile. Details: Selling โ†’ Search.

2. Summary and payment methods

POST โ€ฆ/properties/{id}/bookings/preview
{ "search_token": "v1.H4sIโ€ฆ", "items": [ { "offer_id": "5292|10476:2:" } ] }

Show the guest what they will book: lines, total_amount, the payment_plan, and payment_methods โ€” what they can pay with, named as the hotel names them:

"payment_methods": [
  { "id": 1899, "type": "dsk",  "name": "Card (EUR)", "is_online": true,
    "payment_plan": [ { "position": 1, "amount": 64.8,  "due_date": "2026-10-11" },
                      { "position": 2, "amount": 151.2, "due_date": "2026-12-18" } ] },
  { "id": 64,   "type": "bank", "name": "Bank transfer (EUR)", "is_online": false,
    "payment_plan": [ { "position": 1, "amount": 64.8,  "due_date": "2026-10-14" },
                      { "position": 2, "amount": 151.2, "due_date": "2026-12-18" } ] } ]

A method can move a date โ€” a transfer needs days to arrive โ€” so show each method with its own plan. Nothing is written; the token is not spent.

3. Book

POST โ€ฆ/properties/{id}/bookings/from_search
{ "search_token": "v1.H4sIโ€ฆ",
  "partner_reference": "WEB-10293",
  "payment_method_id": 1899,
  "client": { "first_name": "Maria", "last_name": "Ivanova",
              "email": "[email protected]", "phone": "+359888123456" },
  "items": [ { "offer_id": "5292|10476:2:",
               "guests": [ { "first_name": "Maria", "last_name": "Ivanova", "adult": true },
                           { "first_name": "Petar", "last_name": "Ivanov", "adult": true } ] } ] }

Send an Idempotency-Key: a retry then returns the same booking. The answer is the booking (id, reference, total_amount, payment_plan) and where the guest pays.

4. Payment

The guest chose The answer carries You
a card / online method (is_online: true) pay_url โ€” the payment provider's own page, on the hotel's account redirect the guest there
a bank transfer bank_transfer โ€” IBAN, BIC, bank, beneficiary, amount, due date, payment_reference show it; the guest also gets it by e-mail
at the property payment_plan โ€” what is due, when show it

When a card payment goes through, the instalment is marked paid by itself. Without payment_method_id the booking answers payment_url, the hotel's own payment page, where the guest picks the method there.

5. Know where it stands

6. Later instalments

When the next one falls due:

GET โ€ฆ/bookings/{id}/payment_options?position=2     the instalment and its methods
PUT โ€ฆ/bookings/{id}/payment_plan/2/method          { "payment_method_id": 64 }

The answer is the same as in step 4: pay_url or bank_transfer.

Paid some other way โ€” your own payment provider, cash at your office โ€” POST โ€ฆ/bookings/{id}/payment_plan/{position}/paid marks it as the hotel's reception does. Selling โ†’ Payment.

7. Cancel

First tell the guest what it costs:

GET โ€ฆ/bookings/{id}/cancellation_quote
{ "id": "1TKMYFJN", "at": "2026-12-20", "currency": "EUR",
  "total_penalty": 150, "free_cancellation": false,
  "rooms": [ { "position": 1, "penalty": 150, "currency": "EUR",
               "rule": { "text": "0 - 14 days before check-in: 1 number of nights",
                         "c_type": "ct_bc_days", "p_days_from": 0, "p_days": 14,
                         "penalty_type": "2", "penalty_value": 1 } } ] }

For each room, the rule of its cancellation policy that applies today and what it costs; total_penalty adds them up. free_cancellation: true means nothing is kept. total_penalty is null when a room has no rule that applies (after arrival, say) โ€” ask the hotel. Nothing is written.

Then POST โ€ฆ/bookings/{id}/cancel โ€” before the arrival day; the room goes back on sale and the guest and the hotel get the cancellation e-mails. Its answer carries the same cancellation, worked out at that moment. The booking's own payment_plan then reads 0: the penalty is what the hotel keeps of what was paid, or claims.

Checklist