# Server: GetVehicleMileage(plate)

> Reference for Server: GetVehicleMileage(plate) in mechanicjob.

[All exports](/docs/jobs/mechanicjob/reference/exports)

This page documents supported public integration calls and usage examples. It does not expose or reproduce the resource's internal implementation.

## Server Exports

All Advanced Pricing and Billing exports return a result table:

```lua
{
    success = true,
    data = {}
}
```

Rejected requests return `success = false` and a stable `error` code. Player identity, mechanic job, grade, permissions, vehicle distance, configured limits, quote state, invoice ownership, and monetary values are always resolved or validated on the server.

### `GetVehicleMileage(plate)`

- **Purpose**: Returns mileage in kilometres from the selected source for the supplied plate. With **JG Mileage** enabled and `jg-vehiclemileage` started, it reads JG; otherwise it reads Sky's saved mileage.
- **Arguments**:

  - `plate` (`string`) - vehicle plate text. Required.
- **Returns**: `number | nil` - whole kilometres, including `0` when Sky has no saved reading; `nil` for invalid input or a database read failure. An active JG lookup failure raises an error.

```lua
local mileage = exports["sky_mechanicjob"]:GetVehicleMileage("ABC123")

if mileage then
    print(("Mileage: %s"):format(mileage))
end
```
