Train Travel API (1.0.0)

API for finding and booking train trips across Europe.

This API was created by Bump.sh for the entire OpenAPI community, for educational and demonstrative purposes.

Download OpenAPI description
Overview
URL

https://example.com/support

Train Support

support@example.com

License

CC-BY-NC-SA-4.0

Languages
Servers
Mock server

https://innovario.apishowdown.com/_mock/catalog/api-showdown/api-hub/train-travel/openapi/

Production

https://api.example.com/

Stations

Find and filter train stations across Europe, including their location and local timezone.

Operations

Trips

Timetables and routes for train trips between stations, including pricing and availability.

Operations

Bookings

Create and manage bookings for train trips, including passenger details and optional extras.

OperationsWebhooks

List existing bookings

Request

Returns a list of all trip bookings by the authenticated user.

curl -i -X GET \
  https://innovario.apishowdown.com/_mock/catalog/api-showdown/api-hub/train-travel/openapi/bookings \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

A list of bookings

Headers
RateLimitstring

The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

Body
dataArray of objects

The wrapper for a collection is an array of objects.

linksobjectread-only

A set of hypermedia links which serve as controls for the client.

Response
{ "data": [ {}, {} ], "links": { "self": "https://api.example.com/bookings", "next": "https://api.example.com/bookings?page=2" } }

Create a booking

Request

A booking is a temporary hold on a trip. It is not confirmed until the payment is processed.

Bodyrequired
trip_idstring(uuid)

Identifier of the booked trip

passenger_namestring

Name of the passenger

has_bicycleboolean

Indicates whether the passenger has a bicycle.

has_dogboolean

Indicates whether the passenger has a dog.

curl -i -X POST \
  https://innovario.apishowdown.com/_mock/catalog/api-showdown/api-hub/train-travel/openapi/bookings \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "trip_id": "4f4e4e1-c824-4d63-b37a-d8d698862f1d",
    "passenger_name": "John Doe",
    "has_bicycle": true,
    "has_dog": true
  }'

Responses

Booking successful

Body
idstring(uuid)read-only

Unique identifier for the booking

trip_idstring(uuid)

Identifier of the booked trip

passenger_namestring

Name of the passenger

has_bicycleboolean

Indicates whether the passenger has a bicycle.

has_dogboolean

Indicates whether the passenger has a dog.

linksobject(Links-Self)
Response
{ "id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "trip_id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "passenger_name": "John Doe", "has_bicycle": true, "has_dog": true, "links": { "self": "https://api.example.com/bookings/efdbb9d1-02c2-4bc3-afb7-6788d8782b1e" } }

Get a booking

Request

Returns the details of a specific booking.

Path
bookingIdstring(uuid)required

The ID of the booking to retrieve.

Example: 1725ff48-ab45-4bb5-9d02-88745177dedb
curl -i -X GET \
  https://innovario.apishowdown.com/_mock/catalog/api-showdown/api-hub/train-travel/openapi/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

The booking details

Headers
RateLimitstring

The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

Body
idstring(uuid)read-only

Unique identifier for the booking

trip_idstring(uuid)

Identifier of the booked trip

passenger_namestring

Name of the passenger

has_bicycleboolean

Indicates whether the passenger has a bicycle.

has_dogboolean

Indicates whether the passenger has a dog.

linksobject(Links-Self)
Response
{ "id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "trip_id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "passenger_name": "John Doe", "has_bicycle": true, "has_dog": true, "links": { "self": "https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb" } }

Delete a booking

Request

Deletes a booking, cancelling the hold on the trip.

Path
bookingIdstring(uuid)required

The ID of the booking to retrieve.

Example: 1725ff48-ab45-4bb5-9d02-88745177dedb
curl -i -X DELETE \
  https://innovario.apishowdown.com/_mock/catalog/api-showdown/api-hub/train-travel/openapi/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Booking deleted

Response
No content

New BookingWebhook

Request

Subscribe to new bookings being created, to update integrations for your users. Related data is available via the links provided in the request.

Bodyapplication/json
idstring(uuid)read-only

Unique identifier for the booking

trip_idstring(uuid)

Identifier of the booked trip

passenger_namestring

Name of the passenger

has_bicycleboolean

Indicates whether the passenger has a bicycle.

has_dogboolean

Indicates whether the passenger has a dog.

linksobject
application/json
{ "id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "trip_id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "passenger_name": "John Doe", "has_bicycle": true, "has_dog": true, "links": { "self": "https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb" } }

Responses

Return a 200 status to indicate that the data was received successfully.

Payments

Pay for bookings using a card or bank account, and view payment status and history.

warn Bookings usually expire within 1 hour so you'll need to make your payment before the expiry date

Operations