> For the complete documentation index, see [llms.txt](https://yuu-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yuu-studio.gitbook.io/docs/y-garage/exports.md).

# Exports

#### RegisterOwnedVehicle

Registers a newly purchased vehicle in the persistent vehicle system.

**Usage:**

```lua
exports['y_garage']:RegisterOwnedVehicle({
    plate = plate,
    owner = ownerIdentifier,
    ownerName = ownerName,
    mods = vehicleProperties,
    type = 'car'
})
```

**Parameters:**

| Parameter   | Type   | Description                |
| ----------- | ------ | -------------------------- |
| `plate`     | string | Vehicle plate              |
| `owner`     | string | Vehicle owner's identifier |
| `ownerName` | string | Vehicle owner's name       |
| `mods`      | table  | Vehicle properties         |
| `type`      | string | Vehicle type (e.g. `car`)  |

**Notes:**

* Call this export server-side.
* Call it after the vehicle has been successfully registered in your database.
* The vehicle will be added to the persistent vehicle tracking system.
* `networkId` is optional and can be provided if the vehicle entity already exists.

**Example:**

```lua
exports['y_garage']:RegisterOwnedVehicle({
    plate = 'ABC123',
    owner = 'license:xxxxxxxx',
    ownerName = 'John Doe',
    mods = vehicleProperties,
    type = 'car'
})
```
