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

# Quickstart

> Mint and send an NFT in under 5 minutes

## Prerequisites

<Steps>
  <Step icon="circle-dot" iconType="duotone" title="API Key with correct scope">
    Refer to the [Create an API Key
    Guide](/api-reference/introduction#create-an-api-key) and the [API
    Keys](/introduction/platform/api-keys) page for more information.

    Ensure your API Key has the `nfts.create` scope enabled.
  </Step>

  <Step icon="circle-dot" iconType="duotone" title="Complete API Reference Introduction">
    Follow the [API Playground
    Guide](/api-reference/introduction#use-the-api-playground) to setup
    authentication, create a user wallet, and mint an NFT to it using the API Playground.
  </Step>
</Steps>

## Mint an NFT

If you followed the API Playground Guide in the prerequisites you already minted an NFT right here in the browser. This next section will show you how to mint an NFT using the API directly with javascript.

<Steps>
  <Step title="Copy the javascript code below:">
    Save to a file on your local machine named: `mint-nft.js`.

    ```javascript mint-nft.js theme={null}
    const url =
      "https://staging.crossmint.com/api/2022-06-09/collections/default-polygon/nfts";
    const options = {
      method: "POST",
      headers: {
        accept: "application/json",
        "content-type": "application/json",
        "x-api-key": "YOUR_API_KEY",
      },
      body: JSON.stringify({
        recipient: "email:YOUR_EMAIL_ADDRESS:polygon",
        metadata: {
          name: "Crossmint Test NFT",
          image:
            "https://bafkreiexjl6kw4khdxkrt6dojgacscnzvrys47t472l2t7d6r2ss65kifq.ipfs.nftstorage.link/",
          description: "Created with the Crossmint minting API",
        },
      }),
    };

    fetch(url, options)
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch((err) => console.error("error:" + err));
    ```
  </Step>

  <Step title="Edit file to include your API key:">
    Change the `YOUR_API_KEY` value to your API key.

    You should also adjust the `YOUR_EMAIL_ADDRESS` value to your email address so you can login to see the NFT at <a href="https://staging.crossmint.com/user/collection" target="_blank">[https://staging.crossmint.com/user/collection](https://staging.crossmint.com/user/collection)</a> when completed.
  </Step>

  <Step title="Run the file from your terminal">
    ```bash theme={null}
    node mint-nft.js
    ```

    You should get a response like this:

    <CodeGroup>
      ```json JSON theme={null}
      {
        "id": "7402007c-4e30-4fba-a769-60e7b513086e",
        "onChain": {
          "status": "pending",
          "chain": "polygon",
          "contractAddress": "0x67a602CBb306b3DBaaC7ECf55b72EED0E04Dc785"
        },
        "actionId": "7402007c-4e30-4fba-a769-60e7b513086e"
      }
      ```

      ```javascript terminal theme={null}
      {
        id: '7402007c-4e30-4fba-a769-60e7b513086e',
        onChain: {
          status: 'pending',
          chain: 'polygon',
          contractAddress: '0x67a602CBb306b3DBaaC7ECf55b72EED0E04Dc785'
        },
        actionId: '7402007c-4e30-4fba-a769-60e7b513086e'
      }
      ```
    </CodeGroup>

    Take note of the `id` returned as it is used in the next step to retrieve the status of the minting.
  </Step>

  <Step title="Get mint status">
    Create another file in the same directory as above named `get-mint-status.js` and copy the following code into it:

    ```javascript get-mint-status.js theme={null}
    const options = {
      method: 'GET',
      headers: {
        "x-api-key": "YOUR_API_KEY",
      }
    };

    fetch('https://staging.crossmint.com/api/2022-06-09/collections/default-polygon/nfts/7402007c-4e30-4fba-a769-60e7b513086e', options)
      .then(response => response.json())
      .then(response => console.log(response))
      .catch(err => console.error(err));
    ```

    Once again, ensure you replace the `YOUR_API_KEY` value with your API key.
  </Step>

  <Step title="Run the file from your terminal">
    ```bash theme={null}
    node get-mint-status.js
    ```

    You should get a response like this:

    <CodeGroup>
      ```json JSON theme={null}
      {
          "id": "7402007c-4e30-4fba-a769-60e7b513086e",
          "metadata":
          {
              "name": "Crossmint Test NFT",
              "image": "ipfs://QmVhAkiT3XCPQUaZKHootfEfixmKVqSiq5Y7uVPZyFGQXw",
              "description": "Created with the Crossmint minting API"
          },
          "onChain":
          {
              "status": "success",
              "tokenId": "5",
              "owner": "0x0359Cd99FD20e853a85489DFC93EaDFeF7461590",
              "txId": "0x730e92a62ae53393ffc9ce743e0e738ccb92b74331570dd5333556222ed47b22",
              "contractAddress": "0x67a602CBb306b3DBaaC7ECf55b72EED0E04Dc785",
              "chain": "polygon"
          },
          "action": "https://staging.crossmint.com/api/2022-06-09/actions/7402007c-4e30-4fba-a769-60e7b513086e"
      }
      ```

      ```javascript terminal theme={null}
      {
        id: '7402007c-4e30-4fba-a769-60e7b513086e',
        metadata: {
          name: 'Crossmint Test NFT',
          image: 'ipfs://QmVhAkiT3XCPQUaZKHootfEfixmKVqSiq5Y7uVPZyFGQXw',
          description: 'Created with the Crossmint minting API'
        },
        onChain: {
          status: 'success',
          tokenId: '5',
          owner: '0x0359Cd99FD20e853a85489DFC93EaDFeF7461590',
          txId: '0x730e92a62ae53393ffc9ce743e0e738ccb92b74331570dd5333556222ed47b22',
          contractAddress: '0x67a602CBb306b3DBaaC7ECf55b72EED0E04Dc785',
          chain: 'polygon'
        },
        action: 'https://staging.crossmint.com/api/2022-06-09/actions/7402007c-4e30-4fba-a769-60e7b513086e'
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="View the NFT">
    Visit <a href="https://staging.crossmint.com/user/collection" target="_blank">[https://staging.crossmint.com/user/collection](https://staging.crossmint.com/user/collection)</a> and login with the email address you used in the first step.

    You should see your NFT in the collection.

    You can also take the `txId` returned in the response and find your transaction on the block explorer. This example uses <a href="https://amoy.polygonscan.com/" target="_blank">Polygon's Amoy testnet</a>. Simply enter the transaction id in the search bar and you should see your NFT transaction.
  </Step>
</Steps>

## Ready for More?

Explore the API reference to learn more about the NFT minting APIs. Be sure to checkout the [API Playground Guide](/api-reference/introduction#use-the-api-playground) to get comfortable testing the APIs out right in your browser.

<CardGroup cols={2}>
  <Card title="Collections APIs" icon="layer-group" href="/api-reference/minting/collection">
    The first step to minting NFTs is to create a collection
  </Card>

  <Card title="Templates APIs" icon="copy" href="/api-reference/minting/template">
    Templates represent the structure of your NFTs, create and edit them with APIs
  </Card>

  <Card title="Minting APIs" icon="hexagon-plus" href="/api-reference/minting/nfts">
    With your collection and template configured you can mint NFTs with APIs
  </Card>

  <Card title="Edit APIs" icon="pencil" href="/api-reference/minting/nfts/edit-nft">
    Fix mistakes or evolve the metadata of your NFTs with APIs
  </Card>
</CardGroup>
