When minting NFTs from a collection with multiple templates, you can specify which template to mint to using your Crossmint integration. This feature must be explicitly enabled in the Crossmint Console.
This gives you control over exactly which template gets minted when processing a purchase, rather than relying on random template selection.
If template-specific minting is disabled for your collection and you pass a template ID in the collection locator,
the request will fail with an error. Make sure to enable this feature in the Console before using template IDs.
To see all your available templates, navigate to the “NFTs” section in the Console for your managed collection.
You can also get all your available templates for a collection using the NFT Template API.
Once enabled, specify which template to mint by adding the template ID to your collection locator. The collection locator format without templateId is:
Copy
crossmint:<collectionId>
and with templateId is:
Copy
crossmint:<collectionId>:<templateId>
The templateId portion is optional with mint to specific template enabled. If omitted, the system will use your collection’s default minting behavior.
Here’s how to implement template minting in your integration:
Add the template ID to your collection locator string:
Copy
<CrossmintProvider apiKey={clientApiKey}> <CrossmintEmbeddedCheckout lineItems={{ // For a specific template: collectionLocator: `crossmint:${collectionId}:${templateId}`, // Or for random template selection: // collectionLocator: `crossmint:${collectionId}`, callData: { totalPrice: "0.001", quantity: 1, }, }} /></CrossmintProvider>
Add the template ID to your collection locator string:
Copy
<CrossmintProvider apiKey={clientApiKey}> <CrossmintEmbeddedCheckout lineItems={{ // For a specific template: collectionLocator: `crossmint:${collectionId}:${templateId}`, // Or for random template selection: // collectionLocator: `crossmint:${collectionId}`, callData: { totalPrice: "0.001", quantity: 1, }, }} /></CrossmintProvider>
Add the template ID to your collection locator string when creating an order:
Copy
{ "payment": { "method": "stripe-payment-element" // or your preferred payment method }, "lineItems": { // For a specific template: "collectionLocator": "crossmint:<collectionId>:<templateId>", // Or for random template selection: // "collectionLocator": "crossmint:<collectionId>", "callData": { "totalPrice": "0.001" } }}