Endpoint reference
Base URL https://searchurtrip.com/api/v1. All responses are wrapped as { "data": … } (lists also carry hasMore and nextCursor). The machine-readable contract is the OpenAPI document; the interactive reference lets you explore every schema.
Every authenticated call needs Authorization: Bearer <key> and the scope shown.
| Method & path | Scope | Purpose |
|---|---|---|
GET /health |
none | Liveness probe |
GET /me |
any key | Describe the calling key |
GET /pricing/quote |
pricing:read |
Price a supplier amount |
POST /search/flights |
search:read |
Flights, one-way or round trip |
POST /search/hotels |
search:read |
Hotels |
POST /search/cars |
search:read |
Car rentals |
POST /bookings |
bookings:write |
Book an offer |
GET /bookings |
bookings:read |
List your bookings |
GET /bookings/{id} |
bookings:read |
One booking |
POST /bookings/{id}/cancel |
bookings:write |
Cancel an upcoming booking |
GET /invoices |
invoices:read |
List your tenant's invoices |
GET /invoices/{id} |
invoices:read |
One invoice with payments |
POST /webhooks |
webhooks:manage |
Register an endpoint |
GET /webhooks |
webhooks:manage |
List endpoints |
DELETE /webhooks/{id} |
webhooks:manage |
Remove an endpoint |
GET /health
No authentication. Returns {"status":"ok","version":"v1","time":"…"}.
GET /me
Returns the client, whether it is linked to a tenant, the key environment and its scopes.
GET /pricing/quote
| Query | Type | Notes |
|---|---|---|
service |
flight | hotel | car | insurance |
required |
amount |
number > 0 | supplier base amount, INR |
curl "https://searchurtrip.com/api/v1/pricing/quote?service=flight&amount=5000" -H "Authorization: Bearer $KEY"
{ "data": { "service": "flight", "baseAmount": 5400, "tax": 270, "fee": 378, "total": 6048, "currency": "INR" } }
Uses your tenant's margin (falling back to the platform default), then tax and fee on the marked-up amount. The margin is folded into baseAmount.
POST /search/flights
| Field | Type | Notes |
|---|---|---|
from, to |
string | IATA code or city, e.g. DEL |
departDate |
YYYY-MM-DD |
required |
returnDate |
YYYY-MM-DD |
optional; makes it a round trip; must not be before departDate |
adults |
1–9 | default 1 |
cabin |
economy | premium | business |
default economy |
{
"data": {
"simulated": true,
"onward": [
{
"airline": "IndiGo", "flightNumber": "6E-291", "from": "DEL", "to": "BOM", "date": "2026-11-12",
"departTime": "07:30", "arriveTime": "10:05", "duration": "2h 35m", "stops": 0,
"fareType": "Value", "refundable": false, "cabin": "economy",
"baggage": { "cabinKg": 7, "checkInKg": 20 },
"pricePerAdult": 9880, "adults": 1, "subtotal": 9880, "currency": "INR",
"offerToken": "eyJraW5kIjoiZmxpZ2h0Iiwi…",
"price": { "baseAmount": 10670, "tax": 534, "fee": 747, "total": 11951, "currency": "INR" }
}
],
"return": [ "…same shape, from/to swapped, dated returnDate…" ]
}
}
return is present only when returnDate was sent. subtotal is the supplier price; price is what you are charged.
POST /search/hotels
| Field | Type | Notes |
|---|---|---|
city |
string | required |
checkIn, checkOut |
YYYY-MM-DD |
checkOut must be after checkIn |
rooms |
1–5 | default 1 |
guests |
1–12 | default 2 |
{
"data": {
"simulated": true, "nights": 3,
"results": [
{
"id": "htl_6etv2y", "name": "The Mumbai Residency", "stars": 4, "area": "Business District", "city": "Mumbai",
"rating": 4.5, "amenities": ["Gym", "Free WiFi", "Restaurant"], "freeCancellation": true,
"checkIn": "2026-11-12", "checkOut": "2026-11-15", "nights": 3, "rooms": 1, "guests": 2,
"pricePerNight": 8710, "subtotal": 26130, "currency": "INR",
"offerToken": "eyJraW5kIjoiaG90ZWwiLCJ0…",
"price": { "baseAmount": 26130, "tax": 0, "fee": 0, "total": 26130, "currency": "INR" }
}
]
}
}
POST /search/cars
| Field | Type | Notes |
|---|---|---|
pickup |
string | location |
from, until |
YYYY-MM-DD |
until not before from |
driverAge |
18–99 | default 30 |
{
"data": {
"simulated": true, "days": 2,
"results": [
{
"name": "Toyota Corolla", "type": "Compact", "transmission": "Automatic", "seats": 5,
"pickup": "Mumbai Airport", "from": "2026-11-12", "until": "2026-11-14", "days": 2,
"pricePerDay": 3100, "subtotal": 6200, "unlimitedKm": true, "currency": "INR",
"offerToken": "eyJraW5kIjoiY2FyIiwidGl0…",
"price": { "baseAmount": 6200, "tax": 0, "fee": 0, "total": 6200, "currency": "INR" }
}
]
}
}
POST /bookings
Requires the Idempotency-Key header and a tenant-linked client.
| Field | Type | Notes |
|---|---|---|
offerToken |
string | from a search result; valid 15 minutes; tamper-proof |
contact.name, contact.email |
string | required; contact.phone optional |
travellers |
[{firstName,lastName}] |
optional, up to 9 |
reference |
string ≤ 80 | your own reference, echoed back on every read |
curl -X POST https://searchurtrip.com/api/v1/bookings \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: 3f0d6a7e-9c5b-4f0a-a1b9-2c1f7c9d5e10" \
-d '{"offerToken":"eyJra…","contact":{"name":"Asha Menon","email":"asha@example.com"},"reference":"PO-1001"}'
201 Created:
{
"data": {
"id": "bkg_6", "pnr": "G3J78B", "type": "flight", "route": "DEL → BOM", "date": "2026-11-12",
"status": "Upcoming", "amount": 11951, "currency": "INR", "reference": "PO-1001",
"livemode": true, "createdAt": "2026-09-26 02:26:52"
}
}
amount is the total charged to your tenant (base + tax + fee), recomputed on the server from the offer. Errors: 400 (validation / bad token), 403 (scope / not linked), 410 offer_expired, 422 idempotency_key_reuse.
GET /bookings
?limit=25&cursor=… — bookings created by your client, newest first. Returns { data: [Booking], hasMore, nextCursor }.
GET /bookings/{id}
id looks like bkg_6. 404 if it does not exist or belongs to another client.
POST /bookings/{id}/cancel
Only Upcoming bookings can be cancelled; otherwise 409 conflict. Returns the updated booking (status: "Cancelled") and fires booking.cancelled.
GET /invoices · GET /invoices/{id}
Your tenant's invoices (drafts are not shown). Requires a tenant-linked client.
{
"data": [
{
"id": "inv_17", "number": "INV-1-1789951977557", "amount": 42340, "paidAmount": 42340,
"status": "paid", "dueDate": "15 Nov 2026", "createdAt": "2026-09-21 00:52:57",
"payments": [ { "amount": 20000, "method": "Bank transfer", "reference": null, "receivedAt": "2026-09-21 00:53:12" } ]
}
],
"hasMore": false, "nextCursor": null
}
status is one of sent, paid, cancelled.
Webhook endpoints
See the Webhooks guide for POST/GET/DELETE /webhooks, event payloads, signatures and retries.