Skip to main content

Get Earnings

GET /conductor/get_earnings.php
Retrieve driver earnings for a specific time period.

Query Parameters

conductor_id
integer
required
Driver ID
periodo
string
required
Time period for earnings reportPossible values:
  • hoy - Today’s earnings
  • semana - This week’s earnings
  • mes - This month’s earnings
  • total - All-time earnings

Response

success
boolean
Request success status
earnings
object
Earnings data for the period

Request Example

curl -X GET "https://76.13.114.194/conductor/get_earnings.php?conductor_id=25&periodo=hoy" \
  -H "Accept: application/json"

Response Example

{
  "success": true,
  "earnings": {
    "periodo": "hoy",
    "total_viajes": 8,
    "ganancia_total": 156000,
    "ganancia_promedio": 19500,
    "fecha_inicio": "2024-03-15T00:00:00.000Z",
    "fecha_fin": "2024-03-15T23:59:59.000Z"
  }
}

Earnings Breakdown

Earnings are calculated based on:
  • Base Fare: Starting price for the trip
  • Distance Rate: Price per kilometer
  • Time Rate: Price per minute (if applicable)
  • Service Fee: Platform commission (deducted)

Example Calculation

class TripEarnings {
  final double precioFinal;        // Final trip price
  final double comisionPlataforma; // Platform commission (e.g., 15%)
  
  double get gananciaDriver {
    return precioFinal * (1 - comisionPlataforma / 100);
  }
}

// Example:
final trip = TripEarnings(
  precioFinal: 25000,
  comisionPlataforma: 15,
);

print(trip.gananciaDriver); // 21250 COP

Payment Methods

Drivers receive earnings through:
  • Cash: Collected directly from passengers
  • Digital Wallet: Platform wallet for cashless payments
  • Bank Transfer: Weekly/monthly transfers to bank account
Earnings are typically paid out weekly or monthly, depending on the driver’s preference and platform policy.

Error Responses

400
Bad Request
Invalid period parameter
404
Not Found
Driver not found
500
Internal Server Error
Server error

See Also

Build docs developers (and LLMs) love