> For the complete documentation index, see [llms.txt](https://plexscripts.gitbook.io/plexscripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plexscripts.gitbook.io/plexscripts-documentation/economic-system/exports-server-side.md).

# Exports - Server side

{% hint style="info" %}
G**et current Price**
{% endhint %}

```lua
-- Single item
local price = exports['PS_Economic_system']:getCurrentPrice('copperore')
if price then
    print('Price for copperore:', price)
end

-- Multiple items
local prices = exports['PS_Economic_system']:getCurrentPrice({'copperore', 'ironore', 'goldore'})
for item, price in pairs(prices) do
    print('Price for ' .. item .. ': ' .. price)
end

Example: 

function GetPrice(item)

    local price = exports['PS_Economic_system']:getCurrentPrice(item)
    
    print("The current price of "..item.. "is "..price)
    
    return price 
end
```

{% hint style="info" %}
Get Stock
{% endhint %}

<pre class="language-lua"><code class="lang-lua">-- Single item
local stock = exports['PS_Economic_system']:GetStock('copperore')
if stock then
    print('Stock of copperore:', stock)
end

-- Multiple items
local stocks = exports['PS_Economic_system']:GetStock({'copperore', 'ironore'})
for item, amount in pairs(stocks) do
    print('Stock of ' .. item .. ': ' .. amount)
end

<strong>Example:
</strong>function GetStock(item)

    local stock = exports['PS_Economic_system']:GetStock('copperore')
    
    print("The current stock of "..item.. "is "..stock)
    
    return stock 
end
</code></pre>

{% hint style="info" %}
Add Stock
{% endhint %}

```lua
-- Single item
exports['PS_Economic_system']:AddStock({name = 'copperore', amount = 50})

-- Multiple items
exports['PS_Economic_system']:AddStock({
    {name = 'copperore', amount = 50},
    {name = 'ironore', amount = 25},
    {name = 'goldore', amount = 10}
})

Example:
function AddStock(item, amount)

    exports['PS_Economic_system']:AddStock({name = item, amount = amount})
    
    print("Added "..amount.." of "..item.."to the stock")

end
```

{% hint style="info" %}
Remove Stock
{% endhint %}

```lua
-- Single item
exports['PS_Economic_system']:RemoveStock({name = 'copperore', amount = 50})

-- Multiple items
exports['PS_Economic_system']:RemoveStock({
    {name = 'copperore', amount = 50},
    {name = 'ironore', amount = 25},
    {name = 'goldore', amount = 10}
})

Example:
function RemoveStock(item, amount)

    exports['PS_Economic_system']:RemoveStock({name = item, amount = amount})
    
    print("Removed "..amount.." of "..item.."from the stock")

end
```

{% hint style="info" %}
Record Sold Items
{% endhint %}

<pre class="language-lua"><code class="lang-lua">-- Single item
exports['PS_Economic_system']:SelledItem({
    name = 'copperore',
    amount = 50
})

-- Multiple items
exports['PS_Economic_system']:SelledItem({
    {name = 'copperore', amount = 50},
    {name = 'ironore', amount = 25},
    {name = 'goldore', amount = 10}
})

function ItemSelled(item, amount)

exports['PS_Economic_system']:SelledItem({name = item, amount = amount})
<strong>
</strong>end 
</code></pre>
