Grant an item to a player

To grant an item to a player, simply POST to /items, providing the new owner's playerId. If metadata is not provided, the default metadata configured on the item type will be used.

curl --location 'http://127.0.0.1:8080/v1/items' \
--header 'x-mythical-environment-id: 09fcc2a5-5204-44ef-a796-aca631c1f98a' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode '%7B%20%22itemTypeId%22%3A%20%22ef03f736-5eeb-483d-8eac-1d8f0872260e%22%2C%20%22ownerPlayerId%22%3A%20%22c18bd0c3-06ca-4004-a777-cac4fcd4842b%22%20%7D='

Granting an item means that an NFT will be minted from the defined collection to the players wallet on-chain. This is an asynchronous operation which can take several seconds. It’s handled differently by different apps:

  • In-game ownership is optimistic, meaning ownership is immediately reflected in the platform API. This ensures the player has a fast and seamless experience in-game.

  • Mythical Marketplace ownership is not optimistic, meaning ownership is reflected in marketplace inventory once the mint transaction finalizes on-chain, which can take several seconds. This ensures the player has a fault proof experience in the Mythical Marketplace.

Last updated