Crossmint NFT Checkout via Credit Card
Last updated
Was this helpful?
Last updated
Was this helpful?
The Crossmint integration with XION enables a seamless, credit card based NFT checkout experience. This is ideal for onboarding non-crypto native users into platforms where NFT assets are used, such as games, marketplaces, or digital collectibles.
To import a custom NFT contract into the Crossmint platform, your contract must follow the specific requirements outlined . These guidelines ensure compatibility with Crossmint’s infrastructure.
To get started, create a Crossmint staging account so you can test the integration in a sandbox environment.
Go to and click the "Console" button in the site header
You will be taken to the Signin page. Make sure "Staging" is selected and then enter your sign in details
If you're new, you'll be guided through the account creation process
Once your account is created you will be asked to create your first project
Once your project is created you will be taken to your console's overview page
From the sidebar, click "Integrate", then click "API Keys".
A server key is intended for backend (server-side) applications and should not be used in frontend code, as doing so will result in CORS (Cross-Origin Resource Sharing) errors. In this guide, we will not be using a server key since we’re building a frontend application that interacts with the Crossmint API.
To create one, click “Create new key” under the “Server-side keys” section in the Crossmint Console.
Click the "Create new key" button under the "Client-side keys" section. Select the following scope to enable order execution via Crossmint’s checkout:
orders.create
Then click "Save client key" Your client key will now appear in the client key list.
To create your collection, follow these steps:
Click the "Token collections" link in the menu sidebar and then click the "New collection" button
Enter the collection information and click "Next"
On the "Create or import your collection contract" step select "Create a new contract" and then click "Next". If you have your own custom NFT contract select "Import an existing contract"
On the "What do you want to do with this collection?" section select "Sell NFTs" and click "Next"
On "Choose a chain" select "Xion" and click "Next"
On "Payment settings" enter a price for the collection, select who pays the fees and enter an address that will receive the revenue from sales
Review details and click the "Create collection" button to complete the process
On the "Token collections" page select the collection created above. The NFTs tab is selected by default, click "manual upload" and in the window that pops up enter the NFT information.
Click the "Create NFT" button when done.
Click the "Checkout" tab and make sure the "NFT Price" and "Recipient address" are filled in and then click "Save changes".
Also make sure "Enable Credit Card payments" is enabled under "Payment methods".
Before integrating the Abstraxion SDK into the application, we first need to deploy a Treasury Contract. This contract facilitates gasless transactions for your smart contract by handling fee grants on behalf of users as well as allowing users to grant authorization(s) to your app to execute certain transactions on their behalf.
Click the "New Treasury" button to create a new treasury contract instance.
Select the appropriate configurations. The default "Fee Grant (Allowance)" and "Grant Config (Permission)" should be enough for this application.
You will then copy the treasury contract address which will be required in the frontend setup below.
You will first need to clone the repository:
After doing so you will have to change into the newly created directory and then execute the steps below.
Install dependencies:
Copy the .env.example
file and name it .env.local
and set the values with the correct information:
NEXT_PUBLIC_TREASURY_ADDRESS
Treasury address used for gasless transactions and grantz authorization
NEXT_PUBLIC_RPC_URL
RPC endpoint for Xion (default: https://rpc.xion-testnet-2.burnt.com:443
)
NEXT_PUBLIC_REST_URL
REST endpoint for Xion (default: https://api.xion-testnet-2.burnt.com
)
NEXT_PUBLIC_CROSSMINT_API_KEY
Crossmint API key (https://www.crossmint.com/console)
Update collection list:
This list contains the NFT contract addresses and their corresponding collection IDs that users will be able to purchase.
Open the src/app/collections.json
file and add your collections using the following format:
You can find the collection ID on the listing page for each collection. To copy it, simply click the copy icon next to the desired collection ID.
To find the NFT contract click on the collection and then click the "Smart contract" tab and copy the smart "Contract address".
Build and start the application:
If you want to test Crossmint’s APIs using their , you’ll need to generate a server key to authorize your requests.
The Crossmint team has enabled the creation of NFT collections directly within the Console. These collections are based on the contract. You can also import a custom NFT contract, as long as it is built on the standard.
Login to the .
We've created a frontend which is a application built to interact with the NFT smart contract created by the Crossmint platform. The frontend app can be downloaded at . It showcases how users can connect their wallets and purchase NFTs via Crossmint's hosted checkout solution.
You can now access the app at in your browser.
Crossmint API Reference Full documentation for all Crossmint API endpoints and capabilities.
Quickstart: Add a Pay Button A simple guide to help you quickly add Crossmint's checkout button to your frontend.
Importing a Custom NFT Contract on XION Requirements and steps for registering your own CW721-based contract with Crossmint.
Enable Multi-NFT Checkout in a Single Order Learn how to allow users to purchase multiple NFTs at once via a single Crossmint transaction.