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 aprojectId parameter. No API key is needed.
How It Works
Base URL
Get Supported Configuration
Returns available providers, fiat currencies, crypto currencies, payment methods, and countries aggregated across all enabled providers.Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string (UUID) | Yes | Your project ID |
orderType | string | No | buy or sell (default: buy) |
country | string | No | ISO 2-letter country code (e.g., US, GB). Auto-detected from IP if omitted. |
Response
Provider Features
| Feature | Description |
|---|---|
supportsIframe | Provider checkout can be embedded in an iframe |
supportsWidget | Provider provides a JavaScript widget for checkout |
supportsBuy | Supports fiat-to-crypto (on-ramp) |
supportsSell | Supports crypto-to-fiat (off-ramp) |
supportsRecurring | Supports recurring/subscription purchases |
kycHandledByProvider | Provider handles identity verification internally |
Get Quotes
Fetches quotes from all enabled gateways in parallel and returns them ranked by best rate.Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string (UUID) | Yes | Your project ID |
fiatCurrency | string | Yes | Fiat currency code (e.g., USD) |
cryptoCurrency | string | Yes | Crypto currency code (e.g., ETH) |
network | string | Yes | Network ID (e.g., ethereum) |
fiatAmount | string | One required | Fiat amount (e.g., 100). Required for buy orders. |
cryptoAmount | string | One required | Crypto amount. Required for sell orders. |
orderType | string | No | buy or sell (default: buy) |
paymentMethodId | string | No | Filter by payment method |
country | string | No | ISO 2-letter country code. Auto-detected from IP if omitted. |
Either
fiatAmount or cryptoAmount must be provided.Response
Quote Fields
| Field | Type | Description |
|---|---|---|
gatewayId | string | Gateway identifier |
gatewayName | string | Display name |
gatewayLogo | string | Logo URL |
available | boolean | Whether this gateway can service the request |
fiatAmount | string | Fiat amount |
cryptoAmount | string | Crypto amount the user will receive |
fees | object | Fee breakdown (processing, network, total, percentage) |
exchangeRate | string | Exchange rate (1 crypto = X fiat) |
estimatedTime | string | Estimated processing time |
kycRequired | string | none, light, or full |
expiresAt | number | Quote expiry timestamp (milliseconds) |
rank | number | Ranking position (1 = best) |
isBestRate | boolean | Whether this is the best rate |
isRecommended | boolean | Whether this is the recommended gateway |
score | number | Routing score (0-100) |
Ranked Results
The response includes convenience fields for common selection strategies:| Field | Description |
|---|---|
bestQuote | Quote with the best exchange rate (most crypto for your fiat) |
fastestQuote | Quote with the shortest estimated processing time |
cheapestFees | Quote with the lowest total fees |
unavailableGateways | Gateways 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.Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string (UUID) | Yes | Your project ID |
gateway | string | Yes | Gateway ID from the supported config |
fiatCurrency | string | Yes | Fiat currency code |
cryptoCurrency | string | Yes | Crypto currency code |
network | string | Yes | Network ID |
fiatAmount | string | One required | Fiat amount |
cryptoAmount | string | One required | Crypto amount |
walletAddress | string | Buy orders | Destination wallet address (required for buy) |
customerId | string | No | Internal customer UUID |
externalCustomerId | string | No | Partner’s external customer ID |
orderType | string | No | buy or sell (default: buy) |
paymentMethodId | string | No | Payment method ID |
email | string | No | Customer email |
redirectUrl | string | No | URL to redirect after checkout |
metadata | object | No | Provider-facing string map, passed to provider’s createOrder(). Not persisted in order metadata. |
partnerMetadata | object | No | Partner data (Record<string, unknown>). Persisted as order.metadata.partnerMetadata and included in webhook payloads. Max 20 keys, 4KB, 2 levels of nesting. |
country | string | No | ISO 2-letter country code |
Request Example
Response
Checkout Methods
| Method | Description | How to Use |
|---|---|---|
iframe | Embed checkout in an iframe | Load checkout.url in an <iframe> |
redirect | Redirect user to gateway | Navigate to checkout.url |
widget | Use gateway’s JavaScript widget | Use widgetConfig to initialize |
Get Transaction
Returns the current status of an order, syncing with the gateway’s latest status.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
transactionId | string (UUID) | Yes | The order ID returned from checkout intent |
Response
Transaction Statuses
| Status | Description |
|---|---|
pending | Order created, awaiting payment |
processing | Payment received, processing crypto transfer |
completed | Crypto delivered to wallet |
failed | Order failed (payment declined, compliance issue, etc.) |
cancelled | Order cancelled by user or system |
expired | Order expired before payment |
refunded | Payment 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
country parameter explicitly.
Using the SDK
The@nowramp/sdk provides convenient methods for all onramp endpoints: