🔒 Collection Registration API

Dynamically register a collection using Crossmint's Whitelabel API

Utilize the /collections endpoint in Crossmint's Whitelabel API to accept credit card or crypto payments for an NFT collection (such as Solana Candy Machines, Ethereum ERC721, ...) using Crossmint, you must first register it under your developer account.

You can do so manually from the Crossmint Console, but you can also do so programmatically using the collection registration API. We provide two endpoints for this: one for creating a collection, and another for updating your existing collections.

📘

Crossmint collection creation API is an enterprise solution and requires evaluation of your use case before approval. Reach out to reach out to sales to get started.

Register your NFT collection with crossmint:

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.io/_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.io/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-721",
  "args": {
    "contractAddress": "0xa88aA555A6c138dE6766f2e26c6f3bD1Bf2C12A2",
    "mintFunction": {"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"crossmint","outputs":[],"stateMutability":"payable","type":"function"},
    "toAddressMintArg": "_to",
    "contractType": "erc-721"
  },
  "metadata": {
    "title": "Test Create Collection API",
    "description": "Test Description",
    "imageUrl": "https://www.crossmint.io/_next/image?url=%2Fassets%2Fcrossmint%2Flogo.png&w=48&q=75",
    "social": {
      "twitter": "",
      "discord": ""
    }
  }
};

const response = await fetch('https://www.crossmint.io/api/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.io/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.io/_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"}
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.io/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 your collection information registered on Crossmint:

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.io/_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.io/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.io/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.io/_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"}