Create an NFT Collection

Collections are used to group and organize related NFT items.

To create an NFT collection, send a POST request to the /nft/nfts endpoint of Playfix API.

Create an NFT collection.

POST https://api.playfix.io/nft/nfts

Headers

Name
Type
Description

Authorization*

String

Bearer <your_access_token>

Request Body

Name
Type
Description

project*

String

The name of the project that will contain the NFT collection.

standard*

String

The token creation standard all NFTs in this collection will follow. Set it to any of the following values:

NFT_STANDARD_ERC721

or

NFT_STANDARD_ERC1155

title*

String

The title of the NFT collection.

description

String

Short description of the NFT collection.

imageCoverCid

String

IPFS CID for the image to use as the NFT collection cover image when displayed in the user interface.

config*

Object

Configuration options for the NFT collection.

config.name*

String

Name of the token.

config.symbol

String

A shorthand symbol to refer to the NFT collection. Choose a short, uppercase word between 3-5 characters that is unique within your project.

config.itemPrice

String

A non-negative number representing the mint price of an NFT in this NFT collection.

config.burnable

String

Set to true to allow NFT burning.

config.pausable

String

Set to true to allow pausing of NFT transfer.

config.ownerAddress*

String

Wallet address of the contract owner, which receives the NFT collection.

network*

String

Name of the blockchain network where the NFT collection contract will be deployed.

{
  "name": "nfts/01gg72h0znfjggmnq7dyaek0r2",
  "project": "<project_name>",
  "standard": "NFT_STANDARD_UNSPECIFIED",
  "title": "Carz",
  "description": "NFT Car Collection",
  "itemCount": "0",
  "imageCoverUrl": "https://ipfs-gateway.playfix.io/ipfs/QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "imageCoverCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "config": {
    "name": "Carz",
    "symbol": "CRS",
    "itemPrice": 0.01,
    "baseUri": "",
    "burnable": true,
    "pausable": true,
    "ownerAddress": "<your_wallet_address>"
    },
  "network": "NETWORK_POLYGON_MUMBAI",
  "contractAddress" : "",
  "deployTxHash": ""
}

The following example creates a new NFT collection titled "Carz".

Example cURL API Call

curl --request POST \
  --url https://api.playfix.io/nft/nfts \
  --header 'Authorization: Bearer <your_access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "project": "<project_name>",
    "standard": "NFT_STANDARD_ERC721",
    "title": "Carz",
    "description": "NFT Car Collection",
    "imageCoverCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
    "config": {
        "name": "Carz",
        "symbol": "CRS",
        "itemPrice": 0.01,
        "burnable": false,
        "pausable": false,
        "ownerAddress": "<your_wallet_address>"
    },
    "network": "NETWORK_POLYGON_MUMBAI"
  }'

Example Python API Call

import requests
import json

payload = {
    "project": "<project_name>",
    "standard": "NFT_STANDARD_ERC721",
    "title": "Carz",
    "description": "NFT Car Collection",
    "imageCoverCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
    "config": {
        "name": "Carz",
        "symbol": "CRS",
        "itemPrice": 0.01,
        "burnable": False,
        "pausable": False,
        "ownerAddress": "<your_wallet_address>"
        },
    "network": "NETWORK_POLYGON_MUMBAI"
    }

r = requests.post(
    "https://api.playfix.io/nft/nfts",
    headers = {
        "Authorization": "Bearer <your_access_token>",
        "Accept": "application/json",
        "Content-Type": "application/json"
        },
    data = json.dumps(payload)
    )

print(r.text)

Request Body

  • project - The name of the project that will contain the token. This should be the value of name from a project you created earlier.

  • standard - The token creation standard all NFTs in this collection will follow. Set it to any of the following values:

    • NFT_STANDARD_ERC721: The NFT collection uses the ERC-721 token standard.

    • NFT_STANDARD_ERC1155: The NFT collection uses the ERC-1155 token standard.

  • title - Title of the NFT collection.

  • description - Short description of the NFT collection.

  • imageCoverCid - IPFS CID for the image to use as the NFT collection cover image when displayed in the user interface.

  • config - Configuration options for the NFT collection.

    • name - Name of the token.

    • symbol - A shorthand symbol to refer to the NFT collection. Choose a short, uppercase word between 3-5 characters that is unique within your project.

    • itemPrice - A non-negative number representing the mint price of an NFT item in this NFT collection.

    • burnable (boolean)- Set to true to allow NFT burning.

    • pausable (boolean)- Set to true to allow pausing of NFT transfer.

    • ownerAddress - The wallet address of the contract owner. The owner address receives the NFT items initially and has additional privileges.

  • network - Name of the blockchain network where the NFT collection contract will be deployed. You can set this to any of the following network values, depending on your preference:

    • NETWORK_ETHEREUM: Ethereum mainnet.

    • NETWORK_ETHEREUM_RINKEBY: Ethereum Gorli testnet. For testing purposes only.

    • NETWORK_POLYGON: Polygon mainnet.

    • NETWORK_POLYGON_MUMBAI: Polygon Mumbai testnet. For testing purposes only.

Response

{
  "name": "nfts/01gg72h0znfjggmnq7dyaek0r2",
  "project": "<project_name>",
  "standard": "NFT_STANDARD_UNSPECIFIED",
  "title": "Carz",
  "description": "NFT Car Collection",
  "itemCount": "0",
  "imageCoverUrl": "https://ipfs-gateway.playfix.io/ipfs/QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "imageCoverCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
  "config": {
    "name": "Carz",
    "symbol": "CRS",
    "itemPrice": 0.01,
    "baseUri": "",
    "burnable": false,
    "pausable": false,
    "ownerAddress": "<your_wallet_address>"
    },
  "network": "NETWORK_POLYGON_MUMBAI",
  "contractAddress" : "",
  "deployTxHash": ""
}

Response Fields

  • name - A unique name of the NFT collection, automatically generated by Playfix. It begins with "nfts/" followed by a ULID.

  • imageCoverUrl - An automatically generated URL to an IPFS gateway that fetches the cover image.

  • itemCount - The number of NFTs in the collection.

  • baseUri - The base URI (uniform resource identifier) for all NFTs in the collection.

  • contractAddress - Address of the NFT collection contract when it is deployed. This will be empty for a start.

  • deployTxHash - The transaction hash of the NFT collection contract deployment. This will be empty for a start.

Last updated