# ERC1155 NFT Tokens

## Create a new ERC1155 NFT Token

<mark style="color:green;">`POST`</mark> `https://api.nfty.dev/v1/nfts`

This endpoint creates and mints a new NFT from the given hosted ERC1155 Collection to a destination wallet address. It allows you to optionally specify a custom metadata URI for just this `token_id`, so it will not follow the scheme defined for the rest of the Collection. The address can be an NFT Wallet that you created using the APIs or any external address/wallet that supports ERC1155 NFTs.\
\
NFTYverse will handle uploading and hosting all the metadata and optionally the images and media as well. This API should only be used on hosted ERC1155 Collections. If you prefer to host the metadata yourself, you can create a "Self-Hosted" ERC1155 Collection and use the "Self-Hosted" version of the API below.\
\
When using this API, the `token_id` cannot already be created. So you need to call this API first and only once for a given `token_id`.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Your authorization token |

#### Request Body

| Name                | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uri                 | string  | A custom URI for this token's metadata. If set, this token will not follow the scheme defined for the rest of the Collection.                                                                                                                                                                                                                                                                                                                                                |
| token\_id           | integer | For ERC1155 NFTs, you need to specify an ID for each token that you mint. They don't have to be sequential. If you later call mint with a previously created `token_id`, then the `quantity` for that token will increase.                                                                                                                                                                                                                                                   |
| initial\_supply     | integer | The initial number of identical tokens you want to create for this `token_id`. ERC1155 supports multiple quantities of tokens.                                                                                                                                                                                                                                                                                                                                               |
| collection\_address | string  | The address of the collection you created using the Create NFT Collection API.                                                                                                                                                                                                                                                                                                                                                                                               |
| initial\_owner      | string  | The destination address for the newly created NFT. It can be an NFT Wallet or any external address that supports ERC1155 NFTs.                                                                                                                                                                                                                                                                                                                                               |
| image               | string  | NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards>                                                                                                                                                                                                                                                                                                                                                                                              |
| external\_url       | string  | NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards>                                                                                                                                                                                                                                                                                                                                                                                              |
| description         | string  | <p>NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards></p><p></p><p>Note: you can add the string <code>{token\_id}</code> <em>into the description and it will be replaced by the token\_id of this NFT token. This is useful if you want the description of the NFT to contain the token\_id, such as "This is NFT #123" etc.</em></p>                                                                                                          |
| name                | string  | <p>NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards></p><p></p><p>Note: you can add the string <code>{token\_id}</code> <em>into the name and it will be replaced by the token\_id of this NFT token. This is useful if you want the name of the NFT to contain the token\_id, such as "NFT #123" etc.</em></p>                                                                                                                                |
| attributes          | array   | NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards>                                                                                                                                                                                                                                                                                                                                                                                              |
| background\_color   | string  | NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards>                                                                                                                                                                                                                                                                                                                                                                                              |
| animation\_url      | string  | NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards>                                                                                                                                                                                                                                                                                                                                                                                              |
| youtube\_url        | string  | NFT metadata as defined here: <https://docs.opensea.io/docs/metadata-standards>                                                                                                                                                                                                                                                                                                                                                                                              |
| copy\_media         | boolean | Set this to true if you would like NFTYverse to copy and upload your `image` and `animation_url` media to IPFS and host it for you. Otherwise, set it to false and we will use the `image` and `animation_url` values directly. (You are choosing to continue hosting the media links yourself if this is set to false or omitted.)                                                                                                                                          |
| unlockable\_content | string  | This optional string represents "unlockable content" that only the NFT token holder  should be able to view. You can use it to create hidden text or links that are attached to this NFT, such as passwords or special access codes to your content - turning your NFT into a digital key and proof of ownership. The string is stored in the NFTYverse database off-chain. It  is then returned by the API when listing NFT Wallet contents for the user who owns this NFT. |

