Inventoryintermediate10 min readupdated 11 Sept 2026

Working with item metadata in ox_inventory

The short answer

Pass metadata when creating an item — exports.ox_inventory:AddItem(src, 'id_card', 1, { name = 'John Doe' }) — and change it later with SetMetadata(inv, slot, metadata). Built-in keys include durability, serial, registered, ammo, components, label, description, image and weight. Show your own keys in the tooltip with displayMetadata on the client, and fill metadata automatically with a createItem hook.

Metadata is what makes two items with the same name different: this pistol’s serial, that phone’s number, a letter’s text, a bottle half full. In ox_inventory it is a Lua table stored with each item stack, and a few keys have built-in meaning.

Working with item metadata in ox_inventory — illustrated with a FiveM-compatible minimap render

#Keys with built-in meaning

KeyEffect
durability0–100 condition; also used by degrading items and weapons
serialWeapon serial number
registeredRegistered owner for weapons (false = no serial)
ammoLoaded ammo in a weapon
componentsAttachments on a weapon
labelCustom display name for this stack
descriptionCustom tooltip text
imageCustom image for this stack
weightExtra weight for this stack

#Adding and changing metadata

server.lua
-- create with metadata
exports.ox_inventory:AddItem(src, 'id_card', 1, {
    label = 'ID — John Doe',
    description = 'DOB 1994-03-12',
    citizenid = 'ABC12345',
})

-- change an existing stack
local slot = exports.ox_inventory:GetSlotWithItem(src, 'water')
if slot then
    local meta = slot.metadata
    meta.durability = 50
    exports.ox_inventory:SetMetadata(src, slot.slot, meta)
end

#Showing custom metadata

client.lua
exports.ox_inventory:displayMetadata({
    citizenid = 'Citizen ID',
    plate = 'Plate',
})

Now any item with those keys shows them in its tooltip with your labels.

#Setting metadata automatically

server.lua — stamp every new ID card
exports.ox_inventory:registerHook('createItem', function(payload)
    local meta = payload.metadata
    meta.issued = os.date('%Y-%m-%d')
    return meta
end, { itemFilter = { id_card = true } })

A createItem hook may return a table, which becomes the item’s metadata. Weapon serials use the same system — see serial numbers.

Share this guideXRedditFacebook

Questions

What is metadata in ox_inventory?
A table of extra data stored with each item stack, such as durability, serial or custom fields.
How do I give an item a custom name?
Set label in its metadata when you add it.
Why do my items not stack?
Stacks with different metadata stay separate.
How do I show custom metadata in the tooltip?
Call exports.ox_inventory:displayMetadata({ key = 'Label' }) on the client.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.

Relevant to what you just read

The tool for this

Twenty theme pairs for ox_lib and ox_inventory From $15, built in the browser, exported as a drop-in resource.