Skip to main content

Ramp REST API V3 Reference

This page describes the latest version of our available REST API.

General info

API base path: https://api.ramp.network/api

All request and response bodies should be in JSON, with corresponding application/json headers.

If an error is returned, the response body is also a JSON object, with a code property describing the problem, and optionally more properties providing additional details.

ℹ️ All endpoints are subject to rate limiting.

Available assets and prices

Available on-ramp assets and prices (buy crypto)

Endpoint: GET /host-api/v3/assets

Query parameters:

  • currencyCode (optional): sets the fiat currency that will be used in minPurchaseAmount, maxPurchaseAmount, minFeeAmount, networkFee properties. If no value is provided, EUR is used as a default setting.
  • hostApiKey (optional): if you have a custom integration, provide the key to access your enabled features.
    • If provided, the response will contain an enabledFeatures property with a list of the features enabled.
    • Contact us at partner@ramp.network if you want a custom integration :)
  • userIp (optional): string representing an IP address.
    • The assets field in the response will include only the assets available in the geolocation associated with the provided IP.
  • withDisabled (optional): boolean parameter - if it's true, assets with enabled: false will be returned. Use this param to receive assets that are temporarily disabled, for example due to maintenance.
  • withHidden (optional): boolean parameter - if it's true, assets with hidden: true will be returned.

Response contents

interface HostAssetsConfig {
assets: AssetInfo[];
enabledFeatures?: string[];

currencyCode: string;
minPurchaseAmount: number;
maxPurchaseAmount: number;
minFeeAmount: number;
// Final fee percentage depends on the payment method and purchase size.
minFeePercent: number;
maxFeePercent: number;
}

interface AssetInfo {
// Asset symbol, e.g. ETH, DAI, BTC
symbol: string;
// Asset chain, e.g. ETH, POLKADOT, RONIN
chain: string;
// Asset descriptive name, e.g. Ethereum
name: string;
// Number of decimal places to convert units to whole coins
decimals: number;
// Asset type -- NATIVE for native assets (e.g. ETH, BTC, ELROND), or a token standard (e.g. ERC20)
type: string;
// Token contract address, if applicable (if the asset is not the chain native asset)
address?: string;
logoUrl: string;
enabled: boolean;
hidden: boolean;

// Approximate price of a single whole asset unit (1 ETH/DAI/...) per currency code. Please note that the actual price may vary
price: Dictionary<number>;

currencyCode: string;
// Asset-specific purchase limits, -1 means unlimited (global limits are used)
minPurchaseAmount: number;
maxPurchaseAmount: number;
minPurchaseCryptoAmount: string; // in wei/units
// Network fee for the asset added on top of Ramp's fee
networkFee: number;
}

Example

Request:

curl -X GET https://api.ramp.network/api/host-api/v3/assets

Response:

{
"currencyCode": "EUR",
"minPurchaseAmount": 10,
"maxPurchaseAmount": 10000,
"minFeeAmount": 3,
"minFeePercent": 0.5,
"maxFeePercent": 2.99,
"assets": [
{
"address": "0x0000....",
"symbol": "ETH",
"chain": "ETH",
"name": "Ether",
"decimals": 18,
"type": "NATIVE",
"enabled": true,
"logoUrl": "https://assets.ramp.network/crypto-assets/eth.svg",
"hidden": false,
"networkFee": 0.01,
"price": {
"EUR": 146.204351612996,
"PLN": 34.36787710229498,
"USD": 130.94295070798083,
"GBP": 123.30407161114876
},
"currencyCode": "EUR",
"minPurchaseAmount": -1,
"maxPurchaseAmount": -1,
"minPurchaseCryptoAmount": "-1"
},
{
"address": "0x0000....",
"symbol": "DAI",
"chain": "ETH",
"name": "Multi-Collateral DAI",
"decimals": 18,
"type": "ERC20",
"enabled": true,
"logoUrl": "https://assets.ramp.network/crypto-assets/dai.svg",
"networkFee": 0,
"hidden": false,
"price": {
"EUR": 0.906651167794897,
"PLN": 0.21312413458052976,
"USD": 0.8120112559176902,
"GBP": 0.7646405820808438
},
"currencyCode": "EUR",
"minPurchaseAmount": -1,
"maxPurchaseAmount": 15,
"minPurchaseCryptoAmount": "-1"
}
]
}

