# Create NFT Collection

NFT Collection can be created using this method. The weightage for this API is 5.

## API Specification

## Create NFT Collection

<mark style="color:green;">`POST`</mark> `https://api.krypcore.com/api/v0/easy-nft/createNFTCollection`

Create NFT Collection under the given instance.&#x20;

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User Auth Key obtained from Dash |
| DappId<mark style="color:red;">\*</mark>        | String | DappId                           |
| Chainid<mark style="color:red;">\*</mark>       | String | Chain ID                         |

#### Request Body

| Name                                                    | Type                | Description                                                           |
| ------------------------------------------------------- | ------------------- | --------------------------------------------------------------------- |
| chainId<mark style="color:red;">\*</mark>               | String              | Chain Id of the Blockchain Protocol                                   |
| ERCStandard<mark style="color:red;">\*</mark>           | String              | Standard can be ERC721 or ERC1155                                     |
| collectionDescription<mark style="color:red;">\*</mark> | String              | Description of the NFT collection                                     |
| collectionImage<mark style="color:red;">\*</mark>       | Base64 of the image | This image is used in displaying collection in the Easy NFT dashboard |
| collectionName<mark style="color:red;">\*</mark>        | String              | Name of the collection                                                |
| collectionSymbol<mark style="color:red;">\*</mark>      | String              | Symbol of the collection                                              |
| walletType<mark style="color:red;">\*</mark>            | String              | non-custodial or dev-wallet                                           |
| isSoulBound<mark style="color:red;">\*</mark>           | Boolean             | Is NFT represent a soul bound token?                                  |
| custodialWalletAccessToken                              | String              | Wallet ID of non-custodial wallet                                     |
| privateKey                                              | String              | Private Key of developer wallet                                       |

{% tabs %}
{% tab title="200: OK NFT collection created successfully" %}

```javascript
{
    "Data": {
        "contractAddress": "",
        "referenceId": "7835f5c0-7066-458e-83ca-cb117b417065",
        "txnHash": ""
    },
    "Message": "NFT collection created",
    "Status": "SUCCESS"
}
```

{% endtab %}

{% tab title="401: Unauthorized Failure in authentication" %}

```javascript
{
    "message": "Invalid API key in request"
}
```

{% endtab %}

{% tab title="400: Bad Request Insufficient funds in the wallet" %}

```javascript
{
    "Data": null,
    "Message": "error deploying contract insufficient funds for gas * price + value",
    "Status": "Failure"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```bash
curl --location --request POST 'https://api.krypcore.com/api/v0/easy-nft/createNFTCollection' \
--header 'Authorization: xxxxxxxxxxxxxxxxxx' \
--header 'DappId: xxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
  "ERCStandard": "ERC721",
  "chainId": "80001",
  "collectionDescription": "This is NFT collection description",
  "collectionImage": Base64 of the Image,
  "collectionName": "collectionName",
  "collectionSymbol": "collectionSymbol",
  "custodialWalletAccessToken":"xxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
  "isSoulBound": false,
  "walletType": "non-custodial"
}'
```

{% endtab %}

{% tab title="Node.js (Fetch)" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "ERCStandard": "ERC721",
  "chainId": "80001",
  "collectionDescription": "This is NFT collection description",
  "collectionImage": "Base64 of the Image"',
  "collectionName": "collectionName",
  "collectionSymbol": "collectionSymbol",
  "custodialWalletAccessToken":"xxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
  "isSoulBound": false,
  "walletType": "non-custodial"
});

 

var config = {
  method: 'post',
  url: 'https://api.krypcore.com/api/v0/easy-nft/createNFTCollection',
  headers: { 
    'Authorization': 'xxxxxxxxxxxxxxxxxx', 
    'DappId': 'xxxxxxxxxxxxxxxxxx', 
    'Content-Type': 'application/json'
  },
  data : data
};

 

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="Python " %}

```python
import requests
import json

 

url = "https://api.krypcore.com/api/v0/easy-nft/createNFTCollection"

 

payload = json.dumps({
  "ERCStandard": "ERC721",
  "chainId": "80001",
  "collectionDescription": "This is NFT collection description",
  "collectionImage": "Base64 of the Image",
  "collectionName": "collectionName",
  "collectionSymbol": "collectionSymbol",
  "custodialWalletAccessToken":"xxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
  "isSoulBound": False,
  "walletType": "non-custodial"
})
headers = {
  'Authorization': 'xxxxxxxxxxxxxxxxxx',
  'DappId': 'xxxxxxxxxxxxxxxxxx',
  'Content-Type': 'application/json'
}

 

response = requests.request("POST", url, headers=headers, data=payload)

 

print(response.text)
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

 

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

 

func main() {

 

  url := "https://api.krypcore.com/api/v0/easy-nft/createNFTCollection"
  method := "POST"

 

  payload := strings.NewReader(`{
  "ERCStandard": "ERC721",
  "chainId": "80001",
  "collectionDescription": "This is NFT collection description",
  "collectionImage": "Base64 of the Image",
  "collectionName": "collectionName",
  "collectionSymbol": "collectionSymbol",
  "custodialWalletAccessToken":"xxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
  "isSoulBound": false,
  "walletType": "non-custodial"
}`)

 

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

 

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "xxxxxxxxxxxxxxxxxx")
  req.Header.Add("DappId", "xxxxxxxxxxxxxxxxxx")
  req.Header.Add("Content-Type", "application/json")

 

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

 

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.krypcore.com/dev-docs/api-reference/core-service-apis/nft-studio-apis/create-nft-collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
