Obsi Inventory keeps the whole ox_inventory API, so existing scripts work unchanged.
This page lists what Obsi adds on top: exports, events, keybinds, database tables and locale keys.

:::hint{type="info" title="Upstream API"}
Every ox_inventory export, event, callback and hook works as documented upstream.
The resource name is `ox_inventory`, and the manifest `version` stays `2.48.0` so version checks in other resources pass; the Obsi release number is `obsi_version`.
:::

## Server exports

### IsSlotLocked

Whether a slot of a player's inventory is locked because no backpack opens it.

```lua
local locked = exports.ox_inventory:IsSlotLocked(source, 30)
```

### getClothing

What a player wears, from the hidden clothing inventory.

```lua
local clothing = exports.ox_inventory:getClothing(source)
```

## Client exports

| Export | What it does |
| --- | --- |
| `throwItem(slot)` | Starts throwing the item in that slot |
| `fastAction(id, data)` | Runs a fast action: `handsup`, `undress`, `hanger`, `trade`, `give` |
| `requestTrade(serverId?, slot?)` | Sends a trade request, optionally offering a slot |
| `getStatus()` | Health, armour, hunger and thirst as shown in the inventory |
| `getClothingState()` | The worn clothing slots |

```lua
-- open a trade with the closest player, offering slot 3
exports.ox_inventory:requestTrade(nil, 3)
```

## Item metadata

| Key | Set by |
| --- | --- |
| `metadata.rarity` | Overrides the item's rarity |
| `metadata.serial` | Unique items |
| `metadata.label`, `metadata.description` | Rename and describe |
| `metadata.armor` | Remaining armour of a plate |
| `metadata.plates` | Plates in a plate carrier |
| `metadata.kind`, `id`, `drawable`, `texture`, `gender`, `category`, `imageurl` | The generic `clothing` item |

## Hooks and history

The upstream hooks (`swapItems`, `createItem`, `buyItem`, `craftItem` and the rest) fire for Obsi features too.
Trades run `swapItems` for every stack; a hook that returns `false` cancels the whole trade.

## Keybinds and commands

| Name | Default | What it does |
| --- | --- | --- |
| `/invadmin [page]` | | Opens the admin panel (`admin.command`) |
| `obsi_invadmin` | none | Optional key for the admin panel (`admin.key`) |
| `obsi_throw_weapon` | `MOUSE_MIDDLE` | Hold to throw the held weapon |
| `obsi_trade_accept` | `Y` | Accept a trade request |
| `obsi_trade_decline` | `N` | Decline a trade request |

Players rebind them in **Settings → Key Bindings → FiveM**.

## ox_target options

When `inventory:target` is off and `ox_target` runs, Obsi registers these options:
`obsi_drop_<id>`, `obsi_dumpster`, `obsi_trunk`, `obsi_evidence` and `obsi_stash_<id>`.

## Database tables

All tables are created on start with `CREATE TABLE IF NOT EXISTS`.

| Table | Holds |
| --- | --- |
| `obsi_inv_items` | Items created or edited in the panel |
| `obsi_inv_rarities` | Edited rarities |
| `obsi_inv_shops` | Shops from the panel |
| `obsi_inv_stashes` | Stashes from the panel |
| `obsi_inv_crafting` | Crafting benches from the panel |
| `obsi_inv_roles` | Admin roles |
| `obsi_inv_staff` | Staff added in the panel |
| `obsi_inv_locales` | Edited strings per language |
| `obsi_inv_settings` | Addon switches and other panel settings |
| `obsi_inv_history` | Inventory history |
| `obsi_inv_security` | Security reports |
| `obsi_inv_attachment_offsets` | Attachment anchor offsets per weapon and component |

Worn clothing (`obsi_clothes:<identifier>`) and mini stashes (`obsi_mini_<serial>`) are stored through the normal stash storage.

## Locales

Strings live in `locales/<lang>.json` as flat `{ "key": "text" }` files.
English is the fallback; English and Polish contain every key.
Edits made on the admin **Locales** page are stored in `obsi_inv_locales` and win over the files.

To translate into another language, export English from the Locales page, translate it, and import it under your language.
