Skip to content

Integrations

Core Business is designed to turn any property into a functional node for other scripts. Using the Closest Property API, external scripts can check stock, remove items, add items, register sales, and register expenses — all tied to the nearest business-owned property.

RAIDScore_gangs
DISPATCHcore_dispatch
INVENTORYcore_inventory
VEHICLE CUSTOMIZATIONcore_mechanic
GAS STATION PROPERTIESqb-fuel / ox_fuel
CLOTHING SHOP PROPERTIESillenium / qb-clothing
ATM PROPERTIESqb-banking / esx

How It Works

Every integration follows the same pattern:

  1. An external script (fuel, clothing, banking, etc.) fires on its normal event
  2. It calls Core Business exports with the player's coordinates
  3. Core Business finds the closest property and performs the operation
  4. The business that owns the property gets the income/expense logged in their transactions

This means any property location can become a fuel pump, clothing store, ATM, or anything else — without modifying Core Business itself.

Available Integration Scripts

We provide pre-built integration patches for popular scripts. These are lightweight wrappers that connect the external script to Core Business exports.

Coming Soon

Download links will be added as integration scripts are released. Check back for updates.

ScriptTypeDescriptionDownload
qb-fuelFuelGas station properties sell fuel from their stashComing soon
ox_fuelFuelGas station properties sell fuel from their stashComing soon
LegacyFuelFuelGas station properties sell fuel from their stashComing soon
illenium-appearanceClothingClothing store sales register as property incomeComing soon
qb-clothingClothingClothing store sales register as property incomeComing soon
qb-bankingBankingATM fees register as property incomeComing soon
esx_bankingBankingATM fees register as property incomeComing soon

Building Your Own Integration

Any script can integrate with Core Business using the server-side exports. Here are the exports you need:

Get Item Stock

serverexports['core_business']:closestPropertyItemCount(coords, itemName)

Returns the total count of an item across all storages of the closest property. Returns 1000.0 if no property is found (safe fallback so stock checks always pass when no property exists).

ParameterTypeDescription
coordsvector3World coordinates to find the closest property
itemNamestringItem name to check
Returns: number
Example
lua
local stock = exports['core_business']:closestPropertyItemCount(coords, 'fuel')

Remove Item

serverexports['core_business']:closestPropertyRemoveItem(coords, itemName, amount)

Removes an item from the closest property storage. Returns true if successful or if no property was found.

ParameterTypeDescription
coordsvector3World coordinates to find the closest property
itemNamestringItem name to remove
amountnumberAmount to remove
Returns: boolean
Example
lua
exports['core_business']:closestPropertyRemoveItem(coords, 'fuel', 10)

Add Item

serverexports['core_business']:closestPropertyAddItem(coords, itemName, amount)

Adds an item to the closest property storage.

ParameterTypeDescription
coordsvector3World coordinates to find the closest property
itemNamestringItem name to add
amountnumberAmount to add
Returns: boolean
Example
lua
exports['core_business']:closestPropertyAddItem(coords, 'repairkit', 5)

Register a Sale (Income)

serverexports['core_business']:closestPropertyRegisterSale(coords, money, description)

Adds income to the business that owns the closest property. The money is added to the business balance, logged as a transaction, and tracked in financial statistics.

ParameterTypeDescription
coordsvector3World coordinates to find the closest property
moneynumberAmount of money to register
descriptionstringTransaction description for the business log
Returns: boolean
Example
lua
exports['core_business']:closestPropertyRegisterSale(coords, 500, 'Fuel sale: 25L @ $20/L')

Register an Expense

serverexports['core_business']:closestPropertyRegisterExpense(coords, money, description)

Deducts money from the business that owns the closest property.

ParameterTypeDescription
coordsvector3World coordinates to find the closest property
moneynumberAmount of money to deduct
descriptionstringTransaction description for the business log
Returns: boolean
Example
lua
exports['core_business']:closestPropertyRegisterExpense(coords, 200, 'Fuel restock delivery')

Get Item Price

serverexports['core_business']:closestPropertyGetPrice(coords, itemName, mode)

Returns the market listing price for an item. Falls back to default market prices for unowned properties. Returns nil if no listing exists.

ParameterTypeDescription
coordsvector3World coordinates to find the closest property
itemNamestringItem name to check price for
modestringsell (property sells to player) or buy (property buys from player)
Returns: number|nil
Example
lua
local price = exports['core_business']:closestPropertyGetPrice(coords, 'fuel', 'sell')

Integration Examples

Fuel Station

Turn gas station properties into functional fuel pumps. When a player refuels, check stock, remove fuel, and register the sale:

lua
-- server-side fuel handler
local coords = GetEntityCoords(GetPlayerPed(source))

-- Check if this station has fuel
local stock = exports['core_business']:closestPropertyItemCount(coords, 'fuel')
if stock < fuelAmount then
    -- Station is out of fuel
    TriggerClientEvent('notify', source, 'This station is out of fuel')
    return
end

-- Get the price set by the property owner
local pricePerUnit = exports['core_business']:closestPropertyGetPrice(coords, 'fuel', 'sell')
if not pricePerUnit then pricePerUnit = 20 end -- fallback

local totalCost = pricePerUnit * fuelAmount

-- Remove fuel from property storage
exports['core_business']:closestPropertyRemoveItem(coords, 'fuel', fuelAmount)

-- Register the income to the business
exports['core_business']:closestPropertyRegisterSale(
    coords, totalCost, 'Fuel sale: ' .. fuelAmount .. 'L @ $' .. pricePerUnit .. '/L'
)

Clothing Store

Register outfit purchases as income for the property owner:

lua
-- server-side clothing purchase handler
local coords = GetEntityCoords(GetPlayerPed(source))

-- Register the sale
exports['core_business']:closestPropertyRegisterSale(
    coords, outfitPrice, 'Clothing purchase: ' .. outfitName
)

ATM Fees

Charge a transaction fee on ATM withdrawals, paid to the property owner:

lua
-- server-side ATM withdrawal handler
local coords = GetEntityCoords(GetPlayerPed(source))
local fee = math.floor(amount * 0.02) -- 2% fee

if fee > 0 then
    exports['core_business']:closestPropertyRegisterSale(
        coords, fee, 'ATM fee: 2% on $' .. amount
    )
end

Custom Shop (Any Script)

Any script that sells items at a location can check property stock and register sales:

lua
-- server-side shop purchase handler
local coords = GetEntityCoords(GetPlayerPed(source))
local item = 'repairkit'
local amount = 1

-- Check stock
local stock = exports['core_business']:closestPropertyItemCount(coords, item)
if stock < amount then
    TriggerClientEvent('notify', source, 'Out of stock')
    return
end

-- Get property owner's price
local price = exports['core_business']:closestPropertyGetPrice(coords, item, 'sell')
if not price then
    TriggerClientEvent('notify', source, 'Item not for sale here')
    return
end

-- Process the sale
exports['core_business']:closestPropertyRemoveItem(coords, item, amount)
exports['core_business']:closestPropertyRegisterSale(coords, price, 'Sold ' .. item .. ' x' .. amount)

-- Give item to player
-- (your framework's add item logic here)

Full Exports Reference

For the complete list of all client and server exports (data access, business management, and closest-property API), see the Exports & API page.