Endpoint
Authentication
Requires JWT authentication token. The authenticated user’s ID is automatically recorded asactualizado_por.
Path Parameters
The unique identifier of the fuel record to update
Request Body
Same fields as Create Fuel Record, all optional but should include the fields you want to update.Common Fields
Transaction date in format
YYYY-MM-DDFuel station identifier
Operational area identifier
Concept:
OPERATIVO or ADMINISTRATIVOOperation type:
TANQUEO or ANTICIPONotes or observations
Available balance at fuel station
TANQUEO-Specific Fields
Driver identifier
Vehicle plate identifier
Fuel type:
ACPM, GASOLINA, or EXTRATotal fuel cost in COP
Quantity of fuel in gallons
Hourmeter reading
ANTICIPO-Specific Fields
Advance payment amount in COP
Response
Returns the updated fuel record with all fields.Record identifier
Transaction date
Driver identifier
Vehicle plate identifier
Fuel station identifier
Operational area identifier
Fuel type
Total fuel cost
Fuel quantity in gallons
Automatically recalculated cost per gallon
Hourmeter reading
Advance payment amount
Available balance
Concept
Operation type
Observations
User ID who created the record (unchanged)
User ID who last updated the record
Timestamp of last update (ISO 8601 format)
Examples
Update Fuel Amount and Cost
Add Hourmeter Reading
Convert TANQUEO to ANTICIPO
Change Driver and Vehicle
Success Response Example
Status Code:200 OK
Update Behavior
Type Conversion Handling
When changingtipo_operacion:
TANQUEO → ANTICIPO:
- Vehicle and driver fields are set to null
tipo_combustible,valor_tanqueo,cantidad_galones,horometro,costo_por_galonare nullifiedvalor_anticipomust be provided
valor_anticipois set to null- Required TANQUEO fields must be provided:
conductor_id,placa_id,tipo_combustible,valor_tanqueo,cantidad_galones
Automatic Updates
- costo_por_galon: Recalculated automatically when
valor_tanqueoorcantidad_galoneschanges - actualizado_por: Set to authenticated user’s ID from JWT token
- actualizado_en: Set to current server timestamp (ISO 8601 format)
Default Values
tipo_combustible: Defaults to “ACPM” if not specified for TANQUEO- Other fields retain their existing values if not included in the update request
Error Responses
400 Bad Request - Invalid Field
400 Bad Request - Foreign Key Violation
404 Not Found
401 Unauthorized
500 Internal Server Error
Validation Rules
- The record with the specified
idmust exist - Foreign key constraints are enforced (bomba_id, area_operacion_id, conductor_id, placa_id must reference valid records)
- Type-specific fields are validated based on
tipo_operacion - Numeric fields must be valid numbers
- Date must be in
YYYY-MM-DDformat
Implementation Notes
- Partial updates are supported - only include fields you want to change
- The update is transactional - either all changes succeed or none are applied
- Audit fields (
actualizado_por,actualizado_en) are automatically managed - The original creator (
creado_por) is never changed - Cost per gallon is recalculated server-side to maintain consistency
Related Endpoints
- Create Fuel Record - Create a new record
- Delete Fuel Record - Delete a record
- List Fuel Records - View all records