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
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