NFT Multi-Buy

Anyone that is selling with Crossmint can sell multiple NFTs in a single transaction.

How do Multi-NFT purchases work?

This enables the user to purchase multiple NFTs in the same order, even if that purchase would normally require multiple transactions in the blockchain.

Users will only be charged for the NFTs that are successfully purchased. So for example, if a user is trying to purchase 4 NFTs, but one of them was purchased by someone else during the order flow, the user will only be charged for 3 out of the 4 that were successfully delivered.

How do I use this?

This depends on whether you are doing a primary or secondary sale.


Primary Sale Contracts

For a primary sale contract, you just have to add a parameter quantity to the mintConfig since we know these are coming from the same collection.

Example:

<crossmint-pay-button
  clientId="_YOUR_CLIENT_ID_"
  environment="_ENVIRONMENT_"
  mintConfig='{
    "type": "candy-machine",
    "quantity": 5
  }'
/>
<crossmint-pay-button
  clientId="_YOUR_CLIENT_ID_"
  environment="_ENVIRONMENT_"
  mintConfig='{
    "type": "candy-machine",
    "quantity": 5
  }'
/>

Caveat for primary sales:

For EVM contracts the actual attribute name must be the same as the parameter name in your mint function. For example: If your mint function has the signature:
mintTo(address _to, uint256 _amount) then the attribute you set in the mintConfig must be _amount instead of quantity.

Secondary Sale Contracts

For secondary sale contracts, simply group the NFTs in your transaction into an array.


Solana Example

Without multi-NFT:

mintConfig: {
  "mintHash":"4oDd…x6NC",
  "buyerCreatorRoyaltyPercent":100,
  "type":"solana-secondary"
}

With multi-NFT:

mintConfig: [{
  "mintHash":"4oDd…x6NC",
  "buyerCreatorRoyaltyPercent":100,
  "type":"solana-secondary"
},{
  "mintHash":"J2vX…cuNo",
  "buyerCreatorRoyaltyPercent":100,
  "type":"solana-secondary"
},{
  "mintHash":"ARn8…AiAG",
  "buyerCreatorRoyaltyPercent":100,
  "type":"solana-secondary"
}]

ETH Example

Without multi-NFT:

mintConfig: {
  "type":"secondary-eth",
  "contractAddress":"0x17…e54D",
  "tokenId":"7777"
}

With multi-NFT:

mintConfig: [{
  "type":"secondary-eth",
  "contractAddress":"0xbC…307e",
  "tokenId":"7777"
},{
  "type":"secondary-eth",
  "contractAddress":"0x17…e54D",
  "tokenId":"8888"
}]

FAQ

QuestionAnswer
Does the type need to be the same for all NFTs in a group?Yes, you will want to ensure that the type is the same, to verify that the NFTs in your list are the ones you intended.
Does the blockchain need to be the same for all NFTs in a group?Yes. Since the blockchain is tied to the clientId, a top-level attribute for the Crossmint button, all NFTs in a transaction need to be part of the same blockchain. This will change and become more flexible as we continue to make improvements to our APIs, so let us know if this would be of interest to you.
How many NFTs can be grouped into a single order?We currently have a practical limit of 5 in place to avoid bottlenecks when executing the transaction
Contact our Support Team if this limit is a problem for you.
If one NFT fails to deliver or purchase in a group purchase, what happens?We will automatically handle the failure for the buyer by only charging them for what we can deliver. An example of when this may happen is if someone else purchased the same NFT before the user’s purchase was able to complete. Our buyer in this example would receive receipts via email with information about these outcomes.