VishalTravels API Reference
Introduction

VishalTravels Version 2 API

A REST API for searching, pricing and booking series/fixed-departure flights, retrieving booking details and checking agent account balance. All endpoints return JSON and are namespaced under /api/v2.

  • Base URL — {{baseUrl}}. Set your own base URL in the sidebar if your environment differs (staging/production).
  • Format — application/json. Requests and responses are JSON. Successful responses include "success": true.
  • Response Envelope — { success, data }. All responses share a common envelope with a success flag and a data or message payload.

What's New in V2

Sectors Changes

  • Single date field → dates array of upcoming travel dates per sector

Request Changes

  • origin + destination + departure_date → single segments param
  • adults + child + infant → single pax param
  • One request shape now covers One-Way, Round-Trip, Multi-City & Connecting flights

Response Changes

  • New query object — echoes route, date & pax searched
  • data[] → data.results[]
  • New trip_type — ONEWAY / ROUNDTRIP / MULTICITY
  • New currency and is_refundable fields
  • New segments → legs structure for itineraries, incl. connecting flights
  • Separate date/time fields → consolidated departureAt / arrivalAt on each leg
  • Baggage array → structured baggage_info object
  • Pricing simplified to totalPrice + adultPrice

Booking Changes

  • Create Booking now requires a query object — echoes origin, destination, travel_date, adults, children & infants from the search

Major benefit: a single segment-based itinerary model now handles direct, connecting, round-trip and multi-city bookings through one API structure.

Authentication

Every request must include your agent api-key as a request header. There is no OAuth flow or bearer token — the key is issued to your agency and identifies your account for pricing, balance and bookings.

HeaderRequiredDescription
api-keyrequiredYour agent API key, issued per agency/environment.
Content-Typerecommendedapplication/json;charset=UTF-8
Acceptrecommendedapplication/json, text/plain, */*
  • Keep your key secret. Treat the api-key like a password — anyone with it can search fares and create bookings against your agent balance. This documentation stores the key only in your browser's local storage so you can test requests; it is never sent anywhere except the base URL you configure.

Environment Setup

Configure these once in the sidebar and every "Try it" panel below will use them automatically.

  • Set Base URL to the environment you want to hit (defaults to {{baseUrl}}).
  • Paste your API Key.
  • Open any endpoint below, adjust parameters if needed, and click Send Request.
  • CORS note: browsers block cross-origin requests unless the server explicitly allows them. If "Send Request" fails with a network error, your API server likely needs to allow CORS from this page's origin, or you should serve/open this documentation from the same host as the API.

Test Cases

Before your api-key is certified for production use, we require an end-to-end test pass covering the full booking lifecycle. Please exercise Search → Create Booking → Booking Details and keep the request/response logs from each step handy — we may ask for them during certification review.

  • Call Search for the sector and date you want to certify, covering onward (connecting), round-trip, and multi-city itineraries — save the full request and response for each.
  • Call Create Booking using a fare from that search result, and save the full request and response.
  • Call Booking Details using the resulting reference, and save the full request and response.

Once the API integration is done, please send us test booking references created using the API with the following combinations:

  • Domestic sector — 2 adults, 1 child, and 1 infant.
  • International sector — 2 adults, 1 child, and 1 infant.