Trips, options and units
Three layers describe what can be booked.
| Layer | What it is | Example |
|---|---|---|
Trip (product) |
What the traveller reads about: text, photos, itinerary, inclusions, places | Desert safari with BBQ dinner |
| Option | One way to take it, with its own calendar, prices and rules | Shared 4WD, afternoon |
| Unit | Who or what is priced on an option | Adult, Child (3-11) |
A trip has a template: day_tour, multi_day, transfer, ticket or
activity. A day trip has duration_minutes; a multi-day trip has
duration_days and duration_nights. Each trip has an id and a slug,
and the API opens it by either.
Options
Section titled “Options”Most trips have one option; some have several, such as a shared and a
private one, or a morning and an afternoon start. One is is_default.
What matters when you build a booking page:
| Field | What it tells you |
|---|---|
private |
true for a private tour, for the group alone. Say “private” only when it is. |
availability_type |
start_time: set start times. opening_hours: any time the day is open. fixed_departure: set departures, often for multi-day trips. |
capacity_mode |
limited: places are counted. free_sale: not counted. on_request: the seller confirms each booking by hand, and checkout takes no hold. |
confirmation |
instant, manual, or instant_then_manual (instant within the seller’s rules, else manual). |
min_units, max_units |
How few or how many can book together, when set. |
policy |
The cancellation policy if booked now. |
traveller_details |
Which travellers’ details the seller needs, of whom and when. |
pickup |
Whether and how travellers are picked up. |
sales_paused |
Shown, but not bookable for now. |
A unit is a kind of traveller or item: adult, child, infant,
senior, youth, student, group, vehicle, room or other. Each
has its label (shown as the seller wrote it), the ages it takes, how many
can book, whether it takes_seat (a baby on a lap doesn’t) and whether it
is free.
A quote names units by unit_id with a quantity, and the ages of children
when the seller prices by age.
Extras
Section titled “Extras”A trip can offer extras, such as a quad bike ride on a desert safari. Each
says which options offer it (option_ids, empty for all), what one price
covers (per: a person, an item, the booking or a vehicle), and whether it
is paid upfront or on the day. Add one to a quote with extras.
The whole trip
Section titled “The whole trip”curl "https://api.stg.vacationpackagesoman.com/v1/public/products/desert-safari-with-bbq-dinner?locale=en" \ -H "Tp-Publishable-Key: $TP_KEY"const res = await fetch("https://api.stg.vacationpackagesoman.com/v1/public/products/desert-safari-with-bbq-dinner?locale=en", { headers: { "Tp-Publishable-Key": process.env.TP_KEY!, },})const answer = await res.json()Answer: 200 OK (shortened)
{ "id": "5b1f0c3e-8d2a-4f6b-9c41-2e7a9d0b6f13", "slug": "desert-safari-with-bbq-dinner", "content_locale": "en", "locales": [ "en", "ar" ], "title": "Desert safari with BBQ dinner", "timezone": "Asia/Dubai", "sales_paused": false, "options": [ { "id": "9e4c2a71-3b5d-4e8f-a1c6-7d20f5b93e48", "name": "Shared 4WD, afternoon", "is_default": true, "private": false, "vehicle": "Shared 4WD", "sales_paused": false, "min_units": null, "max_units": null, "availability_type": "start_time", "capacity_mode": "limited", "confirmation": "instant", "units": [ { "id": "1c7e9b42-6a3f-4d85-b0e2-58f4a1c9d736", "type": "adult", "label": "Adult", "min_age": 12, "max_age": null, "min_qty": null, "max_qty": null, "takes_seat": true, "free": false }, { "id": "2d8fac53-7b40-4e96-81f3-69a5b2dae847", "type": "child", "label": "Child (3-11)", "min_age": 3, "max_age": 11, "min_qty": null, "max_qty": null, "takes_seat": true, "free": false } ], "policy": { "name": "Flexible", "tiers": [ { "from_days": 1, "to_days": null, "refund_pct": 100 }, { "from_days": 0, "to_days": 0, "refund_pct": 0 } ] }, "traveller_details": { "scope": "lead", "fields": [], "collect": "checkout", "due_hours_before": null }, "pickup": null, "pickup_rules": [] } ], "city": { "slug": "dubai", "name": "Dubai" }, "region": { "slug": "dubai-emirate", "name": "Dubai" }, "country": { "slug": "ae", "name": "United Arab Emirates" }, "seller": { "slug": "demo", "name": "tourpingo demo", "base": "Nowhere: a demo for developers", "blurb": "Invented trips in the UAE, Oman and Zanzibar for trying tourpingo's API. Never on the marketplace; bookings are deleted after a day." }, "extras": [ { "id": "3e90bd64-8c51-4fa7-92a4-7ab6c3ebf958", "name": "Quad bike, 30 minutes", "description": null, "per": "item", "who": "choose", "included": false, "option_ids": [], "min_age": 16, "max_age": null, "unit_types": [], "max_per_booking": null, "pay": "upfront", "price": { "amount": 4000, "currency": "USD" }, "unit_prices": {}, "local_price": null } ], "from_price": { "amount": 6500, "currency": "USD", "group_size": 1 }}