{% tabs %}
{% tab title="200 Mint action successfully initiated with the returned request id.

Since this is a blockchain transaction, the mint action may not complete right away. You will receive a request id in the response, which you can save. Once the transaction is fully completed on the blockchain, you will receive a separate Webhook Event with the same request id. At that point, you can consider the transaction completed and update your product UI as needed. Before receiving the Webhook Event, you should consider the transaction as pending. You can also use the Requests API to check on the status." %}

```
{"request_id":"53e5079d941f14db8a24a8e8647e93071fdff93de9e424796010549fd3e573aa"}
```

{% endtab %}

{% tab title="422 Could not mint NFT. Please make sure that the fields are correct and that you own the Collection specified by the collection\_address." %}

```
{"error_code":"", "errors":null}
```

{% endtab %}
{% endtabs %}

#### Example Request:

```
curl --request POST \
     --url https://api.nfty.dev/v1/nfts \
     --header 'Content-Type: application/json' \
     --header 'authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ==' \
     --data '{
  	   "collection_address": "0x16325d875e01a40136d4eb1157208a7432186d95",
  	   "initial_owner": "0x6d5f584f957858be82562a3b8b7b6268c4055f15",
       "token_id": 1,
       "initial_supply": 50,
       "name": "My NFT",
       "image": "https://domain.com/nfts/mynft.png",
       "description": "A collectible NFT.",
       "attributes": [
        {
        "trait_type": "Eyes", 
        "value": "Big"
        }, 
        {
        "trait_type": "Level", 
        "value": 5
        }, 
        {
        "display_type": "number", 
        "trait_type": "Generation", 
        "value": 2
        }
       ]
       }'

```

#### Example Response:

```
{"request_id":"56b21219efed57b38068fc3fe3fcdbb9e4f41041f5d1fe8ea8b830dd3bd19586"}
```

## Create a new ERC1155 NFT Token (Self-Hosted)

<mark style="color:green;">`POST`</mark> `https://api.nfty.dev/v1/nfts`

This endpoint creates and mints a new NFT from the given "Self-Hosted" ERC1155 Collection to a destination wallet address. It allows you to optionally specify a custom metadata URI for just this `token_id`, so it will not follow the `base_uri` scheme defined for the Collection. The address can be an NFT Wallet that you created using the APIs or any external address/wallet that supports ERC1155 NFTs.\
\
"Self-Hosted" means that you will be hosting the metadata and optionally the media yourself. This API should only be used on "Self-Hosted" ERC1155 Collections. If you prefer to have NFTYverse handle and host the metadata, please create a hosted ERC1155 Collection and check out the regular hosted API above.\
\
When using this API, the `token_id` cannot already be created. So you need to call this API first and only once for a given `token_id`.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Your authorization token |

#### Request Body

| Name                | Type    | Description                                                                                                                                                                                                                |
| ------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uri                 | string  | A custom URI for this token's metadata. If set, this token will not follow the `base_uri` defined for the Collection.                                                                                                      |
| token\_id           | integer | For ERC1155 NFTs, you need to specify an ID for each token that you mint. They don't have to be sequential. If you call mint again with a previously created `token_id`, then the `quantity` for that token will increase. |
| initial\_supply     | integer | The initial number of identical tokens you want to create for this `token_id`. ERC1155 supports multiple quantities of tokens.                                                                                             |
| collection\_address | string  | The address of the collection you created using the Create NFT Collection API.                                                                                                                                             |
| initial\_owner      | string  | The destination address for the newly minted NFT. It can be an NFT Wallet or any external address that supports ERC1155 NFTs.                                                                                              |

{% tabs %}
{% tab title="200 Mint action successfully initiated with the returned request id.

Since this is a blockchain transaction, the mint action may not complete right away. You will receive a request id in the response, which you can save. Once the transaction is fully completed on the blockchain, you will receive a separate Webhook Event with the same request id. At that point, you can consider the transaction completed and update your product UI as needed. Before receiving the Webhook Event, you should consider the transaction as pending. You can also use the Requests API to check on the status." %}

```
{"request_id":"53e5079d941f14db8a24a8e8647e93071fdff93de9e424796010549fd3e573aa"}
```

{% endtab %}

{% tab title="422 Could not mint NFT. Please make sure that the fields are correct and that you own the Collection specified by the collection\_address." %}

```
{"error_code":"", "errors":null}
```

{% endtab %}
{% endtabs %}

#### Example Request:

```
curl --request POST \
     --url https://api.nfty.dev/v1/nfts \
     --header 'Content-Type: application/json' \
     --header 'authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ==' \
     --data '{
  	   "collection_address": "0x16325d875e01a40136d4eb1157208a7432186d95",
  	   "initial_owner": "0x6d5f584f957858be82562a3b8b7b6268c4055f15",
       "token_id": 2,
       "initial_supply": 50,
       "uri": "https://customuri.com/special_token"
       }'

```

#### Example Response:

```
{"request_id":"56b21219efed57b38068fc3fe3fcdbb9e4f41041f5d1fe8ea8b830dd3bd19586"}
```

## Mint additional ERC1155 NFT Tokens

<mark style="color:green;">`POST`</mark> `https://api.nfty.dev/v1/nfts`

This endpoint mints additional NFT tokens for a `token_id` from the given hosted ERC1155 Collection and sends them to the destination wallet address. The `token_id` must already exist and should be created via the create APsI above. The quantity of that token\_id will increase by `quantity`. The address can be an NFT Wallet that you created using the APIs or any external address/wallet that supports ERC1155 NFTs.\
\
This API can be used for both hosted and "Self-Hosted" ERC1155 Collections.\
\
When using this API, the `token_id` must already be created using the create API above. So you can only call this API after you have already created the `token_id` already.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Your authorization token |

#### Request Body

| Name                | Type    | Description                                                                                                                                                                                        |
| ------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token\_id           | integer | Specify the existing ID for each token that you mint. When you call mint with a previously created `token_id`, the `quantity` for that token will increase.                                        |
| quantity            | integer | The additional number of identical tokens you want to create for this `token_id`. ERC1155 supports multiple quantities of tokens and the quantity for this `token_id` will increase by `quantity`. |
| collection\_address | string  | The address of the collection you created using the Create NFT Collection API.                                                                                                                     |
| to\_address         | string  | The destination address for the newly created NFT. It can be an NFT Wallet or any external address that supports ERC1155 NFTs.                                                                     |

{% tabs %}
{% tab title="200 Mint action successfully initiated with the returned request id.

Since this is a blockchain transaction, the mint action may not complete right away. You will receive a request id in the response, which you can save. Once the transaction is fully completed on the blockchain, you will receive a separate Webhook Event with the same request id. At that point, you can consider the transaction completed and update your product UI as needed. Before receiving the Webhook Event, you should consider the transaction as pending. You can also use the Requests API to check on the status." %}

```
{"request_id":"53e5079d941f14db8a24a8e8647e93071fdff93de9e424796010549fd3e573aa"}
```

{% endtab %}

{% tab title="422 Could not mint NFT. Please make sure that the fields are correct and that you own the Collection specified by the collection\_address." %}

```
{"error_code":"", "errors":null}
```

{% endtab %}
{% endtabs %}

#### Example Request:

```
curl --request POST \
     --url https://api.nfty.dev/v1/nfts \
     --header 'Content-Type: application/json' \
     --header 'authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ==' \
     --data '{
  	   "collection_address": "0x16325d875e01a40136d4eb1157208a7432186d95",
  	   "to_address": "0x6d5f584f957858be82562a3b8b7b6268c4055f15",
       "token_id": 1,
       "quantity": 50
       }'

```

#### Example Response:

```
{"request_id":"56b21219efed57b38068fc3fe3fcdbb9e4f41041f5d1fe8ea8b830dd3bd19586"}
```
