> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Braian551/viax/llms.txt
> Use this file to discover all available pages before exploring further.

# Booking a Ride

> Learn how to request a ride using the Viax platform

## Overview

Booking a ride with Viax is simple and intuitive. This guide walks you through the process of requesting a trip, selecting vehicle types, and confirming your booking.

## Ride Booking Process

<Steps>
  <Step title="Open the app and set your location">
    Launch the Viax app and allow location permissions. The app will automatically detect your current location using GPS.

    <Note>
      Make sure you have location services enabled for accurate pickup positioning.
    </Note>
  </Step>

  <Step title="Enter destination">
    Tap the destination field and search for your desired location. You can:

    * Type an address
    * Select from recent destinations
    * Choose a saved location
    * Drop a pin on the map

    The app uses geocoding to convert addresses to coordinates for accurate routing.
  </Step>

  <Step title="Select vehicle type">
    Choose from available vehicle options:

    <CardGroup cols={2}>
      <Card title="Moto" icon="motorcycle">
        Quick and affordable for solo riders
      </Card>

      <Card title="Carro" icon="car">
        Comfortable ride for up to 4 passengers
      </Card>

      <Card title="Moto Carga" icon="truck">
        Small package delivery
      </Card>

      <Card title="Carro Carga" icon="truck-moving">
        Larger cargo transport
      </Card>
    </CardGroup>
  </Step>

  <Step title="Review price estimate">
    View the estimated fare based on:

    * Base fare for the vehicle type
    * Distance to destination
    * Estimated time
    * Current demand (surge pricing if applicable)

    ```json theme={null}
    {
      "base_fare": 3500,
      "distance_cost": 2400,
      "time_cost": 1500,
      "surge_multiplier": 1.0,
      "total_estimate": 7400
    }
    ```

    See [Pricing System](/users/pricing-system) for detailed fare calculation.
  </Step>

  <Step title="Confirm booking">
    Review all details and tap "Request Ride". The app will:

    * Search for nearby available drivers
    * Send your request to the closest driver
    * Show searching status with estimated wait time
  </Step>

  <Step title="Wait for driver acceptance">
    Once a driver accepts:

    * You'll see driver details (name, photo, rating)
    * Vehicle information (type, plate number)
    * Estimated arrival time
    * Real-time driver location on map

    <Info>
      You can contact the driver directly through the app if needed.
    </Info>
  </Step>
</Steps>

## Trip Request Data

When you confirm a booking, the app sends this information to the backend:

```dart theme={null}
// lib/src/features/trips/data/models/trip_request_model.dart
class TripRequestModel {
  final String userId;
  final LatLng pickupLocation;
  final LatLng destinationLocation;
  final String pickupAddress;
  final String destinationAddress;
  final String vehicleType;
  final double estimatedDistance;
  final int estimatedDuration;
  final double estimatedPrice;
  
  Map<String, dynamic> toJson() => {
    'user_id': userId,
    'pickup_lat': pickupLocation.latitude,
    'pickup_lng': pickupLocation.longitude,
    'destination_lat': destinationLocation.latitude,
    'destination_lng': destinationLocation.longitude,
    'pickup_address': pickupAddress,
    'destination_address': destinationAddress,
    'vehicle_type': vehicleType,
    'estimated_distance': estimatedDistance,
    'estimated_duration': estimatedDuration,
    'estimated_price': estimatedPrice,
  };
}
```

## Vehicle Type Selection

Viax offers different vehicle categories to suit your needs:

<Tabs>
  <Tab title="Moto">
    **Motorcycle**

    * Capacity: 1 passenger
    * Base fare: \$3,000 COP
    * Best for: Quick solo trips
    * Average speed: Higher in traffic
  </Tab>

  <Tab title="Carro">
    **Car**

    * Capacity: Up to 4 passengers
    * Base fare: \$4,500 COP
    * Best for: Groups or comfort
    * Features: Air conditioning
  </Tab>

  <Tab title="Moto Carga">
    **Motorcycle Cargo**

    * Capacity: Small packages
    * Base fare: \$3,500 COP
    * Max weight: 20 kg
    * Best for: Document or small item delivery
  </Tab>

  <Tab title="Carro Carga">
    **Car Cargo**

    * Capacity: Medium packages
    * Base fare: \$5,000 COP
    * Max weight: 100 kg
    * Best for: Furniture or larger deliveries
  </Tab>
</Tabs>

## Finding Nearby Drivers

The platform uses geolocation to find available drivers near your pickup location:

```dart theme={null}
// Radius search for nearby drivers
final nearbyDrivers = await tripRepository.findNearbyDrivers(
  location: pickupLocation,
  radius: 5000, // 5km radius
  vehicleType: selectedVehicleType,
);
```

<Warning>
  If no drivers are available in your area, you'll receive a notification. Try again in a few minutes or consider selecting a different vehicle type.
</Warning>

## Payment Methods

Before confirming your ride, ensure you have a payment method configured:

* Cash (pay driver directly)
* Credit/debit card (future feature)
* Digital wallet integration (planned)

See [Payment Methods](/users/payment-methods) for more details.

## Cancellation Policy

You can cancel a ride before the driver arrives:

* **Free cancellation**: Within 2 minutes of booking
* **Cancellation fee**: After 2 minutes or if driver is en route
* Fee amount varies by vehicle type and distance traveled by driver

## Safety Features

While booking and during your trip:

<CardGroup cols={2}>
  <Card title="Share Location" icon="location-dot" href="/users/location-sharing">
    Share your trip with friends or family in real-time
  </Card>

  <Card title="Driver Verification" icon="shield-check">
    All drivers are verified with background checks and document validation
  </Card>

  <Card title="In-App Support" icon="headset">
    Contact support directly from the app during your trip
  </Card>

  <Card title="Trip Tracking" icon="route" href="/users/trip-tracking">
    Real-time GPS tracking throughout your journey
  </Card>
</CardGroup>

## Common Issues

<Accordion title="No drivers available in my area">
  This can happen in:

  * Low-density areas
  * Peak hours when demand is high
  * Late night hours

  **Solutions**:

  * Wait a few minutes and try again
  * Check if drivers are available for a different vehicle type
  * Consider scheduling a ride in advance (if feature is available)
</Accordion>

<Accordion title="Price estimate keeps changing">
  Price estimates update in real-time based on:

  * Current traffic conditions
  * Demand in your area
  * Route changes

  The final price is locked when a driver accepts your request.
</Accordion>

<Accordion title="Driver is taking too long to arrive">
  Check the app for:

  * Driver's current location on map
  * Updated ETA
  * Traffic conditions

  You can:

  * Contact the driver via in-app messaging
  * Cancel and request another driver (fees may apply)
  * Contact support if there's an issue
</Accordion>

## Next Steps

<CardGroup cols={2}>
  <Card title="Track Your Trip" icon="map-location-dot" href="/users/trip-tracking">
    Learn about real-time trip tracking features
  </Card>

  <Card title="Pricing System" icon="calculator" href="/users/pricing-system">
    Understand how trip fares are calculated
  </Card>
</CardGroup>

## Related API Endpoints

* [Create Trip Request](/api/trips/create)
* [Find Nearby Drivers](/api/trips/pricing)
* [Calculate Route](/api/map/routing)
