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

# Exports

<h2 align="center">Server</h2>

## registerStore

Dynamically creates a store at runtime, syncing to all clients for use straight away, when the resource that creates it is stopped the store will be deleted and unregistered from all clients.\
\
The `storeData` parameter is based upon the [StoreProps](/dirkscripts-documentation/resources/stores/types/store.md).

#### Example

This will spawn a very basic shop with a store clerk at the coordinates listed.

{% code fullWidth="true" %}

```lua
local storeData = {
    id = 'myNewTestStore', 
    type = 'buy', 
    name = 'My Test Store', 
    description = 'My Short Test Description', 
    icon        = 'fas fa-store', 
    modelType   = 'ped', 
    models      = {'mp_m_shopkeep_01'}, 
    locations   = {
        vector4(0,0,0,0),
    },
    paymentMethods = {'cash', 'bank'}, 
    stock = {
        {
          name = 'bread',  
          price = 100, 
        }
    },
}

exports.dirk_stores:registerStore(storeData)
```

{% endcode %}
