# Server side exports

**1. `exports('ToggleShop', function(shopId, disabled)`**

**Description**:\
This function is used to toggle the availability of a shop. By passing a `shopId` and a boolean `disabled` parameter, you can enable or disable a shop on your server.

* **Arguments**:
  * `shopId` (string): The unique identifier for the shop you want to enable or disable. Example: `'shop_1'`, `'shop_2'`.
  * `disabled` (boolean): A flag that determines whether the shop should be enabled or disabled:
    * `true` – disables the shop.
    * `false` – enables the shop.

```lua
exports['koja-shops']:ToggleShop('shop_1', true)   -- Disables shop with ID 'shop_1'
exports['koja-shops']:ToggleShop('shop_2', false)  -- Enables shop with ID 'shop_2'
```

***

**2. `exports('ToggleProduct', function(shopId, productId, disabled)`**

**Description**:\
This function is used to toggle the availability of a specific product within a shop. By passing a `shopId`, a `productId`, and a boolean `disabled` parameter, you can enable or disable specific products for sale in a shop.

* **Arguments**:
  * `shopId` (string): The unique identifier for the shop where the product is located (e.g., `'shop_1'`, `'shop_2'`).
  * `productId` (string): The unique identifier for the product you want to enable or disable (e.g., `'garden_shovel'`, `'fishing_rod'`).
  * `disabled` (boolean): A flag that determines whether the product should be enabled or disabled:
    * `true` – disables the product.
    * `false` – enables the product.

```lua
exports['koja-shops']:ToggleProduct('shop_1', 'garden_shovel', true)  -- Disables product 'garden_shovel' in 'shop_1'
exports['koja-shops']:ToggleProduct('shop_1', 'burger', false)       -- Enables product 'burger' in 'shop_1'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kojascripts.eu/new/shops/configuration/server-side-exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
