> ## Documentation Index
> Fetch the complete documentation index at: https://lationscripts.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Shops Creator - Exports - Server

> All exports available on the server

These server exports are a **read-only** integration surface for other resources (phones, banking, MDTs, tax or loan systems, dashboards). They never mutate shop state, so every money-safety guarantee stays owned by the resource. To **react** to shop activity, see [Events](/docs/shops-creator/events).

<Note>
  Every export returns a fresh copy of the data. Mutating a returned table never affects the resource.
</Note>

### **GetShop**

Returns the full shop record (fresh from the database), or `nil` if no shop with that id exists.

```lua theme={null}
local shop = exports.lation_shops:GetShop(shopId)
```

<ParamField path="shopId" type="string" required>
  The shop id to look up.
</ParamField>

The record includes fields such as `id`, `title`, `balance`, `ownerIdentifier`, `ownerName`, `forSale`, `salePrice` and an `inventory` array of listings.

### **GetAllShops**

Returns every shop keyed by id. This reads one row per shop plus its inventory, so use it for one-off discovery or enumeration rather than per-frame reads.

```lua theme={null}
local shops = exports.lation_shops:GetAllShops()
```

### **GetShopBalance**

Returns the shop's current balance as a number, or `nil` if no such shop exists.

```lua theme={null}
local balance = exports.lation_shops:GetShopBalance(shopId)
```

<ParamField path="shopId" type="string" required>
  The shop id to read the balance of.
</ParamField>

### **GetShopOwner**

Returns owner info for a shop, or `nil` if no such shop exists. `identifier` and `name` are `nil` when the shop is server-run or currently for sale.

```lua theme={null}
local owner = exports.lation_shops:GetShopOwner(shopId)
-- { identifier = "char1:abc...", name = "John Doe", forSale = false, salePrice = 50000 }
```

<ParamField path="shopId" type="string" required>
  The shop id to read ownership of.
</ParamField>

### **GetOwnedShops**

Returns an array of the full shop records owned by an identifier. Employees are excluded (ownership only). Empty if the identifier owns nothing.

```lua theme={null}
local owned = exports.lation_shops:GetOwnedShops(identifier)
```

<ParamField path="identifier" type="string" required>
  The player identifier to list owned shops for.
</ParamField>

### **IsShopEmployee**

Returns `true` only if the identifier is a hired employee of the shop. The owner is not counted as an employee, so check [GetShopOwner](#getshopowner) for ownership.

```lua theme={null}
local isEmployee = exports.lation_shops:IsShopEmployee(shopId, identifier)
```

<ParamField path="shopId" type="string" required>
  The shop id to check.
</ParamField>

<ParamField path="identifier" type="string" required>
  The player identifier to check.
</ParamField>

### **GetShopEmployees**

Returns an array of employee records for a shop (empty if none, or if no such shop exists). Each record includes `identifier`, `name`, `role`, `permissions` and commission info.

```lua theme={null}
local employees = exports.lation_shops:GetShopEmployees(shopId)
```

<ParamField path="shopId" type="string" required>
  The shop id to list employees for.
</ParamField>

### **GetShopStats**

Returns sales stats for a shop, or `nil` if no such shop exists. The stats are tenure-scoped to the current owner (they reset on every ownership change), matching what the owner sees on the management dashboard.

```lua theme={null}
local stats = exports.lation_shops:GetShopStats(shopId)
-- {
--   today, week, weekSellPayouts,
--   topSellers      = { ... },
--   dailyRevenue    = { ... },
--   dailySellPayouts = { ... },
--   dailyBalance    = { ... },
-- }
```

<ParamField path="shopId" type="string" required>
  The shop id to read stats for.
</ParamField>

<Note>
  Looking for an export we don't have listed here? Contact us and we'll do what we can!
</Note>
