Item Types
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.
Identifier for the environment that this request should interact with
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
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.
The maximum quantity of the item which can be granted.
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.
- selected: The tokenId is input by the studio when the item is minted.
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"
}
]
}
}
{
"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"
}
]
}
}
Retrieve a list of item types. Supports filtering, sorting, and pagination.
Identifier for the environment that this request should interact with
An array of items type ids to search for.
An array of collection names to find the matching item types for
The current blockchain state of the item type(s) that you are searching for
The maximum number of items you would like returned in this search
10
How many records should be skipped in the result set before returning results?
10
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
}
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"
}
]
}
}
]
Retrieve a single item type by id.
Identifier for the environment that this request should interact with
GET /v1/item-types/{itemTypeId} HTTP/1.1
Host:
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
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 the mutable attributes of an item type.
Identifier for the environment that this request should interact with
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"
}
]
}
}
Last updated