# Create a booking A booking is a temporary hold on a trip. It is not confirmed until the payment is processed. Endpoint: POST /bookings Version: 1.0.0 Security: OAuth2 ## Request fields (application/json): - `trip_id` (string) Identifier of the booked trip - `passenger_name` (string) Name of the passenger - `has_bicycle` (boolean) Indicates whether the passenger has a bicycle. - `has_dog` (boolean) Indicates whether the passenger has a dog. ## Response 201 fields (application/json): - `id` (string) Unique identifier for the booking - `trip_id` (string) Identifier of the booked trip - `passenger_name` (string) Name of the passenger - `has_bicycle` (boolean) Indicates whether the passenger has a bicycle. - `has_dog` (boolean) Indicates whether the passenger has a dog. - `links` (object) - `links.self` (string) ## Response 400 fields (application/problem+json): - `type` (string) A URI reference that identifies the problem type Example: "https://example.com/probs/out-of-credit" - `title` (string) A short, human-readable summary of the problem type Example: "You do not have enough credit." - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Your current balance is 30, but that costs 50." - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/account/12345/msgs/abc" - `status` (integer) The HTTP status code Example: 400 ## Response 401 fields (application/problem+json): - `type` (string) A URI reference that identifies the problem type Example: "https://example.com/probs/out-of-credit" - `title` (string) A short, human-readable summary of the problem type Example: "You do not have enough credit." - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Your current balance is 30, but that costs 50." - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/account/12345/msgs/abc" - `status` (integer) The HTTP status code Example: 400 ## Response 404 fields (application/problem+json): - `type` (string) A URI reference that identifies the problem type Example: "https://example.com/probs/out-of-credit" - `title` (string) A short, human-readable summary of the problem type Example: "You do not have enough credit." - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Your current balance is 30, but that costs 50." - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/account/12345/msgs/abc" - `status` (integer) The HTTP status code Example: 400 ## Response 409 fields (application/problem+json): - `type` (string) A URI reference that identifies the problem type Example: "https://example.com/probs/out-of-credit" - `title` (string) A short, human-readable summary of the problem type Example: "You do not have enough credit." - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Your current balance is 30, but that costs 50." - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/account/12345/msgs/abc" - `status` (integer) The HTTP status code Example: 400 ## Response 429 fields (application/problem+json): - `type` (string) A URI reference that identifies the problem type Example: "https://example.com/probs/out-of-credit" - `title` (string) A short, human-readable summary of the problem type Example: "You do not have enough credit." - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Your current balance is 30, but that costs 50." - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/account/12345/msgs/abc" - `status` (integer) The HTTP status code Example: 400 ## Response 500 fields (application/problem+json): - `type` (string) A URI reference that identifies the problem type Example: "https://example.com/probs/out-of-credit" - `title` (string) A short, human-readable summary of the problem type Example: "You do not have enough credit." - `detail` (string) A human-readable explanation specific to this occurrence of the problem Example: "Your current balance is 30, but that costs 50." - `instance` (string) A URI reference that identifies the specific occurrence of the problem Example: "/account/12345/msgs/abc" - `status` (integer) The HTTP status code Example: 400