Skip to main content

Overview

Viax implements a sophisticated dual-screen pricing system that allows administrators to configure tariffs by vehicle type, time periods, and apply dynamic pricing based on demand.
Pricing is configured per vehicle type with support for peak hours, nighttime, and holiday surcharges.

Pricing Database Schema

The pricing system uses dedicated database tables:

Configuration Table

migrations/007_create_configuracion_precios.sql

Price History Table

Default Pricing Configuration

Vehicle Type: moto

Price Calculation Formula

The system uses a comprehensive formula to calculate trip costs:

Implementation Example

Time Periods

Peak Hours (Hora Pico)

Morning Peak

Default: 7:00 AM - 9:00 AMSurcharge: 15%

Evening Peak

Default: 5:00 PM - 7:00 PMSurcharge: 15%

Night Hours (Nocturno)

Time Range: 10:00 PM - 6:00 AM Surcharge: 20%

Normal Hours

Time Range: All other hours Surcharge: 0%

Active Prices View

A database view provides quick access to current pricing with period detection:

Backend API Endpoints

Get Pricing Configuration

backend/pricing/get_config.php

Calculate Trip Quote

backend/pricing/calculate_quote.php

Updating Pricing Configuration

1

Access Database

Connect to the MySQL database as admin
2

Update Configuration

3

Verify Changes

4

Check History

Changes are automatically logged in historial_precios
Pricing changes take effect immediately for new trip requests. Active trips use the pricing from when they were created.

Commission Distribution

Platform commission is calculated per trip:

Example Breakdown

Trip Total: $50,000 COP Platform Commission (15%): $7,500 COP Driver Base Earnings: $42,500 COP Company Commission (10%): $4,250 COP Driver Final Earnings: $38,250 COP

Distance Discount

Long-distance trips receive automatic discounts:
Trips over 15km automatically receive a 10% discount to encourage long-distance rides.

Holiday Pricing

Implement holiday detection for special rates:
Holiday surcharges can be configured per vehicle type and override other time-based surcharges.

Testing Pricing Configuration

Verify Period Detection

Simulate Price Calculation

Change Time Periods for Testing

Price Display to Users

Users see estimated pricing before requesting trips:
1

Enter Route

User selects origin and destination
2

Select Vehicle Type

User chooses moto, carro, etc.
3

View Quote

System calculates and displays:
  • Base fare
  • Distance cost
  • Time cost
  • Active surcharges
  • Total estimated price
4

Confirm Request

User accepts price and requests trip

Future Enhancements

Dynamic Pricing

Adjust prices based on real-time demand

Zone-Based Pricing

Different rates for different geographic areas

Promotional Codes

Discount codes and promotional campaigns

Membership Tiers

Discounted rates for premium members

Best Practices

Always test pricing changes with the calculate_quote endpoint before deploying to production.
Use the ‘notas’ field to document why prices were changed and when.
Regularly compare your rates with competitors to stay competitive.
Ensure drivers earn fair wages after platform and company commissions.
Notify drivers and users before implementing significant price changes.

Vehicle Types

Manage vehicle categories

Company Management

Configure company commissions

Service Areas

Define service boundaries