Corporate APIv1

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.

Signed requests only. Once this service is switched on for your account, every call on this page must be signed with your signing secret (see Request signing). A call with the API token alone is refused with HTTP 401 and invalid_signature.

City / station directory

GET/api/corp/v1/bus/cities

Query parameters

NameDescription
qoptionalAutocomplete term.
popularoptionalSet to 1 for a curated top-cities list.
alloptionalSet to 1 for the full directory (a one-time local sync), paged with limit and offset.
Request
curl "https://apipe.in/api/corp/v1/bus/cities" \
  -H "X-Api-Token: <your-token>"
Replace each <…> with your own value. Only the required fields are shown.

Seat map for a trip

GET/api/corp/v1/bus/seat-layout

Query parameters

NameDescription
trip_idrequiredTrip id from search.

Notes

Each seat has an id, its availability, price and service_tax.

Request
curl "https://apipe.in/api/corp/v1/bus/seat-layout?trip_id=<trip_id>" \
  -H "X-Api-Token: <your-token>"
Replace each <…> with your own value. Only the required fields are shown.

Boarding and dropping points

GET/api/corp/v1/bus/points

Query parameters

NameDescription
trip_idrequiredTrip id from search.
Request
curl "https://apipe.in/api/corp/v1/bus/points?trip_id=<trip_id>" \
  -H "X-Api-Token: <your-token>"
Replace each <…> with your own value. Only the required fields are shown.

Hold the selected seats (no money)

POST/api/corp/v1/bus/block

Body parameters

NameDescription
trip_idrequiredTrip id.
seatsrequiredSeat ids from the seat map (at most 6).
passengersrequiredOne {name, age, gender} per seat, in the same order; gender M or F.
boarding_idrequiredBoarding point id.
dropping_idrequiredDropping 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.

Request
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>"
  }'
Replace each <…> with your own value. Only the required fields are shown.

Confirm the held seats

Moves money

POST/api/corp/v1/bus/book

Body parameters

NameDescription
block_refrequiredFrom block.
request_idrequiredYour 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.

Request
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>"
  }'
Replace each <…> with your own value. Only the required fields are shown.

Your recent confirmed bookings

GET/api/corp/v1/bus/bookings

Query parameters

NameDescription
limitoptionalUp to 50 (default 10).
Request
curl "https://apipe.in/api/corp/v1/bus/bookings" \
  -H "X-Api-Token: <your-token>"
Replace each <…> 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

NameDescription
request_idoptionalThe request_id you sent to /bus/book.
block_refoptionalOr the hold you booked.

Notes

Send one of the two. Pending and failed bookings are found too. Same answer as GET /bus/booking/{ref}.

Request
curl "https://apipe.in/api/corp/v1/bus/booking" \
  -H "X-Api-Token: <your-token>"
Replace each <…> with your own value. Only the required fields are shown.

One booking with its ticket

GET/api/corp/v1/bus/booking/{ref}

Request
curl "https://apipe.in/api/corp/v1/bus/booking/<ref>" \
  -H "X-Api-Token: <your-token>"
Replace each <…> 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.

Request
curl "https://apipe.in/api/corp/v1/bus/booking/<ref>/ticket" \
  -H "X-Api-Token: <your-token>"
Replace each <…> with your own value.