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

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

Pay for a Booking

Request

A payment is an attempt to pay for the booking, which will confirm the booking for the user and enable them to get their tickets.

Path
bookingIdstring(uuid)required

The ID of the booking to pay for.

Example: 1725ff48-ab45-4bb5-9d02-88745177dedb
Bodyapplication/json
amountnumber> 0

Amount intended to be collected by this payment. A positive decimal figure describing the amount to be collected.

currencystring

Three-letter ISO currency code, in lowercase.

Enum"bam""bgn""chf""eur""gbp""nok""sek""try"
sourceCard (object) or Bank Account (object)

The payment source to take the payment from. This can be a card or a bank account. Some of these properties will be hidden on read to protect PII leaking.

Any of:

The payment source to take the payment from. This can be a card or a bank account. Some of these properties will be hidden on read to protect PII leaking.

curl -i -X POST \
  https://innovario.apishowdown.com/_mock/catalog/api-showdown/api-hub/train-travel/openapi/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb/payment \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": 49.99,
    "currency": "gbp",
    "source": {
      "object": "card",
      "name": "J. Doe",
      "number": "4242424242424242",
      "cvc": 123,
      "exp_month": 12,
      "exp_year": 2025,
      "address_line1": "123 Fake Street",
      "address_line2": "4th Floor",
      "address_city": "London",
      "address_country": "gb",
      "address_post_code": "N12 9XX"
    }
  }'

Responses

Payment successful

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.

Bodyapplication/json
idstring(uuid)read-only

Unique identifier for the payment. This will be a unique identifier for the payment, and is used to reference the payment in other objects.

amountnumber> 0

Amount intended to be collected by this payment. A positive decimal figure describing the amount to be collected.

currencystring

Three-letter ISO currency code, in lowercase.

Enum"bam""bgn""chf""eur""gbp""nok""sek""try"
sourceCard (object) or Bank Account (object)

The payment source to take the payment from. This can be a card or a bank account. Some of these properties will be hidden on read to protect PII leaking.

Any of:

The payment source to take the payment from. This can be a card or a bank account. Some of these properties will be hidden on read to protect PII leaking.

statusstringread-only

The status of the payment, one of pending, succeeded, or failed.

Enum"pending""succeeded""failed"
linksobject(Links-Booking)
Response
application/json
{ "id": "2e3b4f5a-6b7c-8d9e-0f1a-2b3c4d5e6f7a", "amount": 49.99, "currency": "gbp", "source": { "object": "card", "name": "J. Doe", "number": "************4242", "cvc": 123, "exp_month": 12, "exp_year": 2025, "address_country": "gb", "address_post_code": "N12 9XX" }, "status": "succeeded", "links": { "booking": "https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb/payment" } }