Available off-ramp assets and prices (sell crypto)

Endpoint: GET /host-api/v3/offramp/assets

Query parameters:

  • currencyCode (optional): sets the fiat currency that will be used in minPurchaseAmount, maxPurchaseAmount properties. If no value is provided, EUR is used as a default setting.
  • hostApiKey (optional): if you have a custom integration, provide the key to access your enabled features.
    • If provided, the response will contain an enabledFeatures property with a list of the features enabled.
    • Contact us at partner@ramp.network if you want a custom integration :)
  • userIp (optional): string representing an IP address.
    • The assets field in the response will include only the assets available in the geolocation associated with the provided IP.
  • withDisabled (optional): boolean parameter - if it's true, assets with enabled: false will be returned. Use this param to receive assets that are temporarily disabled, for example due to maintenance.
  • withHidden (optional): boolean parameter - if it's true, assets with hidden: true will be returned.

Response contents

interface HostAssetsConfig {
assets: OfframpAssetInfo[];
enabledFeatures?: string[];

currencyCode: string;
minPurchaseAmount: number;
maxPurchaseAmount: number;
}

interface OfframpAssetInfo {
// Asset symbol, e.g. ETH, DAI, BTC
symbol: string;
// Asset chain, e.g. ETH, POLKADOT, RONIN
chain: string;
// Asset descriptive name, e.g. Ethereum
name: string;
// Number of decimal places to convert units to whole coins
decimals: number;
// Asset type -- NATIVE for native assets (e.g. ETH, BTC, ELROND), or a token standard (e.g. ERC20)
type: string;
// Token contract address, if applicable (if the asset is not the chain native asset)
address: string | null;
logoUrl: string;
enabled: boolean;
hidden: boolean;

// Price of a single whole asset unit (1 ETH/DAI/...) per currency code
price: Dictionary<number>;

currencyCode: string;
// Asset-specific limits, -1 means unlimited (global limits are used)
minPurchaseAmount: number;
maxPurchaseAmount: number;
minPurchaseCryptoAmount: string; // in wei/units
}

Example

Request:

curl -X GET https://api.ramp.network/api/host-api/v3/offramp/assets

Response:

{
"currencyCode": "EUR",
"minPurchaseAmount": 10,
"maxPurchaseAmount": 10000,
"assets": [
{
"address": null,
"symbol": "ETH",
"chain": "ETH",
"name": "Ether",
"decimals": 18,
"type": "NATIVE",
"enabled": true,
"logoUrl": "https://assets.ramp.network/crypto-assets/eth.svg",
"hidden": false,
"networkFee": 0.01,
"price": {
"EUR": 146.204351612996,
"PLN": 34.36787710229498,
"USD": 130.94295070798083,
"GBP": 123.30407161114876
},
"currencyCode": "EUR",
"minPurchaseAmount": -1,
"maxPurchaseAmount": -1,
"minPurchaseCryptoAmount": "-1"
},
{
"address": "0x0000....",
"symbol": "DAI",
"chain": "ETH",
"name": "Multi-Collateral DAI",
"decimals": 18,
"type": "ERC20",
"enabled": true,
"logoUrl": "https://assets.ramp.network/crypto-assets/dai.svg",
"networkFee": 0,
"hidden": false,
"price": {
"EUR": 0.906651167794897,
"PLN": 0.21312413458052976,
"USD": 0.8120112559176902,
"GBP": 0.7646405820808438
},
"currencyCode": "EUR",
"minPurchaseAmount": -1,
"maxPurchaseAmount": 15,
"minPurchaseCryptoAmount": "-1"
}
]
}

Available fiat currencies

Endpoint GET /host-api/v3/currencies

Response contents

interface ActiveTransactionCurrency {
// Fiat currency symbol, e.g. USD, EUR, GBP
fiatCurrency: string;
// Name of the fiat currency
name: string;
// Defines whether the currency is available for on-ramp
onrampAvailable: boolean;
// Defines whether the currency is available for off-ramp
offrampAvailable: boolean;
}

Example

Request:

curl -X GET https://api.ramp.network/api/host-api/v3/currencies

Response:

