_update

Creates a new Vehicle or changes the settings of a Vehicle with an existing ID.

Parameters

id

The ID of the Vehicle, this parameter is needed to modify an existing Vehicle, if this parameter is not included, a new Vehicle is created instead.

cost_per_distance

The cost per distance variable of the Vehicle.

price_per_distance

The price per distance variable of the Vehicle.

description

A string value which will be the description of the Vehicle.

Example

FM_api('Vehicle_update',[
    'id'=>'30007'
    'reg'=>'ABC123D',
    'cost_per_distance'=>'1',
    'price_per_distance'=>'2.5',
    'description'=>'test desc'
  ]
);

Result

On Failure

If the "cost_per_distance" parameter is not given a value:

{"error":"missing or invalid parameter: cost_per_distance"}

On Success

If a new Vehicle is created, the ID and UUID of the Vehicle are returned:

{"ok":1,"id":30007,"uuid":"6156d113cb8d77abcda9c1f146b3fb23"}

If the Vehicle already exists, the UUID returned is null:

{"ok":1,"id":"30007","uuid":null}

Last updated