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. API Reference

Item Types

PreviousPlayersNextItems

Last updated 9 months ago

Get an item type by item type id

get

Retrieve a single item type by id.

Authorizations
Path parameters
itemTypeIdstringRequired
Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

Responses
200
Success
application/json
get
GET /v1/item-types/{itemTypeId} HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
200

Success

{
  "id": "f4e5d3a4-2a9b-4d9f-bc5a-73b3f0c47b5e",
  "state": "pending",
  "collectionName": "collectionName",
  "maxSupply": 1000,
  "issuedSupply": 0,
  "circulatingSupply": 0,
  "mintMode": "serial",
  "defaultMetadata": {
    "name": "itemName",
    "description": "itemDescription",
    "image": "http://url.com/image",
    "attributes": [
      {
        "type": "attribute_name_1",
        "value": "",
        "displayType": "number",
        "maxValue": 100
      },
      {
        "type": "attribute_name_2",
        "value": "",
        "displayType": "string"
      }
    ]
  }
}
  • POSTCreate an item type
  • POSTSearch item types
  • GETGet an item type by item type id
  • PUTUpdate an item type

Create an item type

post

Creating an item type means a collection will be deployed on-chain, from which items (NFTs) are minted when using the POST /items endpoint. An item type requires valid default metadata in order to be deployed.

Authorizations
Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

x-idempotency-keystring · max: 64Required

A unique identifier for the request. If the request is repeated with the same idempotency key, the response will be the same as the first request. Recommend using a UUID or ULID

Body
collectionNamestringRequired

The name of the collection on-chain. This is a unique identifier which helps ensure you're looking at the right asset on the block explorer. It's not displayed in the Mythical Marketplace. This is immutable.

maxSupplyintegerRequired

The maximum quantity of the item which can be granted.

mintModestring · enumRequired

Describes how the tokenId is chosen when new items are minted.

  • serial: Each consecutive tokenId is incremented from the previous.
  • random: Each consecutive tokenId is a random number between 1 and the maxSupply.
  • controlled: The tokenId is input by the studio when the item is minted.
Possible values:
Responses
200
Success
application/json
post
POST /v1/item-types HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
x-idempotency-key: text
Content-Type: application/json
Accept: */*
Content-Length: 322

{
  "collectionName": "collectionName",
  "maxSupply": 1000,
  "mintMode": "serial",
  "defaultMetadata": {
    "name": "itemName",
    "description": "itemDescription",
    "image": "http://url.com/image",
    "attributes": [
      {
        "type": "attribute1",
        "value": "10",
        "displayType": "number",
        "maxValue": 100
      },
      {
        "type": "attribute2",
        "value": "value",
        "displayType": "string"
      }
    ]
  }
}
200

Success

{
  "id": "f4e5d3a4-2a9b-4d9f-bc5a-73b3f0c47b5e",
  "state": "pending",
  "collectionName": "collectionName",
  "maxSupply": 1000,
  "issuedSupply": 0,
  "circulatingSupply": 0,
  "mintMode": "serial",
  "defaultMetadata": {
    "name": "itemName",
    "description": "itemDescription",
    "image": "http://url.com/image",
    "attributes": [
      {
        "type": "attribute_name_1",
        "value": "",
        "displayType": "number",
        "maxValue": 100
      },
      {
        "type": "attribute_name_2",
        "value": "",
        "displayType": "string"
      }
    ]
  }
}

Search item types

post

Retrieve a list of item types. Supports filtering, sorting, and pagination.

Authorizations
Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

Body
idsstring[]Optional

An array of items type ids to search for.

collectionNamesstring · string[]Optional

An array of collection names to find the matching item types for

statesstring · string[]Optional

The current blockchain state of the item type(s) that you are searching for

limitintegerOptional

The maximum number of items you would like returned in this search

Example: 10
skipintegerOptional

How many records should be skipped in the result set before returning results?

Example: 10
Responses
200
Success
application/json
post
POST /v1/item-types/search HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "mintModes": [
    "serial"
  ],
  "limit": 100,
  "skip": 0
}
200

Success

[
  {
    "id": "f4e5d3a4-2a9b-4d9f-bc5a-73b3f0c47b5e",
    "state": "pending",
    "collectionName": "collectionName",
    "maxSupply": 1000,
    "issuedSupply": 0,
    "circulatingSupply": 0,
    "mintMode": "serial",
    "defaultMetadata": {
      "name": "itemName",
      "description": "itemDescription",
      "image": "http://url.com/image",
      "attributes": [
        {
          "type": "attribute_name_1",
          "value": "",
          "displayType": "number",
          "maxValue": 100
        },
        {
          "type": "attribute_name_2",
          "value": "",
          "displayType": "string"
        }
      ]
    }
  }
]

Update an item type

put

Update the mutable attributes of an item type.

Authorizations
Path parameters
itemTypeIdstringRequired
Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

Body
Responses
200
Success
application/json
404
Item type not found
application/json
put
PUT /v1/item-types/{itemTypeId} HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 186

{
  "defaultMetadata": {
    "name": "text",
    "description": "text",
    "image": "text",
    "attributes": [
      {
        "type": "attributeName",
        "value": "attrValue",
        "displayType": "number, boolean, string",
        "maxValue": 255
      }
    ]
  }
}
{
  "id": "f4e5d3a4-2a9b-4d9f-bc5a-73b3f0c47b5e",
  "state": "pending",
  "collectionName": "collectionName",
  "maxSupply": 1000,
  "issuedSupply": 0,
  "circulatingSupply": 0,
  "mintMode": "serial",
  "defaultMetadata": {
    "name": "itemName",
    "description": "itemDescription",
    "image": "http://url.com/image",
    "attributes": [
      {
        "type": "attribute_name_1",
        "value": "",
        "displayType": "number",
        "maxValue": 100
      },
      {
        "type": "attribute_name_2",
        "value": "",
        "displayType": "string"
      }
    ]
  }
}