Mythical Platform
Mythical Platform
  • The Mythical Platform API
  • Quick start
    • Authenticate
    • Create a guest player
    • Create an item type
    • Grant an item to a player
    • Update item metadata
    • Use webhooks for real time messages
    • Buy a listed item
  • API Reference
    • Players
    • Item Types
    • Items
    • Marketplace
      • Listings
      • Offers
      • Quick trade
      • Transaction history
      • Exchange rate
    • Webhook management
    • System
Powered by GitBook
On this page
  1. Quick start

Update item metadata

Item metadata is linked to the item on-chain via a metadata URL. The metadata itself is stored off-chain. This means item metadata can be updated quickly and often, since it doesn’t require an on-chain transaction to do so.

// Construct the updates you'd like to make
// Note: Metadata must be fully replaced with each update
const itemUpdates = {
  "metadata": {
    "name": "itemName",
    "description": "itemDescription",
    "image": "http://url.com/image",
    "attributes": [
      {
        "type": "attribute1",
        "value": 20,
        "displayType": "number",
        "maxValue": 100
      },
      {
        "type": "attribute2",
        "value": "value",
        "displayType": "string"
      }
    ]
  }
}

// Update the item
const response = await fetch('/v1/item-types/{itemTypeId}', {
    method: 'PUT',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify(itemUpdates),
});

const data = await response.json();
PreviousGrant an item to a playerNextUse webhooks for real time messages

Last updated 6 months ago