> For the complete documentation index, see [llms.txt](https://docs.easy.gg/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.easy.gg/scripting/bedwars-scripting/services/shopservice.md).

# ShopService

Example usage:

<pre class="language-lua"><code class="lang-lua"><strong>Events.MatchStart(function(event)
</strong>    -- Adds 1 Solar Panel to the shop that can be purchased for 3 Diamonds
    ShopService.addItem(ItemType.SOLAR_PANEL, 1, ItemType.DIAMOND, 3)
    -- Adds 1 Tennis Racket to the shop that can be purchased for 15 Iron
    ShopService.addItem(ItemType.TENNIS_RACKET, 1, ItemType.IRON, 15)
end)
</code></pre>

### Functions

**getAllShopkeeperIds(): string\[]**

Returns all current shopkeepers (by ID) in the game.

**spawnShopkeeper(shopType:** "items" **|** "upgrade"**, position:** [**Vector3**](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)**): string**

Creates an item shopkeeper or upgrade shopkeeper at the given position. Returns the ID (string) of the created shop.

**despawnShopkeeper(shopId: string)**

Deletes the shopkeeper with the given ID (string).

#### addItem(item: [ItemType](/scripting/bedwars-scripting/types/itemtype.md), amount: number, costItem: [ItemType](/scripting/bedwars-scripting/types/itemtype.md), price: number)

Adds an item to the shop for all players.

* amount - The amount of the item received when purchased
* costItem - The type of item needed to purchase the specified item
* price - The amount of the cost item needed to purchase the specified item

#### removeItem(item: [ItemType](/scripting/bedwars-scripting/types/itemtype.md))

Removes the item from the shop for all players.
