Inventoryintermediate10 min readupdated 11 Sept 2026

Configuring shops in ox_inventory

The short answer

A shop in data/shops.lua has a name, optional blip, an inventory list and either locations (with markers) or targets (for ox_target). Items take name and price, plus optional count (stock), currency (for example black_money), license, grade and metadata. Restrict a whole shop with groups. From your own resource use exports.ox_inventory:RegisterShop(type, details) and open it with openInventory('shop', { type = type, id = 1 }).

Every general store, pharmacy, hardware shop and armoury in an ox_inventory server is a shop definition. The same small set of fields covers them all — plus an export for shops your own resources create, like player-owned businesses.

Configuring shops in ox_inventory — illustrated with a FiveM-compatible minimap render

#A shop definition

ox_inventory/data/shops.lua
Hardware = {
    name = 'Hardware Store',
    blip = { id = 402, colour = 69, scale = 0.8 },
    inventory = {
        { name = 'lockpick', price = 250 },
        { name = 'repairkit', price = 600, count = 20 },
        { name = 'WEAPON_HAMMER', price = 150 },
    },
    locations = {
        vec3(2748.0, 3473.0, 55.67),
    },
    targets = {
        { loc = vec3(2747.8, 3472.9, 55.67), length = 1.0, width = 3.0, heading = 65.0, minZ = 55.0, maxZ = 56.8, distance = 3.0 },
    },
},

#Item fields

FieldMeaning
nameItem name from items.lua or weapons.lua
priceCost per item
countLimited stock (omit for unlimited)
currencyItem used to pay, for example black_money
licenseLicence required to buy
gradeMinimum job grade (with shop groups)
metadataMetadata given with the item, for example { registered = true }

Weapon-specific setups (legal store, police armoury, black market) are in weapon shop setup.

#Shops at runtime

server.lua — a player-owned café
exports.ox_inventory:RegisterShop('BeanMachine', {
    name = 'Bean Machine',
    inventory = {
        { name = 'coffee', price = 12 },
        { name = 'donut', price = 8 },
    },
    locations = { vec3(-634.3, 235.2, 81.9) },
    groups = nil,
})
client.lua — open from a script
exports.ox_inventory:openInventory('shop', { type = 'BeanMachine', id = 1 })

id is the index of the location in the shop’s locations/targets list.

#Logging and controlling purchases

server.lua
exports.ox_inventory:registerHook('buyItem', function(payload)
    print(('%s bought %sx %s for %s'):format(payload.source, payload.count, payload.itemName, payload.totalPrice))
end, { typeFilter = { Hardware = true } })

Return false from the hook to cancel a purchase. More: ox_inventory hooks.

Share this guideXRedditFacebook

Questions

How do I add a shop to ox_inventory?
Add an entry to data/shops.lua with a name, inventory and locations or targets, or call exports.ox_inventory:RegisterShop from your resource.
How do I make a shop accept dirty money?
Set currency = 'black_money' on the items.
How do I limit stock?
Give the item a count.
How do I open a shop from a script?
exports.ox_inventory:openInventory('shop', { type = 'ShopType', id = 1 }) on the client.

Ready to pick a map?

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

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.

Look it up while you work

The reference tables this guide leans on, free and without an account.

  • All 966 blip sprite idsThe number SetBlipSprite takes, with the texture name beside it. Searchable, and one click copies a value.