Minting API
On this page we show you how to use Immutable's Minting API. Our Minting API streamlines the minting process, enabling seamless creation of NFTs with just one API call. Whether you're minting one NFT or hundreds, our API makes it easy and efficient.
To gain access to the minting API on mainnet, please complete the following steps in Hub. Kindly note that during the initial launch period, the minting API is exclusively available to partners under contract with Immutable.
The Minting API is available to all developers using Immutable's preset contracts on testnet.
Benefits of Minting API?
Immutable's Minting API simplifies the process of minting NFTs at scale by providing a user-friendly API interface. This makes Immutable's platform more accessible as Immutable solves the following issues when minting at scale:
- Local nonce tracking and management
- Transaction lifecycle tracking
- Continuously sourcing IMX for minting
- Expedited metadata indexing by submitting metadata through APIs
- Token ID reconciliation for the
mintBatchByQuantity()
function
To ensure compatibility with the Minting API, game studios are required to use Immutable's preset contracts.
Contract functions supported by Minting API
The Minting API currently is supported with Immutable's ERC721 preset contracts. At present, ERC1155 minting functionality is unavailable through the Minting API.
Expanding the capabilities of the Minting API to accommodate ERC1155 minting is a planned enhancement on Immutable's roadmap. Kindly refer back to this page for forthcoming updates.
Function: mintBatch()
The Minting API uses the mintBatch()
function if a token_id
is used in the API call. It supports the minting of single or multiple assets from the same collection in a single request via the Minting API.
The following preset contracts are compatible with the Minting API mintBatch()
function:
- Recommended ERC721 preset: ImmutableERC721.sol
- ERC721 Mint-By-ID: ImmutableERC721MintByID.sol
This function allows studios to specify the token_id
at the time of minting. Although less gas-efficient compared to mintBatchByQuantity()
, mintBatch()
is useful for asset migrations where maintaining the same token_id
across platforms is required.
Function: mintBatchByQuantity() - Most gas efficient!
The Minting API uses the mintBatchByQuantity()
function if a token_id
is not used in the API call. It supports the minting of single or multiple assets from the same collection in a single request via the Minting API.
The following preset contract is compatible with the Minting API mintBatchByQuantity()
function:
- Recommended ERC721 preset: ImmutableERC721.sol
Due to the gas efficiencies associated with mintBatchByQuantity()
, the token_id
cannot be specified during the minting process. Instead, mint requesters must provide a unique internal reference_id
for each asset being minted. After the minting process is complete, the mint-requests
Blockchain Data API endpoint can be utilised to link the onchain token_id
with its corresponding offchain reference_id
See the following section for a step by step guide on how to map reference_id
to token_id
.
Each reference_id
must be unique for every successfully minted asset from each collection. If a minting attempt fails, the same reference_id
can be used again until the mint is successful.
However, attempting to reuse an existing reference_id
from a previously minted asset in a new minting request for the same collection, or using the same reference_id
for multiple assets within the same minting request, will result in an error.
Using the Minting API
To access the Minting API, send a POST request to the mint-requests
endpoint.
The Minting API will accept your mint requests and process them asynchronously. The API supports batch mint requests, however Immutable optimises batches which can result in multiple mint requests sharing the same transaction hash (i.e. Immutable batches multiple separate Minting API requests to reduce gas).
Metadata can be set up through the Minting API or be added later via the Metadata Refresh APIs.
A reference_id
is always required when using the Minting API; it can be the same as token_id
if using the mintBatch()
feature.
Regardless of the method chosen for metadata setup, content creators must ensure that their local copy of metadata is synchronised with Immutable's Blockchain Data API. Marketplaces and other ecosystem partners may not utilise the Blockchain Data API to reference an asset's metadata.
While the Minting API allows minters to set up their asset's metadata via a simple POST request, this feature does not eliminate the need for studios to host their own metadata.
Please read the following guide to understand how an assets metadata file, the Blockchain Data API and baseURI
field work together to index a collection's metadata.
Minting API rate limits
The Minting API during its Beta phase has the following rate limits applied.
If your product requires higher rate limits please reach out to your Immutable representitive.
Action | Rate Limit |
---|---|
# of NFTs per request | 100 |
# of requests per second | 5 |
Total # of NFTs requested per minute | 2,000 |
The above rate limits reflect rate new mint requests are accepted by the Minting API, they do not represent the rate that assets are minted to the chain which varies due to a variety of factors.
Minting API prerequisites
To use the Minting API you will need to have performed the following steps:
- Create an account in Hub
- Deploy a collection to testnet or mainnet using Immutable's preset contracts. This can be done via Hub or manual deployment. If you manually deploy your contract ensure you link the collection to your Hub account.
- Get the
contractAddress
of the deployed contract - Get a
secretAPIKey
from Hub. This will be required in the header of the API call. If using the SDK please check out this guide as a reference. - Grant the minter role to our minter wallet. Here is an example script for granting the minter role to our Minting API.
Environment | Minter wallet address |
---|---|
Testnet | 0x9CcFbBaF5509B1a03826447EaFf9a0d1051Ad0CF |
Mainnet | 0xbb7ee21AAaF65a1ba9B05dEe234c5603C498939E |
- Mainnet Enablement: Follow these steps for Mainnet enablement. During our initial launch period mainnet access is available to partners that have a contract with Immutable.
SDK Usage
Minting API functionality can be accessed by using the Immutable SDK as well as calling the APIs directly. The code examples on this page refer to both approaches. When using the SDK approach, please ensure you have set up the SDK client correctly in your project as per these instructions on how to set up an Immutable SDK client.
Minting with different functions
Select on the tabs below for a step-by-step guide on how to mint with the different contract functions:
- mintBatch(): With Metadata
- mintBatch(): Without Metadata
- mintBatchByQuantity(): With Metadata
- mintBatchByQuantity(): Without Metadata
mintBatch(): Using the Minting API with token_id
The Minting API uses the mintBatch()
function of Immutable's preset contracts if token_id
is present in the mint request.
If no token_id
is present, the mintBatchByQuantity()
function will be used by default.
Using mintBatch() with metadata
When using the Minting API, including metadata in the API request is recommended by Immutable to expedite the asset creation process.
Incorporating metadata in the Minting API requests eliminates the need for the Blockchain Data API to index the metadata from your local backend in the baseURI/token_id
directory, which takes additonal time.
Game studios must ensure that the assets' metadata file is still placed in the baseURI/token_id
directory. This ensures synchronisation with Immutable's Blockchain Data API, as some ecosystem partners may rely on the assets metadata source file for publishing an asset's metadata.
Sequence of Actions for Using mintBatch() with Metadata
- Prepare the metadata for future assets in the specified format.
- Store the metadata in your
baseURI/token_id
directory. - Utilise the Minting API, specifying the required
token_id
in the API call, and include the metadata prepared in Step 1. Provide and usereference_id
to check the status of the mint request.
Example: Minting API with metadata in API call
Parameter | Description | Location | Required |
---|---|---|---|
chain_name | String representing the name of the chain. A list of available chains can be found here. | Body | Yes |
contract_address | The contract address of the ERC721 collection | Body | Yes |
owner_address | The wallet address of the player who will own the minted NFT | Body | Yes |
token_id | A unique identifier within the collection for the NFT you are creating. | Body | Yes |
reference_id | The internal content creator reference ID of the asset being minted. Each number must be unique for each collection's successful mints. Can be the same value as token_id . | Body | Yes |
x-immutable-api-key | Secret key for your environment obtained from your Hub account. Follow this guide to set yours up. This is not your wallet's private key. | Header | Yes |
Run the following command to mint
- SDK
- API
const chainName = 'CHAIN_NAME';
const contractAddress = CONTRACT_ADDRESS;
const response = await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID,
token_id: TOKEN_ID,
metadata: {
name: 'Brown Dog Green Car',
description: 'This NFT is a Brown Dog in a Green Car',
image: 'https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDGC.png',
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: 'Pet',
value: 'Dog',
},
{
trait_type: 'Pet Colour',
value: 'Brown',
},
{
trait_type: 'Vehicle',
value: 'Car',
},
{
trait_type: 'Vehicle Colour',
value: 'Green',
}
]
}
},
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID,
token_id: TOKEN_ID,
metadata: {
name: 'Brown Dog Red Car',
description: 'This NFT is a Brown Dog in a Red Car',
image: 'https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDRC.png',
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: 'Pet',
value: 'Dog',
},
{
trait_type: 'Pet Colour',
value: 'Brown',
},
{
trait_type: 'Vehicle',
value: 'Car',
},
{
trait_type: 'Vehicle Colour',
value: 'Red',
}
]
}
}
]
}
});
POST {baseURL}/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests
A successful request will receive a response like the one shown below:
{
"imx_mint_requests_limit": "2000",
"imx_mint_requests_limit_reset": "2024-02-13 07:20:00.778434 +0000 UTC",
"imx_mint_requests_retry_after": "59.98-seconds",
"imx_remaining_mint_requests": "1999"
}
mintBatch(): Using the Minting API with token_id
The Minting API uses the mintBatch()
function of Immutable's preset contracts if token_id
is present in the mint request.
If no token_id
is present, the mintBatchByQuantity()
function will be used by default.
Using mintBatch() without Metadata
While Immutable recommends using the Minting API with metadata in the API call to expedite the minting process, if metadata is not included the Blockchain Data API indexer will source the future asset's metadata from your game's local backend.
Once an asset is created using the Minting API with a specified token_id
, the indexer will retrieve the baseURI
from your collection and search in the baseURI/token_id
directory to index the new asset's metadata.
For more information on the metadata source file, please refer to the following product page.
Sequence of actions for using mintBatch() without metadata
- Prepare the future assets' metadata in the specified format
- Store the metadata in your
baseURI/token_id
directory - Utilise the Minting API, specifying the required
token_id
in the API call
Example: Minting API without metadata
Parameter | Description | Location | Required |
---|---|---|---|
chain_name | String representing the name of the chain. A list of available chains can be found here. | Body | Yes |
contract_address | The contract address of the ERC721 collection | Body | Yes |
owner_address | The wallet address of the player who will own the minted NFT | Body | Yes |
token_id | A unique identifier within the collection for the NFT you are creating. | Body | Yes |
reference_id | The internal content creator reference ID of the asset being minted. Each number must be unique for each collection's successful mints. Can be the same value as token_id . | Body | Yes |
x-immutable-api-key | Secret key for your environment obtained from your Hub account. Follow this guide to set yours up. This is not your wallets private key. | Header | Yes |
- Run the following command to mint
- SDK
- API
const chainName = 'CHAIN_NAME';
const contractAddress = CONTRACT_ADDRESS;
const response = await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID,
token_id: TOKEN_ID
},
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID,
token_id: TOKEN_ID
}
]
}
});
POST {baseURL}/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests
A successful request will receive a response like the one shown below:
{
"imx_mint_requests_limit": "2000",
"imx_mint_requests_limit_reset": "2024-02-13 07:20:00.778434 +0000 UTC",
"imx_mint_requests_retry_after": "59.98-seconds",
"imx_remaining_mint_requests": "1999"
}
mintBatchByQuantity(): Gas efficient minting
The Minting API uses the mintBatchByQuantity()
function of Immutable's preset contracts if token_id
is not present in the mint request.
This method offers the most gas-efficient minting process.
reference_id
is used to map a Minting API request to the system generated token_id
via the Blockchain Data API.
Using mintBatchByQuantity() with Metadata in API call
When using the mintBatchByQuantity() via the Minting API, Immutable strongly recommends including metadata in the API request to prevent the need from having to perform a metadata refresh after the asset has been minted to index the assets metadata.
As token_id
is not specified at the start of the minting process, the metadata file cannot be located in the game studio's local backend in the baseURI/token_id
directory at the time of mint.
Mint requesters should still create a corresponding metadata file (filename=token_id
) in their local metadata directory (defined by the baseURI
) after the asset has been minted. This ensures synchronisation between the Blockchain Data API and the source of the asset's metadata.
Sequence of actions for using Minting API with metadata
- Mint the asset via the Minting API with the
reference_id
and corresponding metadata in the mint request. - Use webhooks or poll the
mint-requests
endpoint for updates on mint status and to establish thereference_id
->token_id
mapping. - Create a metadata file
../[baseURI]/[token_id]
and populate it with the metadata used in Step 1.
Example: Minting API with Metadata in the Request
Parameter | Description | Location | Required |
---|---|---|---|
chain_name | String representing the name of the chain. A list of available chains can be found here. | Body | Yes |
contract_address | The contract address of the ERC721 collection | Body | Yes |
owner_address | The wallet address of the player who will own the minted NFT | Body | Yes |
reference_id | The internal content creator reference ID of the asset being minted. This internal ID is used to link the request to the system-generated token ID. Each number must be unique for each collection's successful mints | Body | Yes |
x-immutable-api-key | Secret key for your environment obtained from your Hub account. Follow this guide to set yours up. This is not your wallets private key. | Header | Yes |
- Run the following command to mint:
- SDK
- API
const chainName = 'CHAIN_NAME';
const contractAddress = CONTRACT_ADDRESS;
const response = await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID,
metadata: {
name: 'Brown Dog Green Car',
description: 'This NFT is a Brown Dog in a Green Car',
image: 'https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDGC.png',
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: 'Pet',
value: 'Dog',
},
{
trait_type: 'Pet Colour',
value: 'Brown',
},
{
trait_type: 'Vehicle',
value: 'Car',
},
{
trait_type: 'Vehicle Colour',
value: 'Green',
}
]
}
},
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID,
metadata: {
name: 'Brown Dog Red Car',
description: 'This NFT is a Brown Dog in a Red Car',
image: 'https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDRC.png',
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: 'Pet',
value: 'Dog',
},
{
trait_type: 'Pet Colour',
value: 'Brown',
},
{
trait_type: 'Vehicle',
value: 'Car',
},
{
trait_type: 'Vehicle Colour',
value: 'Red',
}
]
}
}
]
}
});📚API referencePOST {baseURL}/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests
A successful request will receive a response like the one shown below:
{
"imx_mint_requests_limit": "2000",
"imx_mint_requests_limit_reset": "2024-02-13 07:20:00.778434 +0000 UTC",
"imx_mint_requests_retry_after": "59.98-seconds",
"imx_remaining_mint_requests": "1999"
} - To verify the mint status and determine the `token_id` from the `reference_id`, follow [these steps](#get-minting-status-of-a-single-reference-id).
- Prepare a metadata file with a filename equal to the `token_id`. Save this file in the following location corresponding to the `baseURI` of your collection: `../[baseURI]/[token_id]`
mintBatchByQuantity(): Gas efficient minting
The Minting API uses the mintBatchByQuantity()
function of Immutable's preset contracts if token_id
is not present in the mint request.
This method offers the most gas-efficient minting process.
reference_id
is used to map a Minting API request to the system generated token_id
via the Blockchain Data API.
Using mintBatchByQuantity() without Metadata in API call
The Minting API can be utilised without submitting metadata upfront. A metadata refresh call will be required after the asset has been minted to update the Blockchain Data API.
Sequence of actions for using Minting API without metadata
- Mint the asset via the Minting API with the
reference_id
and no metadata. - Use webhooks or poll the
mint-requests
endpoint for updates on mint status and to establish thereference_id
->token_id
mapping. - Create a metadata file
../[baseURI]/[token_id]
and populate it with metadata used in Step 1 above. - Trigger a metadata refresh to update Immutable's Blockchain Data API.
Example: Minting API without metadata in request
Parameter | Description | Location | Required |
---|---|---|---|
chain_name | String representing the name of the chain. A list of available chains can be found here. | Body | Yes |
contract_address | The contract address of the ERC721 collection | Body | Yes |
owner_address | The wallet address of the player who will own the minted NFT | Body | Yes |
reference_id | The internal content creator reference ID of the asset being minted. This internal ID is used to link the request to the system-generated token ID. Each number must be unique for each collection's successful mints | Body | Yes |
x-immutable-api-key | Secret key for your environment obtained from your Hub account. Follow this guide to set yours up. This is not your wallets private key. | Header | Yes |
Run the following command to mint
- SDK
- API
const chainName = 'CHAIN_NAME';
const contractAddress = CONTRACT_ADDRESS;
const response = await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address: OWNER_ADDRESS,
reference_id: REFERENCE_ID
}
]
}
});
POST {baseURL}/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests
Verifying the status of a Minting request
The mint-requests
webhook or polling endpoint can be utilised to check the status of a Minting API request.
For successful mints, the following data will be returned:
chain
reference_id
status
contract_address
owner_address
token_id
activity_id
transaction_hash
created_at
updated_at
For unsuccessful mints, the following data will be returned:
chain
reference_id
status
error
contract_address
owner_address
created_at
updated_at
The status
field can have the following values:
- Succeeded: The mint was successful
- Pending: The mint request is waiting in a queue
- Fail: The mint was unsuccessful; see
error
for more details
These endpoints can be queried using the below methods.
Get Minting status of a single reference ID
To retrieve the status of a single reference_id
, execute the following command:
Parameter | Description | Location | Required |
---|---|---|---|
chain_name | String representing the name of the chain. A list of available chains can be found here. | Body | Yes |
contract_address | The contract address of the ERC721 collection | Body | Yes |
reference_id | The internal content creator reference ID of the asset being minted. This internal ID is used to link the request to the system-generated token ID. | Body | Yes |
chain_id | String representing the ID of the chain. A list of available chain IDs can be found here. | Response | Yes |
token_id | The system-generated token_id revealed once the asset has been minted | Response | No |
x-immutable-api-key | Secret key for your environment obtained from your Hub account. Follow this guide to set yours up. This is not your wallets private key. | Header | Yes |
- SDK
- API
const chainName = 'CHAIN_NAME';
const contractAddress = CONTRACT_ADDRESS;
const referenceId = REFERENCE_ID;
const response = await client.getMintRequest({chainName, contractAddress, referenceId});
GET {baseURL}/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}
This will return the following results if the request is in a pending state.
{
"page": {
"next_cursor": null,
"previous_cursor": null
},
"result": [
{
"chain": {
"id": "CHAIN_ID",
"name": "CHAIN_NAME"
},
"collection_address": "CONTRACT_ADDRESS",
"created_at": "2024-02-12T05:35:35.743242Z",
"error": null,
"owner_address": "0x68209e7086032941a8Cb14352c2F43b086288791",
"reference_id": "REFERENCE_ID",
"status": "pending",
"token_id": null,
"activity_id": "null",
"transaction_hash": null,
"updated_at": "2024-02-12T05:35:35.743242Z"
},
]
}
The request will return the following request when it is successful, allowing you to map the REFERENCE_ID -> TOKEN_ID
{
"page": {
"next_cursor": null,
"previous_cursor": null
},
"result": [
{
"chain": {
"id": "CHAIN_ID",
"name": "CHAIN_NAME"
},
"collection_address": "0xe2e94d611d50370612e9721254807b7874093fb6",
"created_at": "2024-02-12T05:35:35.743242Z",
"error": null,
"owner_address": "0x68209e7086032941a8Cb14352c2F43b086288791",
"reference_id": "REFERENCE_ID",
"status": "succeeded",
"token_id": "TOKEN_ID",
"activity_id": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b",
"transaction_hash": "0x6890c450a43e6f3e90b311e2c0e80e1e6880cbc93ab977fc5357ac66cd255800",
"updated_at": "2024-02-12T05:35:35.743242Z"
},
]
}
Get minting status of all Minting API requests for a collection
The preferred method of recieving Minting API status updates is via the Mint Requests webhook event.
In the below scenarios we should you how to use the Blockchain Data API mint-request
endpoint to recieve updates.
To get the status of all reference IDs used for a collection, the following command can be run:
Parameter | Description | Location | Required | |
---|---|---|---|---|
chain_name | String representing the name of the chain. A list of available chains can be found here. | Body | Yes | |
contract_address | The contract address of the ERC721 collection | Body | Yes | |
reference_id | The internal content creator reference ID of the asset being minted. This internal ID is used to link the request to the system-generated token ID. | Body | Yes | |
chain_id | String representing the ID of the chain. A list of available chain IDs can be found here. | Response | Yes | |
token_id | The system-generated token_id revealed once the asset has been minted | Response | No | |
x-immutable-api-key | Secret key for your environment obtained from your Hub account. Follow this guide to set yours up. This is not your wallets private key. | Header | Yes |
- SDK
- API
const chainName = 'CHAIN_NAME';
const contractAddress = CONTRACT_ADDRESS';
const response = await client.listMintRequests({chainName, contractAddress});
GET {baseURL}/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests
The request will return the following results, allowing you to map the reference_id
-> token_id
for successful requests.
The most recent mint requests will be located as the top of the results.
{
"page": {
"next_cursor": null,
"previous_cursor": null
},
"result": [
{
"chain": {
"id": "CHAIN_ID",
"name": "CHAIN_NAME"
},
"collection_address": "CONTRACT_ADDRESS",
"created_at": "2024-02-12T05:35:35.743242Z",
"error": null,
"owner_address": "0x68209e7086032941a8Cb14352c2F43b086288791",
"reference_id": "REFERENCE_ID",
"status": "succeeded",
"token_id": "TOKEN_ID",
"activity_id": "4e28df8d-f65c-4c11-ba04-6a9dd80e1e6",
"transaction_hash": "0x6890c450a43e6f3e90b311e2c0e80e1e6880cbc93ab977fc5357ac66cd255800",
"updated_at": "2024-02-12T05:35:35.743242Z"
},
{
"chain": {
"id": "CHAIN_ID",
"name": "CHAIN_NAME"
},
"collection_address": "CONTRACT_ADDRESS",
"created_at": "2024-02-12T05:35:35.743242Z",
"error": null,
"owner_address": "0x68209e7086032941a8Cb14352c2F43b086288791",
"reference_id": "REFERENCE_ID",
"status": "succeeded",
"token_id": "TOKEN_ID",
"activity_id": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b",
"transaction_hash": "0x6890c450a43e6f3e90b311e2c0e80e1e6880cbc93ab977fc5357ac66cd255800",
"updated_at": "2024-02-12T05:35:35.743242Z"
}
]
}
Error handling
The following tables details some of the errors that can occur when using the Minting API
Minting API request errors
The following errors can occur when making a Minting API call.
If these errors occur no event will be visible in Immutable's Blockchain Data API as the request would not have been accepted
Request validation errors
Cause | Example Error Message | Type | Code |
---|---|---|---|
>100 mints in a single request | request body has an error: doesn't match schema #/components/schemas/CreateMintRequestRequest: Error at \"/assets\": maximum number of items is 100 | VALIDATION_ERROR | 400 |
Duplicate reference_id in the request | duplicated reference id: 109 | VALIDATION_ERROR | 400 |
Duplicate token_id in the request | duplicated token id: 109 | VALIDATION_ERROR | 400 |
request reference_id already exists | there are already mint requests for reference_ids: 109 | VALIDATION_ERROR | 400 |
request with token_id already exists | there are already mint requests for token_ids: 109 | CONFLICT | 409 |
token_id already minted | token_ids already minted: 109 | CONFLICT | 409 |
Request authentication errors
Cause | Example Error Message | Type | Code |
---|---|---|---|
Incorrect API key | security requirements failed: API key is invalid | UNAUTHORISED_REQUEST | 401 |
Collection and API keys associated with different environments | API Key is not allowed to access this collection | AUTHENTICATION_ERROR | 403 |
Minting API not enabled for API key | API Key is not sponsored | AUTHENTICATION_ERROR | 403 |
Rate limit exceeded | Too many requests | TOO_MANY_REQUESTS_ERROR | 429 |
Minting API Idempotency
Networks can have issues and a client might not receive a response, even though the mint request was accepted successfully. To make sure we never process a mint request twice we don't accept the same reference_id
twice.
In case of network failure you can safely re-submit any requests that you aren't sure have been accepted. If the Minting API has already processed a reference_id
you will get a 409 Conflict
error with the following body:
{
code: "CONFLICT",
message: "there are already mint requests for reference_ids: 100",
details: {
id: "reference_id",
values: ["100"]
}
}
Minting API transaction errors
The following errors can occur after making a Minting API call.
These errors occur once a Blockchain Data API event has been triggered. They are visible from the mint request polling endpoint or the imtbl_zkevm_mint_request_updated webhook event.
Request validation errors
Cause | Example Error Message | Recommended Action |
---|---|---|
Minter role of collection not granted to Minting API | transaction failed to build: execution reverted: AccessControl: account 0x7ca12c6843adddbccdeb0efdf69a01028e274a70 is missing role 0x4d494e5445525f524f4c45000000000000000000000000000000000000000000 | Grant minter role to Minting API and try the request again. |
Minting API failed to submit transaction | Exceeded a maximum of 5 submissions | Submit request again |
Request access to Minting API on Mainnet
Complete the following steps to request Minting API access on Mainnet. During our initial launch period mainnet access is available to partners that have a contract with Immutable.
- Log into Immutable Hub, and locate "Help" on the bottom left of your menu
- Here locate and click on "Minting API on Mainnet"
- Follow the prompts and fill in the application details to join our Waitlist