Skip to main content

Overview

The catalog system manages in-game assets including clothing, models, and other items. Users can browse, purchase, and manage assets.

Browse Catalog

Retrieve paginated catalog listings.

Request

GET /catalog?page={page}
page
number
default:"1"
Page number for pagination

Response

Returns an array of catalog assets.
assets
array
Array of asset objects:
  • id: Asset ID
  • name: Asset name
  • price: Asset price in currency
pages
number
Total number of pages
Source: Site/src/routes/(main)/catalog/+page.server.ts:11-21

Search Catalog

Search for assets by name or other criteria.

Request

GET /catalog/search?q={query}&p={page}
q
string
required
Search query string
p
number
default:"1"
Page number (minimum 1)

Response

Returns JSON array of matching assets.
[
  {
    "id": 123,
    "name": "Cool Hat",
    "price": 100
  }
]
id
number
Asset ID
name
string
Asset name
price
number
Asset price
Source: Site/src/routes/(main)/catalog/search/+server.ts:6-13

Get Asset Details

Retrieve detailed information about a specific catalog asset.

Request

GET /catalog/{id}/{name}
id
number
required
Asset ID
name
string
required
URL-encoded asset name (for SEO-friendly URLs)
Valid session cookie

Response

id
string
Asset record ID
name
string
Asset name
slug
string
URL-safe encoded name
type
number
Asset type ID:
  • 8: Model
  • 11: Clothing (Shirt)
  • 12: Clothing (Pants)
  • Other types as configured
description
object
Asset description
  • text: Description content
  • updated: Last update timestamp
creator
BasicUser
Asset creator information
isCreator
boolean
Whether current user is the creator
created
Date
Creation timestamp
forSale
boolean
Whether asset is available for purchase
price
number
Asset price in currency
sold
number
Number of times sold
owned
boolean
Whether current user owns this asset
visibility
string
Asset visibility status:
  • “Visible”: Approved and public
  • “Moderated”: Moderated/hidden
  • Other states as configured
comments
array
Array of comments on this asset
balance
number
Current user’s currency balance
currentFee
number
Transaction fee percentage

Errors

  • 404 Not Found: Asset doesn’t exist
  • 302 Redirect: Name mismatch (redirects to correct URL with slug)
  • 500 Internal Server Error: Economy service connection failed
Source: Site/src/routes/(main)/catalog/[id=asset]/[name]/+page.server.ts:57-82

Purchase Asset

Buy a catalog asset.

Request

POST /catalog/{id}/{name}?/buy
Content-Type: application/x-www-form-urlencoded
id
number
required
Asset ID to purchase
name
string
required
Asset name
Valid session cookie

Response

Returns empty response on success. Creates ownership relationship and processes payment.

Implementation Details

  1. Validates asset exists and is for sale
  2. Checks user doesn’t already own the asset
  3. Verifies asset visibility is “Visible”
  4. Processes currency transaction (if price > 0)
  5. Creates ownsAsset relationship in database
  6. Sends purchase notification to creator

Errors

  • 404 Not Found: Asset doesn’t exist
  • 400 Bad Request:
    • “You already own this item”
    • “This item hasn’t been approved yet” (visibility not “Visible”)
    • “This item is not for sale”
    • Insufficient funds (from economy service)
Source: Site/src/routes/(main)/catalog/[id=asset]/[name]/+page.server.ts:163-217

Comment on Asset

Post a comment on a catalog asset.

Request

POST /catalog/{id}/{name}?/comment
Content-Type: application/x-www-form-urlencoded
id
number
required
Asset ID
content
string
required
Comment text (1-1000 characters)
replyId
string
Optional comment ID to reply to
Valid session cookie

Response

Returns empty response on success.

Rate Limiting

Limited to 5 comments per IP address within the rate limit window.

Implementation Details

  1. Validates comment content
  2. Filters comment through content filter
  3. Creates comment record
  4. Sends notification to asset creator (if different from commenter)

Validation Errors

content
string
“Comment must have content” - Empty or whitespace-only content

Errors

  • 404 Not Found: Asset doesn’t exist
  • 429 Too Many Requests: Rate limit exceeded
Source: Site/src/routes/(main)/catalog/[id=asset]/[name]/+page.server.ts:123-162

Rerender Asset (Admin)

Request a re-render of an asset’s thumbnail. Requires administrator privileges.

Request

POST /catalog/{id}/{name}?/rerender
Content-Type: application/x-www-form-urlencoded
id
number
required
Asset ID to rerender
Valid session cookie with permission level 5

Response

icon
string
URL to updated icon with cache-busting parameter

Supported Asset Types

Only works for:
  • Type 8: Models
  • Type 11: Clothing (Shirt)
  • Type 12: Clothing (Pants)

Errors

  • 403 Forbidden: Insufficient permissions
  • 400 Bad Request:
    • “Can’t rerender a moderated asset”
    • “Can’t rerender this type of asset” (unsupported type)
  • 404 Not Found: Asset doesn’t exist
  • 500 Internal Server Error: “Failed to request render”
Source: Site/src/routes/(main)/catalog/[id=asset]/[name]/+page.server.ts:94-121

Asset Management

Asset settings and management endpoints for asset creators.

Get Asset Settings

GET /catalog/{id}/{name}/settings
Returns asset configuration page. Requires user to be asset creator or have permission level 4+.

Update Asset Settings

Various settings endpoints similar to place settings. Asset creators can update:
  • Name and description
  • Pricing and sale status
  • Visibility settings
  • Asset file/data
Implementation details follow similar patterns to place settings endpoints.

Notes

Currency System

Asset purchases integrate with the Mercury economy service:
  • Transaction fee is applied to purchases
  • Funds are transferred from buyer to creator
  • Transaction history is logged
  • Balance checks prevent overspending

Content Filtering

All user-submitted text (descriptions, comments) passes through a content filter before storage.

Asset Types

Asset types determine rendering behavior and usage:
  • Models (8): 3D models that can be placed in games
  • Clothing (11, 12): Wearable items for avatars
  • Additional types may be configured per instance

Build docs developers (and LLMs) love