Skip to main content
Crypto.com is currently in limited beta. Please contact support if you’re interested in early access.

Overview

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 headless implementations, providing a seamless way for users to fund their wallets with fiat currency.

Dashboard Setup

To enable Crypto.com onramp:
  1. Go to the Funding tab in your Dynamic developer dashboard
  2. Under “Fiat on-ramps”, toggle on Crypto.com
  3. Save the settings

Secret key

You’ll need to create a merchant account on crypto.com. So, go to the merchant.crypto.com and create an account.
Crypto.com Merchant Dashboard
Once you’ve created an account, go to integration and copy your secret key and paste it in the Dynamic dashboard.

Return and cancel URLs

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.

Widget Implementation

Once enabled, users will see Crypto.com as an option in the Dynamic widget’s deposit screen:
Crypto.com Onramp Widget

Programmatic Implementation

Using the useOnramp Hook

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:
React
import { useOnramp } from '@dynamic-labs/sdk-react-core'
import { OnrampProviders } from '@dynamic-labs/sdk-api-core'

const CryptoDotComOnramp = () => {
  const { enabled, open } = useOnramp()

  const handleCryptoDotComOnramp = () => {
    open({
      onrampProvider: OnrampProviders.CryptoDotCom,
      address: '0x1234567890123456789012345678901234567890',
      fiatAmount: 500, // amount in fiat currency
      currency: "USD"
    })
  }

  return (
    <button onClick={handleCryptoDotComOnramp} disabled={!enabled}>
      Open Crypto.com Onramp
    </button>
  )
}

Accessing Provider Information

You can also access provider configuration details through the providers array. This is useful for dynamically displaying available onramp options:
React
const { providers } = useOnramp()

// Find Crypto.com provider
const cryptoDotComProvider = providers.find(p => p.id === 'cryptoDotCom')

// Access provider details
console.log(cryptoDotComProvider?.displayName) // "Crypto.com"
console.log(cryptoDotComProvider?.iconUrl)     // Icon URL
console.log(cryptoDotComProvider?.openMode)    // "popup"

Providers Array Structure

The providers array contains configuration for each available onramp provider. This allows you to build custom UI components that dynamically show available options:
[
  {
    "displayName": "Banxa",
    "iconUrl": "https://dynamic.banxa.com/favicon.ico",
    "id": "banxa",
    "openMode": "iframe",
    "url": "https://dynamic.banxa-sandbox.com/?walletAddress=0x9217d782c2f5dF7cC53CcC0Eb0fe213F83DEc48d&coinType=ETH&blockchain=ETH&coinAmount=undefined"
  },
  {
    "displayName": "Crypto.com",
    "iconUrl": "https://iconic.dynamic-static-assets.com/icons/sprite.svg#crypto-dot-com",
    "id": "cryptoDotCom",
    "openMode": "popup",
    "url": "https://js.crypto.com/sdk/payments/checkout/set_wallet?id=8a2cbe01-b479-48f2-99fb-c6d63ec63499&publishableKey=pk_test_RkhZhXF57ZfbjQShKYWFGQkw&sdkMeta=eyJ1cmwiOiJodHRwczovL2pzLmNyeXB0by5jb20vc2RrP3B1Ymxpc2hhYmxlLWtleT1wa190ZXN0X1JraFpoWEY1N1pmYmpRU2hLWVdGR1Frd1x1MDAyNnN0YWdpbmc9ZmFsc2UiLCJ2ZXJzaW9uIjoiMC4zLjEifQ%3D%3D"
  }
]
FieldTypeDescription
displayNamestringHuman-readable name of the provider
iconUrlstringURL to the provider’s icon
idstringUnique identifier for the provider
openModestringHow the onramp opens (iframe or popup)
urlstringThe onramp URL with pre-configured parameters

Payment Tracking

Payment ID

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.

Getting Payment Information

Use the payment ID from the Crypto.com onramp URL to fetch payment details via their API. You’ll need your Crypto.com secret key for authentication:
curl https://pay.crypto.com/api/payments/{payment_id} \
  -u sk_test_YOUR_SECRET_KEY:
