Skip to content

Create a booking

Request

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

Security
OAuth2(Required scopes: write)
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.

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" } }