Buy API Integration Guide
This guide explains how to use Crossmint’s headless checkout APIs to enable purchases for any asset listed onchain in the supported marketplaces below. Unlike regular Crossmint checkout integrations, this API can be used without previously registering a collection in the Crossmint console.Overview
The secondaries marketplace integration allows you to purchase NFTs listed on supported secondaries marketplacesSupported Marketplaces
Integration Steps
1. Create an Order
To create an order for secondaries marketplace purchases, you’ll need to specify the NFTs you want to purchase using thelineItems array, as you would in normal headless, but instead of using collectionLocator you will use tokenLocator. Each line item should include:
tokenLocatorIdentifies the NFT’s location (contract address or mint hash)
tokenLocator follows this format:
-
For EVM chains (Ethereum, Polygon, etc):
<blockchain>:<contractAddress>:<tokenId>- Example:
ethereum:0x1234...5678:123 blockchain: The chain name (ethereum, polygon, etc)contractAddress: The NFT contract addresstokenId: The specific token ID to purchase
- Example:
-
For Solana:
solana:<mintHash>- Example:
solana:7nE9...X4p5 mintHash: The NFT’s mint hash/address
- Example:
Token Locator Format Requirements
EVM Chain Format
- Pattern:
^(ethereum|polygon|optimism|arbitrum|base|zora|avalanche|bsc):[0-9a-fA-F]{40}:\d+$ - Contract Address: Must be 40 hexadecimal characters (without ‘0x’ prefix)
- Token ID: Must be a valid integer
- Chain names are case-sensitive and must be lowercase
- Maximum total length: 128 characters
Solana Format
- Pattern:
^solana:[1-9A-HJ-NP-Za-km-z]{32,44}$ - Mint Hash: Must be a valid base58-encoded string
- Chain name must be lowercase “solana”
- Maximum total length: 64 characters
- Incorrect chain name spelling or casing
- Invalid contract address length or characters
- Missing or malformed token ID
- Invalid Solana mint hash format
- Creating an order to purchase an NFT from a marketplace
- Using cross-chain payment (paying with SOL for an NFT on Arbitrum)
- Specifying an email recipient for delivery
- Using the
tokenLocatorformat for marketplace purchases