[
{
"fiatCurrency": "EUR",
"name": "Euro",
"onrampAvailable": true,
"offrampAvailable": true
},
{
"fiatCurrency": "GBP",
"name": "Pound Sterling",
"onrampAvailable": true,
"offrampAvailable": true
},
{
"fiatCurrency": "USD",
"name": "United States Dollar",
"onrampAvailable": true,
"offrampAvailable": true
},
{
"fiatCurrency": "BRL",
"name": "Brazilian Real",
"onrampAvailable": true,
"offrampAvailable": false
},
{
"fiatCurrency": "PLN",
"name": "Polish Zloty",
"onrampAvailable": true,
"offrampAvailable": false
}
]

Sale transaction

Endpoint: GET /host-api/offramp/sale/{id}

Path parameter: id (required): id of the sale, received from an SDK event or a webhook call.

Query parameter: secret (required): the purchaseViewToken received with the same purchase created event.

Response contents

A single RampSale object, the same that's used in webhook calls.

Example

Request:

curl -X GET https://api.ramp.network/api/host-api/offramp/sale/0ca7d027-5697-4e68-bc78-5794e314c69b?secret=xxxxxxxx

Response:

{
"id": "0ca7d027-5697-4e68-bc78-5794e314c69b",
"purchaseViewToken": "4eb9ndrsb59erawh",
"createdAt": "2019-10-24T14:41:39.372Z",
"crypto": {
"amount": "30000000000000000",
"assetInfo": {
"address": null,
"symbol": "ETH",
"chain": "ETH",
"type": "NATIVE",
"name": "Ether",
"decimals": 18
}
},
"fiat": {
"amount": 100.23,
"currencySymbol": "USD"
}
}

On-ramp purchase quotation

Endpoint: POST /host-api/v3/onramp/quote/all

Query parameters:

  • hostApiKey: the integration key you've received from us.

Request body:

interface QuoteRequestBody {
cryptoAssetSymbol: string;
fiatCurrency: string;

/*
* Although fiatValue and cryptoAmount are not both required, you need to pass one of them.
*/
cryptoAmount?: string;
fiatValue?: number;
}

Response contents

For convenience, the QuoteResult object is a subset of the RampPurchase object. Payment methods in the response are limited only to the ones that support the currency given in fiatCurrency parameter.

interface QuoteResult {
asset: AssetInfo;
[PaymentMethodName.MANUAL_BANK_TRANSFER]: QuoteResultForPaymentMethod;
[PaymentMethodName.AUTO_BANK_TRANSFER]: QuoteResultForPaymentMethod;
[PaymentMethodName.CARD_PAYMENT]: QuoteResultForPaymentMethod;
[PaymentMethodName.APPLE_PAY]: QuoteResultForPaymentMethod;
[PaymentMethodName.GOOGLE_PAY]: QuoteResultForPaymentMethod;
[PaymentMethodName.PIX]: QuoteResultForPaymentMethod;
}

enum PaymentMethodName {
MANUAL_BANK_TRANSFER = 'MANUAL_BANK_TRANSFER',
AUTO_BANK_TRANSFER = 'AUTO_BANK_TRANSFER',
CARD_PAYMENT = 'CARD_PAYMENT',
APPLE_PAY = 'APPLE_PAY',
GOOGLE_PAY = 'GOOGLE_PAY',
PIX = 'PIX',
}

interface QuoteResultForPaymentMethod {
fiatCurrency: string; // three-letter currency code
cryptoAmount: string; // number-string, in wei or token units
fiatValue: number; // total value the user pays for the purchase, in fiatCurrency
baseRampFee: number; // base Ramp fee before any modifications, in fiatCurrency
appliedFee: number; // final fee the user pays (included in fiatValue), in fiatCurrency
hostFeeCut?: number;
}

Example

Request

curl -X POST https://api.ramp.network/api/host-api/v3/onramp/quote/all\?hostApiKey\=xxxxxxxxx -H 'content-type: application/json' -d '{
"cryptoAssetSymbol": "ETH_ETH",
"fiatValue": 100,
"fiatCurrency": "USD"
}'

Response

