> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-wallets-docs-2-5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Purchases of Multiple NFTs

> Allow users to purchase multiple NFTs in a single order

<Note>
  If you are using our previous version of embedded checkout, please refer to the [old multiple NFT purchases
  guide](/payments/v2/advanced/selling-multiple-nfts)
</Note>

You can enable users to purchase multiple NFTs in a single transaction using either `CrossmintEmbeddedCheckout` or `CrossmintPayButton`:

<Tabs>
  <Tab title="Hosted Checkout">
    <Tabs>
      <Tab title="Primary Sales">
        ```tsx theme={null}
        <CrossmintProvider apiKey="_YOUR_CLIENT_API_KEY_">
          <CrossmintHostedCheckout
            lineItems={[
              {
                collectionLocator: "crossmint:_YOUR_COLLECTION_ID_",
                callData: {
                  totalPrice: "0.001",
                  _quantity: 1, // matches your contract's parameter name
                }
              },
              {
                collectionLocator: "crossmint:_YOUR_COLLECTION_ID_",
                callData: {
                  totalPrice: "0.002", 
                  _quantity: 2,
                }
              }
            ]}
          />
        </CrossmintProvider>
        ```

        <Note>For EVM contracts, ensure the attribute name in `callData` matches the parameter name in your mint function. For example: If your mint function has the signature: `mintTo(address _to, uint256 _amount)` then use `_amount` instead of `quantity`.</Note>
      </Tab>

      <Tab title="Marketplaces - EVM">
        ```tsx theme={null}
        <CrossmintProvider apiKey="_YOUR_CLIENT_API_KEY_">
          <CrossmintHostedCheckout
            lineItems={[
              {
                tokenLocator: "ethereum:0xbC…307e:7777",
                callData: {
                  totalPrice: "0.1"
                }
              },
              {
                tokenLocator: "ethereum:0x17…e54D:8888",
                callData: {
                  totalPrice: "0.2"
                }
              }
            ]}
          />
        </CrossmintProvider>
        ```
      </Tab>

      <Tab title="Marketplaces - Solana">
        ```tsx theme={null}
        <CrossmintProvider apiKey="_YOUR_CLIENT_API_KEY_">
          <CrossmintHostedCheckout
            lineItems={[
              {
                tokenLocator: "solana:4oDd…x6NC",
                callData: {
                  totalPrice: "0.1",
                  buyerCreatorRoyaltyPercent: 100
                }
              },
              {
                tokenLocator: "solana:J2vX…cuNo",
                callData: {
                  totalPrice: "0.2",
                  buyerCreatorRoyaltyPercent: 100
                }
              }
            ]}
          />
        </CrossmintProvider>
        ```
      </Tab>
    </Tabs>

    <Note>All line items must use the same `collectionLocator` and be on the same blockchain.</Note>
  </Tab>

  <Tab title="Embedded Checkout">
    <Tabs>
      <Tab title="Primary Sales">
        ```tsx theme={null}
        <CrossmintProvider apiKey="_YOUR_CLIENT_API_KEY_">
          <CrossmintEmbeddedCheckout
            lineItems={[
              {
                collectionLocator: "crossmint:_YOUR_COLLECTION_ID_",
                callData: {
                  totalPrice: "0.001",
                  _quantity: 1, // matches your contract's parameter name
                }
              },
              {
                collectionLocator: "crossmint:_YOUR_COLLECTION_ID_",
                callData: {
                  totalPrice: "0.002", 
                  _quantity: 2,
                }
              }
            ]}
          />
        </CrossmintProvider>
        ```

        <Note>For EVM contracts, ensure the attribute name in `callData` matches the parameter name in your mint function. For example: If your mint function has the signature: `mintTo(address _to, uint256 _amount)` then use `_amount` instead of `quantity`.</Note>
      </Tab>

      <Tab title="Marketplaces - EVM">
        ```tsx theme={null}
        <CrossmintProvider apiKey="_YOUR_CLIENT_API_KEY_">
          <CrossmintEmbeddedCheckout
            lineItems={[
              {
                tokenLocator: "ethereum:0xbC…307e:7777",
                callData: {
                  totalPrice: "0.1"
                }
              },
              {
                tokenLocator: "ethereum:0x17…e54D:8888",
                callData: {
                  totalPrice: "0.2"
                }
              }
            ]}
          />
        </CrossmintProvider>
        ```
      </Tab>

      <Tab title="Marketplaces - Solana">
        ```tsx theme={null}
        <CrossmintProvider apiKey="_YOUR_CLIENT_API_KEY_">
          <CrossmintEmbeddedCheckout
            lineItems={[
              {
                tokenLocator: "solana:4oDd…x6NC",
                callData: {
                  totalPrice: "0.1",
                  buyerCreatorRoyaltyPercent: 100
                }
              },
              {
                tokenLocator: "solana:J2vX…cuNo",
                callData: {
                  totalPrice: "0.2",
                  buyerCreatorRoyaltyPercent: 100
                }
              }
            ]}
          />
        </CrossmintProvider>
        ```
      </Tab>
    </Tabs>

    <Note>All line items must use the same `collectionLocator` and be on the same blockchain.</Note>
  </Tab>
</Tabs>

***

### FAQ

<AccordionGroup>
  <Accordion title="What happens if some of the transactions fail?">
    **Fiat purchases** <br />
    When a user submits an order, Crossmint puts a hold on their credit card and attempts the purchase of the NFTs. If the transaction fails, the funds are released instantly (though it may take some time to be reflected on the bank statement) so the customer is never charged.

    If an order results in a mix of successful and failed purchase attempts, Crossmint will only charge for the transactions that went through and return the rest instantly. Users will receive an email receipt with the final transaction amount.<br /><br />
    **Crypto purchases**<br />
    If a transaction fails, Crossmint will return the full amount to the buyer. Any gas fees incurred will be subsidized by Crossmint.
  </Accordion>

  {" "}

  <Accordion title="Do all NFTs must be on the same blockchain?">
    Yes, all NFTs in a single order must be on the same blockchain.
  </Accordion>
</AccordionGroup>
