Skip to main content
In this guide, you will learn how to:
  • Install the React SDK
  • Create an Onramp order for your authenticated users
  • Use the embedded checkout component to handle KYC, payment, and delivery
Crossmint Onramp Embedded Checkout Demo

Whitelabel Onramp in React

Before you start

Set up your project and get an API key.

Onramp Embedded Quickstart

See a full working example.
You can test the Onramp self-serve in staging. To enable it in production, contact sales.

Prerequisites

Install the Crossmint client SDK:
  • Create a server-side API key with the orders.create and orders.read scopes enabled, and a client-side API key for the embedded checkout component.
  • Add environment variables to your .env.local:
    .env.local

Onramp to Crossmint Wallets

Use this flow to onramp funds into wallets created with Crossmint.
1

Create the server action

Create a server action that will create orders via the Crossmint API:
app/actions/createOrder.ts
2

Build the onramp component

Create a client component that handles the order creation and displays the embedded checkout:
app/components/OnrampCheckout.tsx
3

Add the component to your page

Import and render the OnrampCheckout component in your page:
app/page.tsx
That is it! When users fill in their details and click “Continue to Checkout”, the server action creates an order and the embedded checkout component handles KYC, payment, and delivery automatically.

Onramp to External Wallets

Use this flow to onramp to external wallets — externally owned accounts (EOAs) or smart wallets not created by Crossmint. External wallet onramp requires two additional steps compared to Crossmint wallets: linking the wallet to a Crossmint user, and handling ownership verification when transaction thresholds are exceeded.
2

Create the server action

Create a server action that will create orders via the Crossmint API:
app/actions/createOrder.ts
Ownership verificationDepending on the transaction value and the user’s past activity, the order may or may not require wallet ownership verification:
  • Below threshold: If the transaction value is below $1,000 and the user’s past 30-day onramp transaction volume is below $1,000, ownership verification is not required. The order proceeds directly to the KYC/payment phase.
  • Above threshold: If either threshold is surpassed, the order status will be requires-recipient-verification and the user must sign a message to prove wallet ownership.
When ownership verification is required, the order response includes a preparation.message field that the user must sign:
3

Handle wallet verification

If the order requires ownership verification, have the user sign the preparation.message with the recipient wallet. See Onramp to Non-Crossmint Wallets for how all wallets, including EOAs and smart contract wallets, use the same verification flow.
Once signed, submit the signature using the same Link External Wallet API by calling the linkWallet server action with the proof parameter set to the signature. Once ownership is verified, the order proceeds to the next phase (requires-kyc or awaiting-payment).
4

Build the onramp component

Create a client component that handles wallet linking, order creation, and displays the embedded checkout:
app/components/OnrampCheckout.tsx
5

Add the component to your page

Import and render the OnrampCheckout component in your page:
app/page.tsx
That is it! When users fill in their details and click “Continue to Checkout”, the app links the external wallet, creates an order, and the embedded checkout component handles KYC, payment, and delivery automatically.
Testing: Use the test credit card number 4242 4242 4242 4242 with any future expiration date and any 3-digit CVC.

Transaction Completion

Upon successful payment:
1

KYC Verification

The embedded checkout component handles all the complexity of KYC verification automatically.
2

Token Delivery

The purchased tokens (minus fees) are sent directly to the user's wallet.
3

Receipt Sent

User receives an email receipt from hello@crossmint.io.

Next Steps