93277 28524 · 93762 46969
VIR HolidaysEverything at one stop

For companies

Corporate Booking API

Raise train, flight, hotel and visa bookings for your staff straight from your HR, travel or ERP software, then track status, invoice and balance. Our team checks every request and confirms fare and availability with your travel desk before booking.

1. Your key

VIR Holidays gives your company a key that starts with vir_. Keep it on your server only, never in a website or app. Send it with every call:

Authorization: Bearer vir_your_key_here

Lost or leaked key? Tell us: we stop it and give a new one. Wrong keys are blocked after 20 tries in 15 minutes.

2. Raise a booking

curl -X POST https://virholidays.co.in/api/v1/bookings \
  -H "Authorization: Bearer vir_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "Train",
    "route": "Ahmedabad to New Delhi",
    "travelDate": "2027-01-15",
    "class": "3A",
    "travellers": [{ "name": "Ravi Shah", "age": 34, "gender": "M" }],
    "reference": "PO-2027-118",
    "requestId": "hr-tool-5521",
    "notes": "Prefer Rajdhani; lower berth"
  }'
FieldNeededWhat to send
typerequiredTrain, Flight, Bus, Hotel, Holiday package, Visa, Passport, Other
routerequired"Ahmedabad to Delhi", "Dubai", "Hotel in Pune" (max 120 characters)
travelDateTrain, Flight, BusYYYY-MM-DD, today or later
returnDateoptionalYYYY-MM-DD
departTimeoptionalHH:MM, 24-hour (preferred flight time)
classoptionale.g. 3A, 2A, SL, Economy
travellersTrain, Flight, Buslist of { name, age, gender: M | F | O }, up to 9
rooms, adults, childAgesHotel, Holiday packagerooms 1–10, adults 1–20, childAges e.g. [5, 9]
referenceoptionalyour PO, cost centre or employee ID (max 60); returned in every response
requestIdrecommendedyour unique ID for this request; sending it again returns the same booking instead of a duplicate
contactoptional{ name, mobile, email } of the traveller or booker
notesoptionalanything else: preferred trains, seat, meal, budget (max 1500)

Answer 201 Created with the booking (below). Same requestId again answers 200 with the first booking, so retries are safe.

{
  "id": 1042,
  "ref": "VIR-1042",
  "type": "Train",
  "title": "Train: Ahmedabad to New Delhi",
  "status": "Requested",
  "travelDate": "2027-01-15",
  "departTime": null,
  "reference": "PO-2027-118",
  "requestId": "hr-tool-5521",
  "invoice": null,
  "amount": { "total": 0, "paid": 0, "balance": 0, "currency": "INR" },
  "tickets": 0,
  "visa": null,
  "createdAt": "2026-12-04T10:15:00.000Z",
  "updatedAt": "2026-12-04T10:15:00.000Z",
  "accountUrl": "https://virholidays.co.in/account"
}

3. Check status

# one booking (1042 or VIR-1042)
curl https://virholidays.co.in/api/v1/bookings/VIR-1042 -H "Authorization: Bearer vir_your_key_here"

# your bookings, newest first (status and limit 1–100 are optional)
curl "https://virholidays.co.in/api/v1/bookings?status=Confirmed&limit=20" -H "Authorization: Bearer vir_your_key_here"

4. Errors and limits

400Something in the body is missing or wrong; error says what.
401Missing, wrong or stopped key.
404No such booking for your company.
413Body over 20 KB.
429Too many calls: 120 a minute per IP, 60 new bookings an hour per key. Wait and retry.

Every error is JSON: { "error": "travelDate must be YYYY-MM-DD." }. Calls must come from your server; browsers on other websites are blocked.

Good to know