Skip to main content

Developers guide

Put Travia on your own website

Run a hotel, tour company, car rental or real-estate agency site on WordPress, Wix, Squarespace or your own stack? Embed your live Travia booking widget, theme it to match your brand, read from our public search API, and keep other booking sites in sync through the Channel API — no SDK required.

Every Travia business gets a standalone, embeddable version of its listings and booking flow at a stable URL — one per vertical:

https://travia.ai/embed/stay/<your-business-slug>
https://travia.ai/embed/experience/<your-business-slug>
https://travia.ai/embed/cars/<your-business-slug>
https://travia.ai/embed/real-estate/<your-business-slug>

There is one more, and it is not a booking widget: any public Travia Marg trek can be embedded on its own, for a trip report, an operator's blog post or a race write-up. It renders the route line, distance, moving time and ascent, and the trekker it belongs to. Use the Embeditem in the trek's overflow menu to get the snippet, or build the URL yourself:

https://travia.ai/embed/marg/<trek-id>

It needs no API key and assumes no sign-in, because it is cross-origin by design. Visibility is still enforced: a private or connections-only trek returns nothing here, exactly as it would anywhere else on Travia.

You don't need to build these snippets by hand. In your business dashboard, open the Sell online (tours) or Developer (cars, real estate) section — the Widget Studio generates two ready-to-paste snippets with your slug and saved theme baked in:

Full widget (iframe)

Your entire listing + booking flow inside your page.

Booking button

A themed button that opens your Travia page — for sidebars, headers and blog posts.

A typical iframe snippet looks like this:

<iframe src="https://travia.ai/embed/experience/your-business-slug"
  title="Book now"
  style="width:100%;min-height:640px;border:0;border-radius:12px;"
  loading="lazy"></iframe>

WordPress (block editor)

  1. Copy the iframe snippet from your Widget Studio.
  2. Edit the page where bookings should live and add a Custom HTML block.
  3. Paste the snippet and publish. The widget is responsive — full-width containers work best.

WordPress (classic editor)

Switch the editor to the Text (HTML) tab and paste the snippet where you want the widget.

Wix / Squarespace / Webflow

Add an Embed / Codeelement and paste the iframe snippet. Give the element a height of at least 640 px.

Any other stack

It's a plain iframe — paste it into any HTML template. No script tags, no cookies required on your domain.

The Widget Studio's Theme design tab controls how the embed and button look on your site. Your theme is saved with your business and applies to the live embed immediately:

  • Primary & text colour — match your brand palette (hex pickers).
  • Button shape & size — rounded, square or pill; small to large.
  • Layout — grid or list presentation for your listings.
  • Logo — show or hide your business logo inside the widget.
  • Presets — one-click starting points (Emerald, Midnight, Coral, Ocean, Amber).

Save the theme first, then copy the snippet — the button snippet inlines your saved colours so it renders correctly even before the iframe loads.

Bookings that come through your embed carry source=embed attribution automatically. In your dashboard's Analytics → Channels view you can see exactly how many bookings your own website drives versus Travia search, so you can measure the widget like any other channel.

Read-only search across every vertical is open — no key needed for browsing published inventory. Base URL:

https://api.travia.ai/api/v1
EndpointWhat it returnsUseful params
GET /stay/searchHotels, rooms & stayscity, checkIn, checkOut, minGuests
GET /experience/searchTours, treks & activitiescity, category, minPrice, maxPrice
GET /car/searchRental carscity, vehicleType, transmission
GET /real-estate/searchProperty listingscity, listingType, propertyType, minPrice, maxPrice
GET /events/searchTraveler-organized eventscity, category, when, lat, lng, radius
GET /flight/searchFlight metasearch offersfrom, to, departureDate, adults

All list endpoints share one envelope and support page and limit:

curl "https://api.travia.ai/api/v1/experience/search?city=Pokhara&limit=5"

{
  "success": true,
  "data": [ ... ],
  "message": "…",
  "page": 1,
  "size": 5,
  "total": 42
}

Fair use applies — cache responses on your side and keep polling reasonable. Endpoints that create or modify data (bookings, listings) require an authenticated account or an organization API key.

Hotels on a Pro or Max plan can connect their listings on other booking sites through Travia's channel manager. A property can sync by calendar (iCal) link on its own; the Channel API is for a connectivity partner or booking site that sends full reservations. Each connection has its own key, created by the property in Channel manager → Channel API. The secret is shown once.

Signing every request

X-Travia-Key:        tck_…        (key id)
X-Travia-Timestamp:  1790000000   (unix seconds, ±300 s)
X-Travia-Signature:  v1=<hex HMAC-SHA256(secret, "<timestamp>.<METHOD>.<path+query>.<raw body>")>

A wrong signature, an expired timestamp or an unknown key returns 401; a connection the property paused returns 403. Limit: 1,200 requests per hour per key.

Push reservations

POST https://api.travia.ai/api/v1/channel/api/reservations
Content-Type: application/json      (or application/xml — OpenTravel OTA_HotelResNotifRQ)

{ "reservations": [{
  "id": "BDC-998877", "status": "new",
  "roomCode": "DLX", "ratePlanCode": "BAR",
  "checkIn": "2026-11-01", "checkOut": "2026-11-04", "adults": 2, "children": 1,
  "guest": { "firstName": "Sita", "lastName": "Gurung", "country": "NP" },
  "total": { "amount": 27000, "currency": "NPR" },
  "paymentCollect": "property", "modifiedAt": "2026-10-05T08:00:00Z"
}]}

Up to 200 per request, idempotent by reservation id. status is new, modified or cancelled. Each result reports an outcome — created, updated, cancelled, unchanged, needs_mapping (room code not mapped yet) or rejected — and an overlapping reservation is accepted with overbooked: true. OpenTravel requests are answered with OTA_HotelResNotifRS.

Pull availability and rates

GET https://api.travia.ai/api/v1/channel/api/ari?from=2026-11-01&to=2026-11-30

Up to 400 days per request. For each mapped room: its code, rate, minimum nights and one { date, available } per night. Any Travia booking or block closes the night.

Business organizations can issue scoped API keys for server-to-server integrations. Keys are managed per organization with role-based permissions (create, rotate, revoke) — so a developer on your team can hold key access without owning the business account. For calendar and reservation sync, see the Channel API above. If you're building another kind of integration (PMS sync, partner inventory), talk to us and we'll set your organization up with the right scopes.

Stuck on an embed or an API response? We answer integration questions like any other support request.