API reference
Bus booking
10 endpoints
Search a route, open the seat map and the boarding points, hold seats with block, then confirm with book. Only book moves money. A hold lasts about 8 minutes and can be booked once. Bookings are confirmed or refused by the bus operator; a pending booking is settled by us and announced by callback — never block the same seats again for it. Cancellation is not offered on the API.
HTTP 401 and invalid_signature.- GET
/bus/citiesCity / station directory - GET
/bus/searchAvailable trips on a route and date - GET
/bus/seat-layoutSeat map for a trip - GET
/bus/pointsBoarding and dropping points - POST
/bus/blockHold the selected seats (no money) - POST
/bus/bookConfirm the held seats - GET
/bus/bookingsYour recent confirmed bookings - GET
/bus/bookingFind a booking by your own reference - GET
/bus/booking/{ref}One booking with its ticket - GET
/bus/booking/{ref}/ticketDownload the e-ticket (PNG)
City / station directory
GET/api/corp/v1/bus/cities
Query parameters
| Name | Description |
|---|---|
qoptional | Autocomplete term. |
popularoptional | Set to 1 for a curated top-cities list. |
alloptional | Set to 1 for the full directory (a one-time local sync), paged with limit and offset. |
curl "https://apipe.in/api/corp/v1/bus/cities" \
-H "X-Api-Token: <your-token>"<…> with your own value. Only the required fields are shown.Available trips on a route and date
GET/api/corp/v1/bus/search
Query parameters
| Name | Description |
|---|---|
fromrequired | Source station id (from /bus/cities). |
torequired | Destination station id. |
daterequired | Travel date, YYYY-MM-DD. |
Notes
Each trip carries a trip_id for the next calls. Zero trips can also mean the operator directory did not answer: try again before telling your customer there is no bus.
curl "https://apipe.in/api/corp/v1/bus/search?from=<from>&to=<to>&date=<date>" \
-H "X-Api-Token: <your-token>"<…> with your own value. Only the required fields are shown.Seat map for a trip
GET/api/corp/v1/bus/seat-layout
Query parameters
| Name | Description |
|---|---|
trip_idrequired | Trip id from search. |
Notes
Each seat has an id, its availability, price and service_tax.
curl "https://apipe.in/api/corp/v1/bus/seat-layout?trip_id=<trip_id>" \
-H "X-Api-Token: <your-token>"<…> with your own value. Only the required fields are shown.Boarding and dropping points
GET/api/corp/v1/bus/points
Query parameters
| Name | Description |
|---|---|
trip_idrequired | Trip id from search. |
curl "https://apipe.in/api/corp/v1/bus/points?trip_id=<trip_id>" \
-H "X-Api-Token: <your-token>"<…> with your own value. Only the required fields are shown.Hold the selected seats (no money)
POST/api/corp/v1/bus/block
Body parameters
| Name | Description |
|---|---|
trip_idrequired | Trip id. |
seatsrequired | Seat ids from the seat map (at most 6). |
passengersrequired | One {name, age, gender} per seat, in the same order; gender M or F. |
boarding_idrequired | Boarding point id. |
dropping_idrequired | Dropping point id. |
contactrequired | {mobile, email} of the traveller (address optional). |
Notes
Returns a single-use block_ref, the fare (amount) and expires_in seconds. The fare is re-read from the operator — prices you send are never used. Your wallet is debited at book: the fare less your commission.
curl "https://apipe.in/api/corp/v1/bus/block" \
-X POST \
-H "X-Api-Token: <your-token>" \
-H "Content-Type: application/json" \
-d '{
"trip_id": "<trip_id>",
"seats": "<seats>",
"passengers": "<passengers>",
"boarding_id": "<boarding_id>",
"dropping_id": "<dropping_id>",
"contact": "<contact>"
}'<…> with your own value. Only the required fields are shown.Confirm the held seats
Moves moneyPOST/api/corp/v1/bus/book
Body parameters
| Name | Description |
|---|---|
block_refrequired | From block. |
request_idrequired | Your unique reference (idempotency key), at most 64 characters, used for nothing else. |
Notes
status is success | pending | failed. If you get no answer, send the SAME request again: a repeated request_id — or the same block_ref under a new one — returns the original booking, never a second one.
A request_id you already used for something else (a recharge, another booking) is refused with request_id_reused.
curl "https://apipe.in/api/corp/v1/bus/book" \
-X POST \
-H "X-Api-Token: <your-token>" \
-H "Content-Type: application/json" \
-d '{
"block_ref": "<block_ref>",
"request_id": "<request_id>"
}'<…> with your own value. Only the required fields are shown.Your recent confirmed bookings
GET/api/corp/v1/bus/bookings
Query parameters
| Name | Description |
|---|---|
limitoptional | Up to 50 (default 10). |
curl "https://apipe.in/api/corp/v1/bus/bookings" \
-H "X-Api-Token: <your-token>"<…> with your own value. Only the required fields are shown.Find a booking by your own reference
GET/api/corp/v1/bus/booking
Query parameters
| Name | Description |
|---|---|
request_idoptional | The request_id you sent to /bus/book. |
block_refoptional | Or the hold you booked. |
Notes
Send one of the two. Pending and failed bookings are found too. Same answer as GET /bus/booking/{ref}.
curl "https://apipe.in/api/corp/v1/bus/booking" \
-H "X-Api-Token: <your-token>"<…> with your own value. Only the required fields are shown.One booking with its ticket
GET/api/corp/v1/bus/booking/{ref}
curl "https://apipe.in/api/corp/v1/bus/booking/<ref>" \
-H "X-Api-Token: <your-token>"<…> with your own value.Download the e-ticket (PNG)
GET/api/corp/v1/bus/booking/{ref}/ticket
Notes
Confirmed bookings only. The booking's ticket.download_url points here.
curl "https://apipe.in/api/corp/v1/bus/booking/<ref>/ticket" \
-H "X-Api-Token: <your-token>"<…> with your own value.