For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
Crypto.com is currently in limited beta. Please contact support if you’re interested in early access.
Crypto.com onramp integration allows users to purchase cryptocurrency directly within your application using Crypto.com’s payment infrastructure. This integration supports both widget-based and custom UI implementations, providing a seamless way for users to fund their wallets with fiat currency.
You’ll need to set the return and cancel URLs in the Dynamic dashboard. These URLs are used to redirect the user after the payment is completed or cancelled.
Once enabled, users will see Crypto.com as an option in the Dynamic widget’s deposit screen. Selecting Crypto.com in the widget opens a tailored screen where the user chooses fiat currency and amount; after confirming, the flow continues to Crypto.com in a new browser tab.
You can trigger Crypto.com onramp programmatically using the useOnramp hook. This approach gives you full control over when and how the onramp is displayed. You can either fetch the URL to be opened and use it yourself, or you can use the open method to open the onramp (note: open resolves void).
Use the getOnrampUrl method to fetch the URL to be opened.
import { useOnramp } from '@dynamic-labs/sdk-react-core'import { OnrampProviders } from '@dynamic-labs/sdk-api-core'const { getOnrampUrl } = useOnramp();const url = await getOnrampUrl({ onrampProvider: OnrampProviders.CryptoDotCom, address, chainName: 'evm', // optional, defaults from primary wallet network: '1', // optional, used only when chainName is 'evm' currency: 'USD', tokenAmount: 500, // fiat amount});// Open it yourself (e.g., window.open(url, ...)) if defined
The providers array contains configuration for each available onramp provider. This allows you to build custom UI components that dynamically show available options:
Crypto.com provides a payment ID in the onramp URL that you can use to track payment status. This ID is included in the URL parameters when the onramp is opened and is essential for monitoring payment progress.
The Crypto.com payment API response contains extensive information about the payment. Here are the key fields you’ll commonly use for tracking and displaying payment status:
Field
Type
Description
id
string
Unique payment identifier
status
string
Current payment status (pending, completed, failed, cancelled)
amount
number
Payment amount in fiat currency (e.g., 500 = $500.00)
original_amount
number
Original payment amount before any adjustments
currency
string
Fiat currency code (e.g., “USD”)
crypto_currency
string
Cryptocurrency symbol (e.g., “CRO”, “ETH”)
crypto_amount
string
Amount of cryptocurrency to be received
amount_in_usd
string
Payment amount in USD
amount_in_usdc
string
Payment amount in USDC
payout_wallet_address
string
Destination wallet address for the crypto
payout_chain_name
string
Blockchain network name (e.g., “Ethereum”)
metadata
object
Additional payment metadata including chain and network info
time_window
number
Payment time window in seconds (e.g., 600 = 10 minutes)
remaining_time
string
Time remaining for payment completion (e.g., “09:25”)
expired
boolean
Whether the payment has expired
expired_at
number
Unix timestamp when payment expires
created
number
Unix timestamp when payment was created
settled_at
number
Unix timestamp when payment was settled (0 if not settled)
payment_url
string
URL for the payment checkout interface
return_url
string
URL to redirect to after successful payment
cancel_url
string
URL to redirect to after cancelled payment
qr_code
string
Base64 encoded QR code for mobile payments
deep_link
string
Deep link for mobile app payments
live_mode
boolean
Whether this is a live payment (false for test mode)
When opening Crypto.com onramp via the SDK, use these parameters:
Parameter
Type
Description
address
string
Destination wallet address for the purchase
token
string (optional)
Token symbol (e.g., “ETH”), if applicable
tokenAmount
number
Amount in fiat currency (e.g., 500 for $500.00)
currency
string
Fiat currency code (e.g., “USD”)
chainName
string
Chain family (e.g., “evm”)
network
string or number
Network identifier; used only when chainName is “evm” (e.g., “1” for ETH)
Note: The SDK requests a provider URL from Dynamic’s API using these parameters. It does not construct Crypto.com-specific query parameters directly on the client.