Skip to main content

Onramp API

The Onramp API provides multi-provider aggregation for crypto purchases. It fans out requests to all enabled payment gateways, compares quotes, and lets users checkout with their preferred provider. All endpoints are public and require a projectId parameter. No API key is needed.

How It Works

Base URL

GET|POST /public/v1/onramp/*

Get Supported Configuration

Returns available gateways, fiat currencies, crypto currencies, and payment methods aggregated across all enabled providers.
GET /public/v1/onramp/supported

Query Parameters

ParameterTypeRequiredDescription
projectIdstring (UUID)YesYour project ID
orderTypestringNobuy or sell (default: buy)
countrystringNoISO 2-letter country code (e.g., US, GB). Auto-detected from IP if omitted.

Response

{
  "success": true,
  "data": {
    "gateways": [
      {
        "id": "gateway_a",
        "name": "Gateway A",
        "logo": "https://...",
        "enabled": true,
        "features": {
          "supportsIframe": true,
          "supportsWidget": false,
          "supportsBuy": true,
          "supportsSell": true,
          "supportsRecurring": false,
          "kycHandledByProvider": true
        }
      },
      {
        "id": "gateway_b",
        "name": "Gateway B",
        "logo": "https://...",
        "enabled": true,
        "features": {
          "supportsIframe": false,
          "supportsWidget": true,
          "supportsBuy": true,
          "supportsSell": false,
          "supportsRecurring": false,
          "kycHandledByProvider": true
        }
      }
    ],
    "fiats": [
      {
        "code": "USD",
        "name": "US Dollar",
        "symbol": "$",
        "minAmount": "30",
        "maxAmount": "15000",
        "paymentMethods": ["debit-credit-card", "apple-pay"]
      }
    ],
    "cryptos": [
      {
        "code": "ETH",
        "name": "Ethereum",
        "networks": [
          {
            "id": "ethereum",
            "name": "Ethereum Mainnet",
            "minAmount": "0.001",
            "maxAmount": "100",
            "isDefault": true
          },
          {
            "id": "polygon",
            "name": "Polygon",
            "minAmount": "0.01",
            "maxAmount": "50000",
            "isDefault": false
          }
        ]
      }
    ],
    "paymentMethods": [
      {
        "id": "debit-credit-card",
        "name": "Credit/Debit Card",
        "supportedFiats": ["USD", "EUR", "GBP"]
      }
    ],
    "defaultGateway": "gateway_a"
  }
}

Gateway Features

FeatureDescription
supportsIframeGateway checkout can be embedded in an iframe
supportsWidgetGateway provides a JavaScript widget for checkout
supportsBuySupports fiat-to-crypto (on-ramp)
supportsSellSupports crypto-to-fiat (off-ramp)
supportsRecurringSupports recurring/subscription purchases
kycHandledByProviderGateway handles identity verification internally

Get Quotes

Fetches quotes from all enabled gateways in parallel and returns them ranked by best rate.
GET /public/v1/onramp/quotes

Query Parameters

ParameterTypeRequiredDescription
projectIdstring (UUID)YesYour project ID
fiatCurrencystringYesFiat currency code (e.g., USD)
cryptoCurrencystringYesCrypto currency code (e.g., ETH)
networkstringYesNetwork ID (e.g., ethereum)
fiatAmountstringOne requiredFiat amount (e.g., 100). Required for buy orders.
cryptoAmountstringOne requiredCrypto amount. Required for sell orders.
orderTypestringNobuy or sell (default: buy)
paymentMethodIdstringNoFilter by payment method
countrystringNoISO 2-letter country code. Auto-detected from IP if omitted.
Either fiatAmount or cryptoAmount must be provided.

Response

{
  "success": true,
  "data": {
    "quotes": [
      {
        "gatewayId": "gateway_a",
        "gatewayName": "Gateway A",
        "gatewayLogo": "https://...",
        "available": true,
        "fiatAmount": "100",
        "fiatCurrency": "USD",
        "cryptoAmount": "0.03842",
        "cryptoCurrency": "ETH",
        "network": "ethereum",
        "fees": {
          "processingFee": "2.50",
          "networkFee": "0.80",
          "totalFee": "3.30",
          "feePercentage": "3.3"
        },
        "exchangeRate": "2602.81",
        "estimatedTime": "5-10 minutes",
        "kycRequired": "light",
        "expiresAt": 1706900000000,
        "rank": 1,
        "isBestRate": true,
        "score": 92
      },
      {
        "gatewayId": "gateway_b",
        "gatewayName": "Gateway B",
        "gatewayLogo": "https://...",
        "available": true,
        "fiatAmount": "100",
        "fiatCurrency": "USD",
        "cryptoAmount": "0.03801",
        "cryptoCurrency": "ETH",
        "network": "ethereum",
        "fees": {
          "processingFee": "3.00",
          "networkFee": "1.00",
          "totalFee": "4.00",
          "feePercentage": "4.0"
        },
        "exchangeRate": "2630.89",
        "estimatedTime": "1-5 minutes",
        "kycRequired": "none",
        "expiresAt": 1706900000000,
        "rank": 2,
        "isBestRate": false,
        "score": 85
      }
    ],
    "bestQuote": { "gatewayId": "gateway_a", "..." : "..." },
    "fastestQuote": { "gatewayId": "gateway_b", "..." : "..." },
    "cheapestFees": { "gatewayId": "gateway_a", "..." : "..." },
    "unavailableGateways": []
  }
}

Quote Fields

FieldTypeDescription
gatewayIdstringGateway identifier
gatewayNamestringDisplay name
gatewayLogostringLogo URL
availablebooleanWhether this gateway can service the request
fiatAmountstringFiat amount
cryptoAmountstringCrypto amount the user will receive
feesobjectFee breakdown (processing, network, total, percentage)
exchangeRatestringExchange rate (1 crypto = X fiat)
estimatedTimestringEstimated processing time
kycRequiredstringnone, light, or full
expiresAtnumberQuote expiry timestamp (milliseconds)
ranknumberRanking position (1 = best)
isBestRatebooleanWhether this is the best rate
isRecommendedbooleanWhether this is the recommended gateway
scorenumberRouting score (0-100)

Ranked Results

The response includes convenience fields for common selection strategies:
FieldDescription
bestQuoteQuote with the best exchange rate (most crypto for your fiat)
fastestQuoteQuote with the shortest estimated processing time
cheapestFeesQuote with the lowest total fees
unavailableGatewaysGateways that couldn’t provide a quote, with reasons

Create Checkout Intent

Creates an order with a specific gateway and returns a checkout URL for payment.
POST /public/v1/onramp/checkout-intent

Request Body

ParameterTypeRequiredDescription
projectIdstring (UUID)YesYour project ID
gatewaystringYesGateway ID from the supported config
fiatCurrencystringYesFiat currency code
cryptoCurrencystringYesCrypto currency code
networkstringYesNetwork ID
fiatAmountstringOne requiredFiat amount
cryptoAmountstringOne requiredCrypto amount
walletAddressstringBuy ordersDestination wallet address (required for buy)
customerIdstringNoInternal customer UUID
externalCustomerIdstringNoPartner’s external customer ID
orderTypestringNobuy or sell (default: buy)
paymentMethodIdstringNoPayment method ID
emailstringNoCustomer email
redirectUrlstringNoURL to redirect after checkout
metadataobjectNoKey-value metadata
countrystringNoISO 2-letter country code

Request Example

{
  "projectId": "550e8400-e29b-41d4-a716-446655440000",
  "gateway": "gateway_a",
  "fiatCurrency": "USD",
  "fiatAmount": "100",
  "cryptoCurrency": "ETH",
  "network": "ethereum",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f1bD21",
  "externalCustomerId": "user_123",
  "email": "[email protected]",
  "redirectUrl": "https://myapp.com/purchase-complete"
}

Response

{
  "success": true,
  "data": {
    "orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "gateway": "gateway_a",
    "status": "pending",
    "checkout": {
      "method": "iframe",
      "url": "https://checkout.gateway-a.com/...",
      "expiresAt": 1706903600000,
      "allowedFeatures": ["payment"]
    }
  }
}

Checkout Methods

MethodDescriptionHow to Use
iframeEmbed checkout in an iframeLoad checkout.url in an <iframe>
redirectRedirect user to gatewayNavigate to checkout.url
widgetUse gateway’s JavaScript widgetUse widgetConfig to initialize

Get Transaction

Returns the current status of an order, syncing with the gateway’s latest status.
GET /public/v1/onramp/transactions/:transactionId

Path Parameters

ParameterTypeRequiredDescription
transactionIdstring (UUID)YesThe order ID returned from checkout intent

Response

{
  "success": true,
  "data": {
    "orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "provider": "gateway_a",
    "status": "completed",
    "providerStatus": "complete",
    "fiatAmount": "100",
    "fiatCurrency": "USD",
    "cryptoAmount": "0.03842",
    "cryptoCurrency": "ETH",
    "network": "ethereum",
    "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f1bD21",
    "transactionHash": "0xabc123...",
    "createdAt": "2025-02-01T10:30:00.000Z",
    "completedAt": "2025-02-01T10:38:00.000Z"
  }
}

Transaction Statuses

StatusDescription
pendingOrder created, awaiting payment
processingPayment received, processing crypto transfer
completedCrypto delivered to wallet
failedOrder failed (payment declined, compliance issue, etc.)
cancelledOrder cancelled by user or system
expiredOrder expired before payment
refundedPayment refunded to customer
The providerStatus field contains the gateway’s original status string, while status is normalized across all gateways.

GeoIP Country Detection

All onramp endpoints automatically detect the user’s country from their IP address. This is used to:
  • Filter supported currencies and payment methods by region
  • Provide region-specific pricing and availability
  • Comply with geographic restrictions
You can override auto-detection by passing the country parameter explicitly.

Using the SDK

The @nowramp/sdk provides convenient methods for all onramp endpoints:
import { RampApi } from '@nowramp/sdk';

const api = new RampApi({
  projectId: 'your_project_id'
});

// Get supported config
const config = await api.getSupported();

// Get quotes
const quotes = await api.getQuotes({
  fiatCurrency: 'USD',
  fiatAmount: '100',
  cryptoCurrency: 'ETH',
  network: 'ethereum'
});

// Create checkout with the best quote's gateway
const intent = await api.createCheckoutIntent({
  gateway: quotes.bestQuote.gatewayId,
  fiatCurrency: 'USD',
  fiatAmount: '100',
  cryptoCurrency: 'ETH',
  network: 'ethereum',
  walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f1bD21'
});

// Poll transaction
const tx = await api.getTransaction(intent.orderId);
See the JavaScript SDK for full API client documentation, or React Components for React hooks.