{
"APPLE_PAY": {
"appliedFee": 3.709848260447036,
"baseRampFee": 2.792414400447036,
"cryptoAmount": "54458989844503905",
"fiatCurrency": "USD",
"fiatValue": 100
},
"GOOGLE_PAY": {
"appliedFee": 3.709848260447036,
"baseRampFee": 2.792414400447036,
"cryptoAmount": "54458989844503905",
"fiatCurrency": "USD",
"fiatValue": 100
},
"CARD_PAYMENT": {
"appliedFee": 3.709848260447036,
"baseRampFee": 2.792414400447036,
"cryptoAmount": "54458989844503905",
"fiatCurrency": "USD",
"fiatValue": 100
},
"asset": {
"address": null,
"chain": "ETH",
"currencyCode": "USD",
"decimals": 18,
"enabled": true,
"hidden": false,
"logoUrl": "https://assets.ramp.network/crypto-assets/eth.svg",
"maxPurchaseAmount": -1,
"minPurchaseAmount": 6.42,
"minPurchaseCryptoAmount": "-1",
"name": "Ether",
"networkFee": 0.92,
"price": {
"EUR": 1599.6155502309482,
"GBP": 1347.9720299463668,
"PLN": 7433.064745733266,
"USD": 1768.122251523377
},
"symbol": "ETH",
"type": "NATIVE"
}
}

Off-ramp transaction quotation

Endpoint: POST /host-api/v3/offramp/quote/all

Query parameters:

  • hostApiKey: the integration key you've received from us.

Request body:

interface QuoteRequestBody {
cryptoAssetSymbol: string;
fiatCurrency: string;

/*
* Although fiatValue and cryptoAmount are not both required, you need to pass one of them.
* cryptoAmount - should be passed in token wei - e.g. for 1ETH cryptoAmount: 1000000000000000000
*/
cryptoAmount?: string;
fiatValue?: number;
}

Response contents

Payout methods in the response are limited only to the ones that support the currency given in fiatCurrency parameter.

interface QuoteResult {
asset: OfframpAssetInfo;
[PayoutMethodName.AMERICAN_BANK_TRANSFER]: QuoteResultForPayoutMethod;
[PayoutMethodName.CARD]: QuoteResultForPayoutMethod;
[PayoutMethodName.SEPA]: QuoteResultForPayoutMethod;
}

enum PayoutMethodName {
AMERICAN_BANK_TRANSFER = 'AMERICAN_BANK_TRANSFER',
CARD = 'CARD',
SEPA = 'SEPA',
}

interface QuoteResultForPayoutMethod {
fiatCurrency: string; // three-letter currency code
cryptoAmount: string; // number-string, in wei or token units
fiatValue: number; // total fiat value the user receives for the transaction, in fiatCurrency
baseRampFee: number; // base Ramp fee before any modifications, in fiatCurrency
appliedFee: number; // final fee the user pays (included in fiatValue), in fiatCurrency
hostFeeCut?: number;
}

Example

Request

curl -X POST https://api.ramp.network/api/host-api/v3/offramp/quote/all\?hostApiKey\=xxxxxxxxx -H 'content-type: application/json' -d '{
"cryptoAssetSymbol": "ETH_ETH",
"fiatValue": 100,
"fiatCurrency": "USD"
}'

Response

{
"AMERICAN_BANK_TRANSFER": {
"appliedFee": 2.850704833807236,
"baseRampFee": 1.933270973807236,
"cryptoAmount": "54944897097749307",
"fiatCurrency": "USD",
"fiatValue": 100
},
"CARD": {
"appliedFee": 3.709848260447036,
"baseRampFee": 2.792414400447036,
"cryptoAmount": "54458989844503905",
"fiatCurrency": "USD",
"fiatValue": 100
},
"asset": {
"address": null,
"chain": "ETH",
"currencyCode": "USD",
"decimals": 18,
"enabled": true,
"hidden": false,
"logoUrl": "https://assets.ramp.network/crypto-assets/eth.svg",
"maxPurchaseAmount": -1,
"minPurchaseAmount": 6.42,
"minPurchaseCryptoAmount": "-1",
"name": "Ether",
"networkFee": 0.92,
"price": {
"EUR": 1599.6155502309482,
"GBP": 1347.9720299463668,
"PLN": 7433.064745733266,
"USD": 1768.122251523377
},
"symbol": "ETH",
"type": "NATIVE"
}
}