Response:
{
  "id": "5e88d5ab-a331-45e8-9a12-7712a5535cae",
  "original_amount": 50000,
  "amount": 50000,
  "amount_refunded": 0,
  "created": 1760801155,
  "cashback_rate": "0.0",
  "crypto_currency": "CRO",
  "crypto_amount": "3547.1",
  "currency": "USD",
  "customer_id": null,
  "customer_provided_info": {},
  "data_url": "https://pay.crypto.com/sdk/payments/5e88d5ab-a331-45e8-9a12-7712a5535cae?signature=237f91ddeb91",
  "payment_url": "https://js.crypto.com/sdk/payments/checkout/set_wallet?id=5e88d5ab-a331-45e8-9a12-7712a5535cae&publishableKey=pk_test_RkhZhXF57ZfbjQShKYWFGQkw&sdkMeta=eyJ1cmwiOiJodHRwczovL2pzLmNyeXB0by5jb20vc2RrP3B1Ymxpc2hhYmxlLWtleT1wa190ZXN0X1JraFpoWEY1N1pmYmpRU2hLWVdGR1Frd1x1MDAyNnN0YWdpbmc9ZmFsc2UiLCJ2ZXJzaW9uIjoiMC4zLjEifQ%3D%3D",
  "return_url": "https://demo.dynamic.xyz/?snap=N4IghgrgLgFgpgOygSwMZhQewSAXKVTAGyLAAcBnOAdTBLigBlkKo8oAnCOAGhEIQI4qKAFlMAEzh5+2ISIC0YBBIUVkAcxx8pAMzgcACmAoUA1nACeAYQ5wMybOy68QcALZhkRRpg3IcXE5uPg8vIgBlCAAjd2QoACFoKGwASQR1KXSyaDxdOipQ92i4CSkJWnooAFEEMGiiUusYLwy8AG0QaoA1URA+CIB5RhAAXVC6hrhm1oAxbygDPILXRHrG6uLS8srGqApnELdJxokZgIPcTp6+geGxifXS6oA3d3O2q5BRAEFUgDl-tUACr9EAJH4RapgwzDACaAHFBv8wYNDMDUqJUhFbiAft0fowfv9rAAJaF8H4AJQSqWBVIAqn1xscnhIIphUMg6IYOJgXsgpBxLp0NJg-I0weQyJK+IQAtETHAKJzuUQwfkOOhWEs+P5YDEwYtGhoOGB3EaAO7xVAwK3xRYcB4gAKoIgQKTA5VQIT7Q6uFik+wSRqmZZEQogdwQIgoH6mBj+vhkEzmKy+fyBfIR1xkGDYOAZgJJkAUfOW+YYEvqLTpCLCLAIQYcIUdNyebxgvMFsEqrl0MGWuh7A7J1MWSzOvtqouBYKuCgy+KbcI-FSGfNCcORxdEZcdohr9mqgdBFx8IdVWf+gC+OmVmkCoGimBbBipYAkyAgl2+YOiZoqNYxCvjIADEAAsADsUEAJy6LoGrYGwuAgLMfLuAABF67gyhg0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jIADEAAsADsUEAJy6LoGrYGwuAgLMfLuAABF67gyhg0h6kQmCKkQwFERwES2h40ioXuGgwGwfDuJIdDUIKGgMEkUApAgjD1HA6qoRmmEBJhr6YTWCCYRAZC9hIZhka+lHwO4NEgHRDFGh4eGLDIAAicD5DGjEgD+cDiBIrHsYmuDZlQd4gFILwCZgZCqUgeCgOQyAJEqDIcIJIAMVAlC4AA9GF0oAHQSJYdRxOg0AwFFhDuJFZDIGFLwAAxgogAp8gg7lQKkEgyHAACMJSVagAAcCgAEwAMwAGzRAoEEQQ1YBKBVTUQQosFgGA9jZaUqBNboTUgA52AvmALYBBonlRsZyC7DZ86zWQiBsSomCWitVAiI4gQgLOmEMlQmHWEqBw3jeQA",
  "description": "Crypto purchase for 0x1234567890123456789012345678901234567890",
  "live_mode": false,
  "metadata": {
    "chain": "EVM",
    "network_id": "1",
    "wallet_address": "0x1234567890123456789012345678901234567890",
    "token": "ETH"
  },
  "tax": {},
  "order_id": null,
  "recipient": "Dynamic",
  "refunded": false,
  "status": "pending",
  "time_window": 600,
  "remaining_time": "09:25",
  "resource_type": null,
  "resource_id": null,
  "resource": null,
  "merchant_avatar_url": "",
  "settled_at": 0,
  "expired": false,
  "enable_onchain_payment": false,
  "onchain_enabled": false,
  "deposit_address": null,
  "current_inbound_fund": null,
  "refresh_disabled": false,
  "ncw_connections": ["ncw_metamask_plugin", "ncw_wallet_connect", "cro_chain"],
  "network_cost": "70.0",
  "defi_swap_transaction": {
    "id": null,
    "status": null,
    "txn_id": null,
    "txn_value": null,
    "txn_estimated_gas": null,
    "txn_from": null,
    "token": null,
    "amount_in": null,
    "slippage": null
  },
  "sub_deposit_addresses": null,
  "captured": false,
  "payment_source": null,
  "payment_type": "checkout",
  "qr_code": "ewogICJpZCIgOiAiNWU4OGQ1YWItYTMzMS00NWU4LTlhMTItNzcxMmE1NTM1Y2FlIiwKICAidHlwZSIgOiAicGF5bWVudCIKfQ==",
  "deep_link": "monaco://pay?payment_url=ewogICJpZCIgOiAiNWU4OGQ1YWItYTMzMS00NWU4LTlhMTItNzcxMmE1NTM1Y2FlIiwKICAidHlwZSIgOiAicGF5bWVudCIKfQ==",
  "experimental_features": ["exptl_onchain_rebound", "exptl_cronos", "exptl_qr_code_payment", "exptl_subscription", "exptl_qr_code_rebound", "exptl_qr_code_refund"],
  "sub_merchant_id": null,
  "expired_at": 1760819155,
  "pay_later_installments": null,
  "pay_later_qr_code": null,
  "pay_method": "-",
  "allow_pay_later": false,
  "amount_in_usd": "500.0",
  "amount_in_usdc": "500.0",
  "network_list": null,
  "extra_requirements": ["require_login", "require_ssn"],
  "payout_wallet_address": "0x1234567890123456789012345678901234567890",
  "payout_chain_name": "Ethereum"
}

