🎒 Inventory Management System

API Routes

GET /inventory

Retrieve inventory items. Use address, id, or type parameter:

Examples:

curl "https://jamiedubs-glifinventory.web.val.run/inventory?address=0x123456789abcdef"
curl "https://jamiedubs-glifinventory.web.val.run/inventory?id=item-uuid-here"
curl "https://jamiedubs-glifinventory.web.val.run/inventory?type=tool"

POST /add

Add a new item to a user's inventory

curl -X POST "https://jamiedubs-glifinventory.web.val.run/add" -H "Content-Type: application/json" -d '{
  "address": "0x123456789abcdef",
  "item": {
    "name": "Magic Sword",
    "image": "https://example.com/sword.png",
    "type": "tool",
    "description": "A powerful magical sword",
    "quantity": 1,
    "rarity": "legendary"
  }
}'

Note: The "image" field is optional. If not provided, a default image will be used.

POST /remove

Remove an item from a user's inventory

curl -X POST "https://jamiedubs-glifinventory.web.val.run/remove" -H "Content-Type: application/json" -d '{
  "address": "0x123456789abcdef",
  "itemId": "item-uuid-here",
  "quantity": 1
}'

POST /transfer

Transfer an item between users. If quantity is not specified, it defaults to 1.

curl -X POST "https://jamiedubs-glifinventory.web.val.run/transfer" -H "Content-Type: application/json" -d '{
  "fromAddress": "0x123456789abcdef",
  "toAddress": "0x987654321fedcba",
  "itemId": "item-uuid-here",
  "quantity": 1
}'

Item Types

Any string is allowed for item type (e.g., furniture, electronics, clothing, tool, misc)

Item Rarities

common, uncommon, rare, legendary

View source: Val Town