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"
}'| Field | Needed | What to send |
|---|---|---|
| type | required | Train, Flight, Bus, Hotel, Holiday package, Visa, Passport, Other |
| route | required | "Ahmedabad to Delhi", "Dubai", "Hotel in Pune" (max 120 characters) |
| travelDate | Train, Flight, Bus | YYYY-MM-DD, today or later |
| returnDate | optional | YYYY-MM-DD |
| departTime | optional | HH:MM, 24-hour (preferred flight time) |
| class | optional | e.g. 3A, 2A, SL, Economy |
| travellers | Train, Flight, Bus | list of { name, age, gender: M | F | O }, up to 9 |
| rooms, adults, childAges | Hotel, Holiday package | rooms 1–10, adults 1–20, childAges e.g. [5, 9] |
| reference | optional | your PO, cost centre or employee ID (max 60); returned in every response |
| requestId | recommended | your unique ID for this request; sending it again returns the same booking instead of a duplicate |
| contact | optional | { name, mobile, email } of the traveller or booker |
| notes | optional | anything 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"
- Requested – we have it and are checking fare and availability.
- Confirmed – booked.
ticketscounts the ticket files; your team downloads them in the VIR account (accountUrl). - Completed – trip done.
invoiceandamountshow the bill, paid and balance in rupees. - Cancelled – cancelled; refunds show in
amount. - Visa bookings also list each applicant's stage in
visa.
4. Errors and limits
| 400 | Something in the body is missing or wrong; error says what. |
| 401 | Missing, wrong or stopped key. |
| 404 | No such booking for your company. |
| 413 | Body over 20 KB. |
| 429 | Too 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
- A request is not a booked ticket. We confirm the fare with your travel desk first, then book.
- Invoices carry your company GSTIN when it is on your VIR profile.
- Prefer email or WhatsApp? Your staff can still send requests the usual way; they appear in the same list.