Collection Registration API

Register and update contracts programmatically with the /collections endpoint.

📘

API access only available upon request. Reach out to get started.

Register collections

import fetch from 'node-fetch';

const body = {
  "chain": "ethereum",
  "contractType": "erc-721",
  "args": {
    "contractAddress": "<CONTRACT_ADDRESS>",
    "abi": <ABI_GOES_HERE>,
    "toParamName": "_to",
    "quantityParamName": "amount", // The quantity parameter is optional
    "contractType": "erc-721",
    "mintFunctionName": "crossmint(address,uint256)"
  },
  "metadata": {
    "title": "Test Create Collection API",
    "description": "Test Description",
    "imageUrl": "https://www.crossmint.com/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": {
      "twitter": "",
      "discord": ""
    }
  }
};

const response = await fetch('https://staging.crossmint.com/api/v1-alpha1/collections', {
  method: 'POST',
  body: JSON.stringify(body),
  headers: {
    'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
    'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
const collectionId = data.collectionId;
import fetch from 'node-fetch';

const body = {
  "chain": "ethereum",
  "contractType": "erc-1155",
  "args": {
    "contractAddress": "<CONTRACT_ADDRESS>",
    "abi": <ABI_GOES_HERE>,
    "toParamName": "_to",
    "quantityParamName": "amount", // The quantity parameter is optional
    "contractType": "erc-1155",
    "mintFunctionName": "crossmint(address,uint256)"
  },
  "metadata": {
    "title": "Test Create Collection API",
    "description": "Test Description",
    "imageUrl": "https://www.crossmint.com/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": {
      "twitter": "",
      "discord": ""
    }
  }
};

const response = await fetch('https://staging.crossmint.com/api/v1-alpha1/collections', {
  method: 'POST',
  body: JSON.stringify(body),
  headers: {
    'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
    'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
const collectionId = data.collectionId;
curl -v 'https://www.crossmint.com/api/v1-alpha1/collections' \
  -X 'POST' \
  -H 'X-PROJECT-ID: <YOUR_CLIENT_ID>' \
  -H 'X-CLIENT-SECRET: <YOUR_CLIENT_SECRET>' \
  -H "Content-Type: application/json" \
  --data-binary @- << EOF
{ 
  "chain": "solana",
  "contractType": "candy-machine",
  "args": {
    "candyMachineId": 
  },
  "metadata": {
    "title": "Bored Ape Yacht Club",
    "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs grating access to the Yacht Club community",
    "imageUrl": "https://www.crossmint.com/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": {
      "twitter": "@twitter_handle",
      "discord": "discord.gg/servername"
    }
  }
}
import fetch from 'node-fetch';

const body = {
  "chain": "solana",
  "contractType": "candy-machine",
  "args": {
    "candyMachineId": "string" // replace with a valid candy machine id
  },
  "metadata": {
    "title": "<COLLECTION_NAME>",
    "description": "<COLLECTION_DESCRIPTION>",
    "imageUrl": "https://www.crossmint.com/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": { // optional
      "twitter": "@crossmint", // optional
      "discord": "discord.gg/servername" // optional
    }
  }
};

const response = await fetch('https://staging.crossmint.com/api/v1-alpha1/collections', {
  method: 'POST',
  body: JSON.stringify(body),
  headers: {
    'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
    'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
const collectionId = data.collectionId;
import fetch from 'node-fetch';

const body = {
    "chain": "ethereum",
    "contractType": "thirdweb-drop",
    "args": {
        "contractAddress": "<CONTRACT_ADDRESS>"
    },   
    "metadata": {
        "title": "<COLLECTION_NAME>",
        "description": "<COLLECTION_DESCRIPTION>",
        "imageUrl": "<COLLECTION_IMAGE_URL>",
        "social": // optional
        {
            "twitter": "", // optional
            "discord": ""  // optional
        }
    }

}

const response = await fetch('https://staging.crossmint.com/api/v1-alpha1/collections', {
  method: 'POST',
  body: JSON.stringify(body),
  headers: {
    'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
    'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
const collectionId = data.collectionId;

Update collections

import fetch from 'node-fetch';

const body = {
  "collectionId": "<COLLECTION_ID>",
  "metadata": {
    "title": "Bored Ape Yacht Club",
    "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs grating access to the Yacht Club community",
    "imageUrl": "https://www.crossmint.com/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": {
      "twitter": "@twitter_handle",
      "discord": "discord.gg/servername"
    }
  }
};

const response = await fetch('https://staging.crossmint.com/api/v1-alpha1/collections', {
  method: 'PUT',
  body: JSON.stringify(body),
  headers: {
    'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
    'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>',
    'Content-Type': 'application/json'
  }
});
curl 'https://www.crossmint.com/api/v1-alpha1/collections' \
  -X 'PUT' \
  -H 'X-PROJECT-ID: <YOUR_PROJECT_ID>' \
  -H 'X-CLIENT-SECRET: <YOUR_CLIENT_SECRET>' \
  -H "Content-Type: application/json" \
  --data-binary @- << EOF
{
  "collectionId": "<COLLECTION_ID>",
  "metadata": {
    "title": "Bored Ape Yacht Club",
    "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs grating access to the Yacht Club community",
    "imageUrl": "https://www.crossmint.com/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": {
      "twitter": "@twitter_handle",
      "discord": "discord.gg/servername"
    }
  }
}
EOF

> {"collectionId":"557e0bbc-d51f-48f9-a3a1-36ea45324514"}