> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aps-store.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Cards & Webcam

Documents are inventory items in credit-card format (ID-1, 85.6 × 54 mm) with the holder's photo. The photo is taken with the webcam on top of the PC's monitor while ordering in the Document Office.

## Setup

1.

Install [MugShotBase64](https://github.com/BaziForYou/MugShotBase64) and `ensure MugShotBase64` **before** `aps_cityhall`. Without it the webcam stays on the monitor but *Take photo* is disabled. 2.

Add the document items to your inventory (below). 3.

Players pass the theory test in the [License Center](https://docs.aps-store.com/assets/aps_cityhall/guides/license-center.md), then order the license card in the [Document Office](https://docs.aps-store.com/assets/aps_cityhall/guides/document-office.md) — the order dialog takes the photo (the webcam LED lights up and the screen flashes).

```lua theme={null}
-- config/documents.lua
Config.DocumentSystem.photo = {
    required    = true,    -- documents with a photo can only be ordered with one
    transparent = false,   -- photo without background (slower)
}

{
    id = 'driving_license', item = 'driving_license', prefix = 'DL-', template = 'card',
    requiresLicense = 'car',   -- only after passing the Driving License theory test
    fields = { 'firstName', 'lastName', 'dateOfBirth', 'sex' },
    -- photo = false          -- a document without photo
    …
},
```

License documents included: Driving, Motorcycle, Truck, Boat, Pilot (each needs its theory test) and the CCW Permit (needs the Firearms test). If a license is revoked, every copy of its card shows **REVOKED**.

## Items

**ESX inventory:** run `sql/items_esx.sql`.

**ox\_inventory** (`ox_inventory/data/items.lua`) — the export makes the item usable, `consume = 0` keeps it, the icon is shipped with City Hall:

```lua theme={null}
['driving_license'] = {
    label = 'Driving License', weight = 10, stack = false, close = true, consume = 0,
    server = { export = 'aps_cityhall.useDocument' },
    client = { image = 'nui://aps_cityhall/web/items/driving_license.svg' },
},
-- same for id_card, license_motorcycle, license_truck, license_boat, license_pilot,
-- weapons_license, police_badge, law_license, health_card
['business_certificate'] = { label = 'Business Certificate', weight = 10, stack = false,
    client = { image = 'nui://aps_cityhall/web/items/business_certificate.svg' } },
['hacking_usb'] = { label = 'Hacking USB', weight = 50,
    client = { image = 'nui://aps_cityhall/web/items/hacking_usb.svg' } },
```

Icons for every City Hall item are in `aps_cityhall/web/items/` (SVG). Inventories that only read PNG files from their own folder need the icons converted to PNG and copied there.

**qb-inventory** (`qb-core/shared/items.lua`):

```lua theme={null}
driving_license = { name = 'driving_license', label = 'Driving License', weight = 10, type = 'item',
                    image = 'driver_license.png', unique = true, useable = true, shouldClose = true,
                    description = 'A driving license' },
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.