Tatum
Search…
How to create NFTs on Flow
Collectibles in the blockchain are just one API call away.
NFTs have been making waves in the digital world recently and for good reason. These specialized tokens ensure verifiable authenticity and scarcity of digital assets, opening up a world of possibilities for a wide range of digital marketplaces.
From digital collectibles to in-game assets to one-of-a-kind releases of digital media, the possibilities are endless. Everyone wants to start implementing NFTs into their platforms, but they're running into a few obstacles.
Creating a new NFT, or "smart contract" on the Flow blockchain, is not easy at all. As a developer, you have to know a lot of things:
    Cadence - a new programming language for writing smart contracts
    How to use a compiler for Cadence
    How to develop using an IDE
    How to deploy the compiled smart contract
    Undergo a review process from DapperLabs
It's a lot to know, and for developers who only need the basic features of NFT tokens, it would take weeks to figure it all out.
Flow NFT.postman_collection.json
103KB
Binary
Postman Collection
Tatum has a prebuilt FLOW NFT contract ready for deployment. The source code is available on GitHub.

Generate a Flow wallet and address

The first step is to generate a wallet and address in the Flow blockchain. One Flowaddress will be used as a minter address - it will only be possible to mint new tokens from this account.
Request
Response
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/flow/wallet' \
2
--header 'x-api-key: YOUR_API_KEY'
Copied!
1
{
2
"mnemonic": "fabric recipe physical attend foam also inspire swear risk outside monkey palm mutual park civil peasant virtual angle curve tennis follow gym put transfer",
3
"xpub": "xpub6EWe9RRoaXxhWR6K1boerSprD2Q84756t8PMoqWS2WCAYmMVxYRXqj5c4PboamiUmxrvKpcoZw2z714kviYL5fQ7VNiktHz3XeBxHqu5Xdh"
4
}
Copied!
From the generated mnemonic and xpub, an address and private key can be created.
Request
Response
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/flow/address/xpub6EWe9RRoaXxhWR6K1boerSprD2Q84756t8PMoqWS2WCAYmMVxYRXqj5c4PboamiUmxrvKpcoZw2z714kviYL5fQ7VNiktHz3XeBxHqu5Xdh/0' \
2
--header 'x-api-key: YOUR_API_KEY'
Copied!
1
{
2
"address": "0x3dd16e9a72762818"
3
}
Copied!

Creating an NFT Smart Contract

To create and deploy NFTs using Tatum, all you need is one simple API call. This API call deploys a standard, validated NFT smart contract to the blockchain of your choice. In the case of Flow, it registers a new type of NFT token especially for you. The signing address in the request is the address of the minter. It will only be possible to mint new tokens from this address.
A Flow address can be used only once to deploy a new NFT contract. If you want to work with multiple NFTs, you need to use multiple addresses as deployer / minter addresses.
Blockchain transactions are signed using a private key via API, which is not a secure way of signing transactions. Your private keys and mnemonics should never leave your security perimeter. To correctly and securely sign a transaction, you can use Tatum CLI from the command line, a specific language library like Tatum JS, or our complex key management system, Tatum KMS.
Request
Response
1
curl --location --request POST 'https://api-eu1.tatum.io/v3/nft/deploy/' \
2
--header 'Content-Type: application/json' \
3
--header 'x-api-key: YOUR_API_KEY' \
4
--data-raw '{
5
"chain": "FLOW",
6
"privateKey": "e08f2ef94365e1696698f1df3dbfdecf54e255fd51c5db1040ddacf219b79edd",
7
"account": "0x3dd16e9a72762818"
8
}'
Copied!
1
{
2
"txId": "df09b27ca2b4655c4c4d5d4e0a402e6a01c04a0c08f4d9e17d31df0b6358bab7"
3
}
Copied!

Getting the NFT token type

From the deploy transaction, it's possible to obtain the contract address of the token.
Request
Response
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/nft/address/FLOW/df09b27ca2b4655c4c4d5d4e0a402e6a01c04a0c08f4d9e17d31df0b6358bab7' \
2
--header 'x-api-key: YOUR_API_KEY'
Copied!
1
{
2
"contractAddress": "0182e912-329c-4f98-a481-b7515f8a8c51"
3
}
Copied!

Minting a new unique NFT token

When your NFT smart contract is deployed and you know the contract address, you can issue new unique tokens with the Mint NFT endpoint. This endpoint will create a new token with a unique identifier. Every token should have metadata as a JSON schema containing additional information about the token, like the image URL, description, etc. In the response, you can see the ID of the minted token as well as the ID of the transaction.
Request
Response
1
curl --location --request POST 'https://api-eu1.tatum.io/v3/nft/mint/' \
2
--header 'Content-Type: application/json' \
3
--header 'x-api-key: YOUR_AP_KEY' \
4
--data-raw '{
5
"to": "0x3dd16e9a72762818",
6
"url": "https://my_token_data.com",
7
"contractAddress": "0182e912-329c-4f98-a481-b7515f8a8c51",
8
"chain": "FLOW",
9
"privateKey": "e08f2ef94365e1696698f1df3dbfdecf54e255fd51c5db1040ddacf219b79edd",
10
"account": "0x3dd16e9a72762818"
11
}'
Copied!
1
{
2
"txId": "1e28c9eea5750fccc2db5c34c51d01f040a4ad7e51ffa6e6476d7e69088d7afc",
3
"tokenId": 12
4
}
Copied!

Transferring a specific NFT token

To transfer tokens from the address where they were issued to another blockchain address, you can use the Transfer NFT token endpoint. You'll need the private key of the address where the tokens are located (the address from the first call where the initial supply was distributed).
Request
Response
1
curl --location --request POST 'https://api-eu1.tatum.io/v3/nft/transaction/' \
2
--header 'Content-Type: application/json' \
3
--header 'x-api-key: YOUR_API_KEY' \
4
--data-raw '{
5
"tokenId": "12",
6
"chain": "FLOW",
7
"to": "0x2d0d7b39db4e3a08",
8
"contractAddress": "27320939-3087-490e-a65e-a53c8b06fcd9",
9
"privateKey": "e08f2ef94365e1696698f1df3dbfdecf54e255fd51c5db1040ddacf219b79edd",
10
"account": "0x3dd16e9a72762818"
11
}'
Copied!
1
{
2
"txId": "d7d42e8bb3e5335e8db6ff19c7658004ecc0d7b24c120b9fbe60daaee33e7fdf"
3
}
Copied!
Again, the result is a blockchain transaction with an ID.

Getting a list of tokens that belong to the address

If you want to display a list of tokens that someone possesses, you can use the Get NFT Account balance endpoint.
Request
Response
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/nft/balance/FLOW/27320939-3087-490e-a65e-a53c8b06fcd9/0x3dd16e9a72762818' \
2
--header 'x-api-key: YOUR_API_KEY'
Copied!
1
[
2
10,
3
11
4
]
Copied!

Obtaining metadata for a specific token

If you want to obtain a metadata URL for a token, you can use the Get NFT Token metadata endpoint.
Request
Response
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/nft/metadata/FLOW/27320939-3087-490e-a65e-a53c8b06fcd9/8?account=0x2d0d7b39db4e3a08' \
2
--header 'x-api-key: YOUR_API_KEY'
Copied!
1
{
2
"data": "https://my_token_data.com"
3
}
Copied!
Pretty simple, right? You only had to make three calls to Tatum to deploy your own token, issue a unique one, and transfer it. Another two for getting useful information. You don't have to install anything, learn Solidity, etc.
To find out more about the API calls we have just used, visit our API Reference.
Last modified 4mo ago