# OX / QB Migration Examples

# OX / QB Migration Examples

Common compatibility patterns when moving an integration to Nord Inventory.

**Applies to:** `Nord Inventory v2.0.0`

### Count

```lua
local count = exports.nord_inventory:GetItemCount(source, 'water')
```

### Add/remove

```lua
if exports.nord_inventory:CanCarryItem(source, 'water', 2) then
    exports.nord_inventory:AddItem(source, 'water', 2)
end
exports.nord_inventory:RemoveItem(source, 'water', 1)
```

### Search a slot

```lua
local slot = exports.nord_inventory:GetSlotWithItem(source, 'water')
```

### Canonicalize a legacy name

```lua
local item = exports.nord_inventory:ResolveItemName(legacyName)
```

Migrate behavior at the public export boundary. Avoid emulating another inventory's private events/database tables inside Nord.