Key Response Fields

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:
FieldTypeDescription
idstringUnique payment identifier
statusstringCurrent payment status (pending, completed, failed, cancelled)
amountnumberPayment amount in fiat currency (e.g., 500 = $500.00)
original_amountnumberOriginal payment amount before any adjustments
currencystringFiat currency code (e.g., “USD”)
crypto_currencystringCryptocurrency symbol (e.g., “CRO”, “ETH”)
crypto_amountstringAmount of cryptocurrency to be received
amount_in_usdstringPayment amount in USD
amount_in_usdcstringPayment amount in USDC
payout_wallet_addressstringDestination wallet address for the crypto
payout_chain_namestringBlockchain network name (e.g., “Ethereum”)
metadataobjectAdditional payment metadata including chain and network info
time_windownumberPayment time window in seconds (e.g., 600 = 10 minutes)
remaining_timestringTime remaining for payment completion (e.g., “09:25”)
expiredbooleanWhether the payment has expired
expired_atnumberUnix timestamp when payment expires
creatednumberUnix timestamp when payment was created
settled_atnumberUnix timestamp when payment was settled (0 if not settled)
payment_urlstringURL for the payment checkout interface
return_urlstringURL to redirect to after successful payment
cancel_urlstringURL to redirect to after cancelled payment
qr_codestringBase64 encoded QR code for mobile payments
deep_linkstringDeep link for mobile app payments
live_modebooleanWhether this is a live payment (false for test mode)
extra_requirementsarrayAdditional requirements (e.g., [“require_login”, “require_ssn”])
ncw_connectionsarrayAvailable wallet connection methods
network_coststringNetwork transaction cost

Payment Status Values

StatusDescription
pendingPayment is being processed
completedPayment has been successfully completed
failedPayment failed for various reasons
cancelledPayment was cancelled by the user

Extracting Payment ID from URLs

When a user initiates a Crypto.com payment, the payment ID is included in the URL parameters. You can extract it for tracking purposes:
React
const extractPaymentId = (url: string) => {
  const urlParams = new URLSearchParams(url.split('?')[1])
  return urlParams.get('id')
}

