NFT minting endpoints
Glossary
Prerequisites
Steps to mint an NFT
1. Create a smart contract
DEPRECATED - Endpoint to get the list of nfts related to Smart Contract
Smart Contract Id to look for
Locales used to translate the current entity. Using the Locale HTTP header should be preferred. The HTTP header version is used in priority if it is given
["en"]Successfully retrieved list of nft's (simple paginationMode enabled)
Successfully retrieved list of nft's (simple paginationMode enabled)
Payload to create a SmartContract
Name of the SmartContract, will be public
SmartContract nameSymbol of the SmartContract, will be public
SYMBOLNAMESuccessfully created a SmartContract
Successfully created a SmartContract
2. Create a collection
Only the smartContractId, maxSupply and attributeValues are required, the attributeValues can be empty.
The values provided are sanitized to ensure they are valid. For example the value for an url will be checked to ensure it is a well-formed url, starting with https. If the value seems invalid, an error is returned.
The partnerId, name, description, animationUrl and externalUrl are stored as
CollectibleAttributeValues.
CollectibleDefinition summary
The most significant information about the CollectibleDefinition are shown in the summary property.
Here we find the CollectibleAttributeValues of importance, like the name, description, imageUrl,
animationUrl, externalUrl, backgroundColor, supply and partnerId. If the CollectibleDefinition has no
value set for those attributes, they won't show up in the summary.
Alongside these CollectibleAttributeValues, we find other important properties, like the maxSupply and
metadataUrl
If a CollectibleAttributeValue shows up in the summary, it is hidden from the list of attributeValues found
below in the response.
The CollectibleDefinition summary has an imageUrl and metadataUrl, these values cannot be set, they are
generated when creating the CollectibleDefinition, using the id that will be generated.
attributeValues
The attributeValues property is a list of extra CollectibleAttributes values we want to set for this
CollectibleDefinition.
For example, we could set the value for the attribute scarcity:
{
...
"attributeValues": [
{
"attributeId": "42b6a636-d393-4a9d-aac6-4c759ae8543c", # The actual id may vary
"value": "rare"
}
]
}
If the CollectibleAttribute value you want to set handles having a max value, the max value can be provided.
If the CollectibleAttribute has a default max value, and if no max value is given in the CollectibleAttributeValue, the CollectibleAttribute's default max value will be used.
Here no CollectibleAttributes are created, only CollectibleAttributeValues are. A CollectibleAttributeValue defines the value of a CollectibleAttribute for a given CollectibleDefinition.
Error codes
588f02a6-59c5-4e88-b165-a9036143320athe smart contract does not existe51cdbd3-43c1-4fa6-a2e3-5cddd1df668dthe smart contract is not enableda01adced-bbb9-4156-96b4-10d8d7bb217athe smart contract must be owned by the retailer6ce3cb08-5fe6-404c-9d1e-715edce2cfbethe partner does not exist or is inactivedde3c06a-ccea-4f2b-9db3-7cbfda55f732the attribute value cannot be set on the CollectibleDefinition level0cfaf8a3-c998-4adf-87bc-a823e80f2eaethe attribute cannot have a maxValue1232769b-5ba0-4156-9698-296a6d43c18athe attribute value sanitization failed, the value is invalid for the attribute
Payload to create a CollectibleDefinition
Id of the Smartcontract to use.
Should have the status enabled and belong to the retailer
b44b6691-ceeb-4b12-8a93-3c962acec538Id of the Partner to use. Should have the status active
f9d5eaae-230d-4bec-9d8e-51732ad6b664Name of the CollectibleDefinitin, will be stored as a CollectibleAttributeValue
Definition nameDescription of the CollectibleDefinition, will be stored as a CollectibleAttributeValue
Definition descriptionLink to an animation for the CollectibleDefinition, must have protocol https
https://nft.chiliz.com/foo-bar.gifLink that related to the CollectibleDefinition, must have protocol https
https://chiliz.com/foo-barNumber of Collectible that can be minted from this CollectibleDefinition. Must at least 1
10Comment on the CollectibleDefinition
Foo bar this is a commentSuccessfully created a CollectibleDefinition
Successfully created a CollectibleDefinition
3. Upload your asset(s) to the collection
Payload to create a CollectibleDefinition
Link that related to the CollectibleDefinition, must have protocol https
https://chiliz.com/foo-bar.jpgimageType
image/jpegPossible values: Successfully uploaded asset
Successfully uploaded asset
4. Mint the collection
Triggers the creation of the actual Collectibles (NFTs).
The payload is a list of recipients for the Collectible, and the number of Collectible to mint for this recipient.
The CollectibleDefinition can be seen as a template, or mold, from which we can create 1 or multiple Collectibles.
The number of Collectibles that can be minted from a CollectibleDefinition is defined by its maxSupply.
The response is the list of the newly created Collectibles, they will be actually minted by the blockchain a bit
later, at this point the Collectible status will move to minted
Collectible Definition to mint
Successfully minted new Collectibles
Bad Request
Last updated