XION
DiscordGithub
  • Welcome to XION
  • XION'S Core
    • Concepts
      • Generalized Chain Abstraction
      • Intro to Account Abstraction
      • XION's Meta Accounts
      • Meta Accounts Design
      • Architecture & Tech Glossary
      • Use Cases
  • developers
    • XION Quick Start
      • Zero to App in 5 Minutes
        • Launch a User Map App on XION in 5 Minutes
        • React Native Mobile App on XION in 5 Minutes
    • Mobile App Development
      • Set up your XION Mobile Development Environment
      • Create Mobile App and Integrate Meta Account Authentication
      • Building a React Native Mobile App with Abstraxion (Xion.js)
    • Getting Started (Advanced)
      • Set Up Local Environment
        • Setting up your Local Smart Contract Development Environment for XION
          • Setting up your XION Smart Contract Development Environment on Windows (WSL2 + Ubuntu)
        • Set Up an Integrated Development Environment (IDE)
        • Interacting with Xion Chain using Xion Daemon
      • Your First Contract
        • Deploying Your First Smart Contract on XION
      • Gasless UX & Permission Grants
        • Enabling Gasless Transactions with Treasury Contracts
      • App Development
        • Account Abstraction with Gasless Transactions
        • Interact with XION via your Backend Service
    • Re-using Existing Contracts
      • Deployed Contracts on XION
      • Non-Fungible Tokens (NFTs)
      • Fungible Tokens
      • Marketplace
      • Multisig
      • Proxy Contracts
      • Membership Management
      • Governance
      • Valuts
      • SCV Audited Contracts
    • Web3 for Web2 Developers
      • Web2 vs Web3 App Architecture: A Comparison
      • Misconceptions and Misapplied Web2 Patterns
      • Recommended Architecture for Apps on XION
    • Building for Mainnet
      • Xion Testnet: Your Development Playground
      • Building with Audited & Battle-Tested Contracts
      • Community Engagement: Building Support for Your app
      • Deploying to Xion Mainnet
        • Smart Contract Audits: Process, Costs & Support
        • Governance Process to Deploying Smart Contracts to Mainnet
    • Learn & Build
      • Token Factory
        • Creating, Minting, and Interacting with a Token Factory Token
        • Building a React dApp to Interact with Token Factory Tokens
        • Integrating a Token Factory Token in a Smart Contract
      • Websockets
        • WebSockets with Xion: Real-Time Communication
      • Oracles
        • Creating a Smart Contract with Pyth Oracle Integration
      • Indexers: Optimized Data Retrieval
        • SubQuery
      • Use Cases
        • Building a Per-User Data Storage App
        • Build a TODO App using the Collection-Document Storage Smart Contract
      • Crossmint Integration
        • Crossmint NFT Checkout via Credit Card
    • Reference and Resources
      • Requesting XION Testnet Tokens
      • Public Endpoints & Resources
      • Block Explorers
      • Governance
        • Deploying Smart Contracts to Mainnet
      • Developer Tools: Abstract
      • IBC Denoms on XION Networks
      • Frequently Asked Questions
      • XION Token Contract Addresses on EVM Chains
  • Nodes & Validators
    • Run a Node
      • System Specifications
      • Build the Xion Daemon
      • Download the Xion Daemon
      • Configure the Xion Daemon
        • app.toml
        • client.toml
        • config.toml
      • Join the XION Network
        • xion-testnet-1
      • Confirm node is running
    • Become a Validator
      • Initial Setup
      • Obtain a XION Wallet Address
      • Obtain Funds
        • Testnet
      • Create Validator
    • IBC Relayers and Tokens
  • Others
    • Resources
Powered by GitBook
On this page
  • Crossmint Staging Environment
  • Create API Key
  • Create Collection
  • Create an NFT
  • Update Checkout Settings
  • Deploy a Treasury Contract
  • Steps to Deploy a Treasury Contract
  • Building the Frontend
  • Manual Installation
  • Additional Resources

Was this helpful?

Edit on GitHub
  1. developers
  2. Learn & Build
  3. Crossmint Integration

Crossmint NFT Checkout via Credit Card

PreviousCrossmint IntegrationNextReference and Resources

Last updated 15 hours ago

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.

Crossmint Staging Environment

To get started, create a Crossmint staging account so you can test the integration in a sandbox environment.

  1. Go to and click the "Console" button in the site header

  1. You will be taken to the Signin page. Make sure "Staging" is selected and then enter your sign in details

  1. If you're new, you'll be guided through the account creation process

  2. Once your account is created you will be asked to create your first project

  3. Once your project is created you will be taken to your console's overview page

Create API Key

From the sidebar, click "Integrate", then click "API Keys".

Server Key

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.

Server side keys offers a lot more scopes than Client side keys.

Client Key

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.

Create Collection

To create your collection, follow these steps:

  1. Click the "Token collections" link in the menu sidebar and then click the "New collection" button

  1. Enter the collection information and click "Next"

  2. 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"

  3. On the "What do you want to do with this collection?" section select "Sell NFTs" and click "Next"

  4. On "Choose a chain" select "Xion" and click "Next"

  5. 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

  6. Review details and click the "Create collection" button to complete the process

Create an NFT

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.

Update Checkout Settings

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".

Deploy a Treasury Contract

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.

Steps to Deploy a Treasury Contract

  1. Click the "New Treasury" button to create a new treasury contract instance.

  2. 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.

Building the Frontend

Manual Installation

You will first need to clone the repository:

git clone https://github.com/burnt-labs/xion-crossmint-hosted-checkout-frontend

After doing so you will have to change into the newly created directory and then execute the steps below.

  1. Install dependencies:

cd xion-crossmint-hosted-checkout-frontend
npm install
  1. Copy the .env.example file and name it .env.local and set the values with the correct information:

NEXT_PUBLIC_TREASURY_ADDRESS=your_treasury_contract_address
NEXT_PUBLIC_RPC_URL="https://rpc.xion-testnet-2.burnt.com:443"
NEXT_PUBLIC_REST_URL="https://api.xion-testnet-2.burnt.com"
NEXT_PUBLIC_CROSSMINT_API_KEY=your_crossmint_api_key
Variable
Description

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)

  1. 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:

{
  "collections": [
    {
      "id": "your-collection-id",
      "contractAddress": "your-nft-contract-address"
    }
  ]
} 

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".

  1. Build and start the application:

npm run dev

Additional Resources

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.

API Reference
CW-721 Metadata Onchain
CW-721 Metadata Onchain
XION Developer Portal
Next.js
https://github.com/burnt-labs/xion-crossmint-hosted-checkout-frontend
http://localhost:3000
https://docs.crossmint.com/api-reference/introduction
https://docs.crossmint.com/payments/pay-button/quickstart
https://docs.crossmint.com/minting/advanced/xion-contracts
https://docs.crossmint.com/payments/advanced/selling-multiple-nfts
here
https://staging.crossmint.com