Retrieve inventory items. Use address, id, or type parameter:
?address=USER_ADDRESS
- Retrieve a user's entire inventory?id=ITEM_ID
- Retrieve a specific item by its ID?type=ITEM_TYPE
- Retrieve all items of a specific typeExamples:
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"
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.
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
}'
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
}'
Any string is allowed for item type (e.g., furniture, electronics, clothing, tool, misc)
common, uncommon, rare, legendary
View source: Val Town