Appearance
Segments API
Segments represent individual travel legs within a booking (flights, hotel stays, car rentals).
Add Segment
http
POST /api/v1/bookings/{id}/segmentsBase Fields (all segment types):
| Field | Type | Required | Description |
|---|---|---|---|
| booking_id | uuid | ✅ Yes | Booking ID |
| segment_type | string | ✅ Yes | FLIGHT, HOTEL, RENTAL_CAR |
| sequence_number | int | ✅ Yes | Segment order |
| cost | number | ✅ Yes | >= 0 |
| notes | string | No | Max 1000 chars |
✈️ Flight Segment Fields
| Field | Type | Description |
|---|---|---|
| carrier_id | uuid | Airline carrier ID |
| flight_number | string | Max 20 chars |
| departure_airport | string | IATA code (max 10 chars) |
| arrival_airport | string | IATA code (max 10 chars) |
| departure_time | datetime | ISO 8601 |
| arrival_time | datetime | ISO 8601 |
| ticket_class | string | ECONOMY, PREMIUM_ECONOMY, BUSINESS, FIRST |
| eu_flight | boolean | Within EU |
| national_flight | boolean | Domestic flight |
| third_world_flight | boolean | To developing country |
🏨 Hotel Segment Fields
| Field | Type | Description |
|---|---|---|
| hotel_name | string | Max 255 chars |
| hotel_number | string | Max 50 chars |
| check_in_date | date | YYYY-MM-DD |
| check_out_date | date | YYYY-MM-DD |
| room_type | string | Max 100 chars |
| nights | int | >= 1 |
| hotel_supplier_id | uuid | Supplier ID |
🚗 Rental Car Segment Fields
| Field | Type | Description |
|---|---|---|
| pickup_location | string | Max 255 chars |
| return_location | string | Max 255 chars |
| pickup_date | datetime | 2006-01-02T15:04:05 |
| return_date | datetime | 2006-01-02T15:04:05 |
| vehicle_type | string | Max 100 chars |
| rental_supplier_id | uuid | Supplier ID |
| rental_total_days | int | >= 1 |
| rental_flight_number | string | Max 20 chars |
| rental_flight_time | string | Max 20 chars |
| rental_fuel_type | string | Max 50 chars |
| rental_gear_type | string | Max 50 chars |
| rental_options | string | Max 5000 chars |
Update Segment
http
PUT /api/v1/bookings/{id}/segments/{segmentId}Delete Segment
http
DELETE /api/v1/bookings/{id}/segments/{segmentId}