Store API

The Store API provides a powerful interface for managing server-specific stores with customizable items, categories, and reward systems.

✨ Features

  • Per-server stores β€” Each guild has its own store

  • Multiple categories β€” Pets, roles, boosters, titles, items, special

  • Reward types β€” Pets, roles, boosters, titles, items, custom

  • Requirements β€” Level and prestige requirements

  • Stock management β€” Limited or unlimited stock

  • Purchase limits β€” Max purchases per user

  • Transaction logging β€” Full purchase history

πŸš€ Quick Start

The Store API is available globally as global.storeAPI β€” no require needed.

πŸ“¦ Methods Reference

addItem(guildId, itemData)

Add a new item to the store.

removeItem(guildId, itemId)

Remove an item from the store.

updateItem(guildId, itemId, updates)

Update an existing item.

getItem(guildId, itemId)

Get a single item by ID.

getItems(guildId, category?)

Get all items, optionally filtered by category.

getCategories(guildId)

Get all categories that have items.

getFeaturedItems(guildId)

Get all featured items.

purchaseItem(guildId, userId, itemId, client?)

Process a purchase. Handles balance deduction, requirements validation, stock management, and reward application.

The client parameter is optional β€” if not provided, the API uses the client from its context.

Possible errors:

  • Item not found

  • Item out of stock

  • User not found

  • Insufficient funds

  • Requires level X

  • Requires prestige X

  • Purchase limit reached

  • You already own this pet!

getUserPurchases(guildId, userId)

Get a user's purchase history.

🎁 Reward Types

pet

Adds a pet to the user's collection.

role

Grants a Discord role to the user.

booster

Activates a temporary multiplier booster.

title

Unlocks a display title for the user.

item

Adds a generic item to user's inventory.

custom

For addon-handled rewards. The reward isn't automatically applied.

πŸ“ Categories

Category
Description

pets

Virtual companions with bonuses

roles

Discord roles (temporary or permanent)

boosters

Temporary multiplier effects

titles

Display titles for users

items

Generic inventory items

special

Limited edition or seasonal items

πŸ’‘ Addon Examples

Adding Custom Shop Items

Seasonal/Limited Items

Dynamic Pricing

Purchase Announcements

πŸ“Š Item Schema

Full item object structure:

πŸ“‹ Purchase Record Schema

Last updated