// Example usage
const paymentUrl = "https://js.crypto.com/sdk/payments/checkout/set_wallet?id=5e88d5ab-a331-45e8-9a12-7712a5535cae&publishableKey=pk_test_RkhZhXF57ZfbjQShKYWFGQkw"
const paymentId = extractPaymentId(paymentUrl)
console.log(paymentId) // "5e88d5ab-a331-45e8-9a12-7712a5535cae"

Implementing Payment Status Tracking

You can implement payment status tracking by:
  1. Extracting Payment ID: Parse the payment ID from the Crypto.com onramp URL
  2. Polling API: Periodically check payment status using the Crypto.com API
  3. Webhook Integration: Set up webhooks to receive real-time status updates
Here’s a complete example of how to implement payment tracking:
React
const trackPaymentStatus = async (paymentId: string) => {
  try {
    const response = await fetch(`https://pay.crypto.com/api/payments/${paymentId}`, {
      headers: {
        'Authorization': `Basic ${btoa('sk_test_YOUR_SECRET_KEY:')}`
      }
    })

    const paymentData = await response.json()

    // Check if payment has expired
    if (paymentData.expired) {
      console.log('Payment has expired')
      return
    }

    // Log payment details
    console.log(`Payment ${paymentData.id}:`)
    console.log(`- Status: ${paymentData.status}`)
    console.log(`- Amount: $${(paymentData.amount / 100).toFixed(2)} ${paymentData.currency}`)
    console.log(`- Crypto: ${paymentData.crypto_amount} ${paymentData.crypto_currency}`)
    console.log(`- Wallet: ${paymentData.payout_wallet_address}`)
    console.log(`- Remaining time: ${paymentData.remaining_time}`)

    switch (paymentData.status) {
      case 'completed':
        console.log('Payment completed successfully!')
        console.log(`Settled at: ${new Date(paymentData.settled_at * 1000).toISOString()}`)
        // Handle successful payment
        break
      case 'failed':
        console.log('Payment failed')
        // Handle failed payment
        break
      case 'cancelled':
        console.log('Payment cancelled')
        // Handle cancelled payment
        break
      case 'pending':
        console.log('Payment still pending')
        // Continue polling if not expired
        if (!paymentData.expired) {
          setTimeout(() => trackPaymentStatus(paymentId), 5000)
        }
        break
    }
  } catch (error) {
    console.error('Error tracking payment status:', error)
  }
}

Supported Parameters

Crypto.com onramp supports the following URL parameters that can be passed when opening the onramp:
ParameterTypeDescription
walletAddressstringDestination wallet address for the purchase
coinAmountstringAmount of cryptocurrency to purchase
coinTypestringCryptocurrency symbol (e.g., “ETH”, “BTC”)
blockchainstringBlockchain network (e.g., “ETH”, “BTC”)
fiatCurrencystringFiat currency for payment (e.g., “USD”)
fiatAmountstringAmount in fiat currency

Error Handling

Common error scenarios and how to handle them in your application:

Insufficient Funds

  • Error: User doesn’t have sufficient funds for the purchase
  • Handling: Display appropriate error message and suggest alternative amounts

Invalid Wallet Address

  • Error: The provided wallet address is invalid
  • Handling: Validate wallet address format before opening onramp

Network Issues

  • Error: Network connectivity issues during payment processing
  • Handling: Implement retry logic and fallback mechanisms

Best Practices

  1. Validate Parameters: Always validate wallet addresses and amounts before opening the onramp
  2. Handle Errors Gracefully: Implement proper error handling for all failure scenarios
  3. Track Payment Status: Monitor payment status to provide user feedback
  4. Security: Never expose API keys in client-side code - use server-side endpoints for sensitive operations
  5. User Experience: Provide clear feedback during payment processing and handle loading states
  6. Provider Selection: Use the providers array to dynamically display available onramp options
  7. Fallback Handling: Implement fallback mechanisms for when specific providers are unavailable
  8. Amount Validation: Ensure fiat amounts are reasonable and within supported limits
  9. Currency Support: Verify that the selected currency is supported by Crypto.com in your region
I