# V1 Reference

Here is the list of endpoint that exposed by V1 Ramp API and their details.

## Get available assets and price list

<mark style="color:blue;">`GET`</mark> `https://rampapi.fanbase.io/v1/host-api/assets`

This endpoint returns the list of all existing available assets and their detail metadata including price

{% tabs %}
{% tab title="200: OK Returns asset list" %}

<pre class="language-json"><code class="lang-json">{
  "data": {
      "minPurchaseAmountEur": 3,
      "maxPurchaseAmountEur": 20000,
      "minFeePercent": 0.99,
      "maxFeePercent": 3.9,
      "minFeeAmountEur": 2.49,
      "assets": [
<strong>          {
</strong>				"symbol": "ARBITRUM_ETH",
				"type": "ARBITRUM",
				"apiV3Symbol": "ETH",
				"apiV3Type": "ETH",
				"chain": "ARBITRUM",
				"name": "Ethereum",
				"decimals": 18,
				"address": null,
				"logoUrl": "https://assets.ramp.network/crypto-assets/arbitrum-eth.svg",
				"enabled": true,
				"hidden": false,
				"priceEur": 2750.07361133435,
				"priceUpdateTs": "2024-02-21T06:15:01.578Z",
				"price": {
					"BWP": 40719.44618910404,
					"KES": 434224.855664711,
					"MZN": 188865.92538205357,
					"UYU": 116190.87408594298,
					"MXN": 50691.30385623157,
					"ZAR": 56135.685086209625,
					"PYG": 21692464.730602633,
					"RON": 13680.769193716102,
					"GBP": 2354.1372632897096,
					"CHF": 2619.3406119987376,
					"USD": 2974.14410903865,
					"LAK": 61979755.90144539,
					"MDL": 53199.38199006294,
					"KWD": 915.053993288169,
					"ILS": 10923.746146365907,
					"PLN": 11868.146175160626,
					"DOP": 174122.87700426645,
					"HUF": 1066318.8304503355,
					"GEL": 7866.758819859422,
					"EUR": 2750.07361133435,
					"BMD": 2974.14410903865,
					"LKR": 926505.4758104763,
					"DKK": 20500.838996807226,
					"HKD": 23256.775765080936,
					"RSD": 322296.16116470564,
					"MKD": 169501.60655652886,
					"NGN": 4777364.389410641,
					"BGN": 5378.475715882435,
					"CRC": 1527480.8853941762,
					"ISK": 408055.27068234497,
					"MYR": 14253.593026515377,
					"KZT": 1346489.0175273463,
					"BAM": 5379.93050482283,
					"TJS": 32496.335580761523,
					"COP": 11654604.716537552,
					"PEN": 11285.804337592519,
					"BRL": 14656.297305717511,
					"THB": 106627.57560473612,
					"SGD": 3995.496697625725,
					"CZK": 69811.23464021142,
					"HNL": 73315.90919998063,
					"GTQ": 23169.405926448846,
					"INR": 246544.00575362172,
					"NZD": 4803.883585751069,
					"SEK": 30775.147009635693
				},
				"minPurchaseAmountEur": 3.13,
				"maxPurchaseAmountEur": -1,
				"minPurchaseCryptoAmount": "19",
				"networkFeeEur": 1.24,
				"networkParamsUpdatedAt": "2024-02-21T06:16:02.232Z"
			},
			{
				"symbol": "DOGE",
				"type": "DOGE",
				"apiV3Symbol": "DOGE",
				"apiV3Type": "NATIVE",
				"chain": "DOGE",
				"name": "Dogecoin",
				"decimals": 8,
				"address": null,
				"logoUrl": "https://assets.ramp.network/crypto-assets/doge.svg",
				"enabled": true,
				"hidden": false,
				"priceEur": 0.07844897064014208,
				"priceUpdateTs": "2024-02-21T06:15:01.578Z",
				"price": {
					"BWP": 1.1615684123531258,
					"KES": 12.386756780933066,
					"MZN": 5.387614852982433,
					"UYU": 3.3144765406471843,
					"MXN": 1.4460269687103122,
					"ZAR": 1.6013341217639554,
					"PYG": 618.8021737853283,
					"RON": 0.3902594666517497,
					"GBP": 0.0671544369901689,
					"CHF": 0.074719663473851,
					"USD": 0.08484083586995958,
					"LAK": 1768.0428738183753,
					"MDL": 1.5175727437300042,
					"KWD": 0.026102953592859596,
					"ILS": 0.31161225546279997,
					"PLN": 0.3385523380213605,
					"DOP": 4.9670526670946025,
					"HUF": 30.41795473337923,
					"GEL": 0.22440822280127676,
					"EUR": 0.07844897064014208,
					"BMD": 0.08484083586995958,
					"LKR": 26.429620127339266,
					"DKK": 0.5848096974315059,
					"HKD": 0.6634259212770526,
					"RSD": 9.193863749840741,
					"MKD": 4.835225683198408,
					"NGN": 136.2797407231186,
					"BGN": 0.15342712347225237,
					"CRC": 43.57312569299705,
					"ISK": 11.64023967117824,
					"MYR": 0.4065999165422674,
					"KZT": 38.41012726638397,
					"BAM": 0.15346862297772096,
					"TJS": 0.9269948503852701,
					"COP": 332.4608255800457,
					"PEN": 0.32194037624345717,
					"BRL": 0.418087513108986,
					"THB": 3.0416725987152096,
					"SGD": 0.11397607752497256,
					"CZK": 1.99144469226943,
					"HNL": 2.091419511310433,
					"GTQ": 0.6609335974798153,
					"INR": 7.032947550623736,
					"NZD": 0.137036230893613,
					"SEK": 0.8778959931307244
				},
				"minPurchaseAmountEur": 0.95,
				"maxPurchaseAmountEur": -1,
				"minPurchaseCryptoAmount": "1200000002",
				"networkFeeEur": 0.37,
				"networkParamsUpdatedAt": "2024-02-21T06:16:02.232Z"
			}
      ]
  },
  "success": true
}
</code></pre>

{% endtab %}
{% endtabs %}

## Get service available county list

<mark style="color:blue;">`GET`</mark> `https://rampapi.fanbase.io/v1/host-api/countries`

This endpoint returns the list of service available countries

{% tabs %}
{% tab title="200: OK Returns country list" %}

```json
{
  "data": [
    {
			"code": "ee",
			"name": "Estonia",
			"cardPaymentsEnabled": true,
			"mainCurrencyCode": "EUR"
		},
		{
			"code": "fi",
			"name": "Finland",
			"cardPaymentsEnabled": true,
			"mainCurrencyCode": "EUR"
		},
		{
			"code": "nz",
			"name": "New Zealand",
			"cardPaymentsEnabled": true,
			"mainCurrencyCode": "USD"
		},
		{
			"code": "sg",
			"name": "Singapore",
			"cardPaymentsEnabled": true,
			"mainCurrencyCode": "USD"
		}
  ]
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Get purchase status

<mark style="color:blue;">`GET`</mark> `https://rampapi.fanbase.io/v1/host-api/purchase/{id}`

This endpoint returns list staking data that staked by user

#### Path Parameters

| Name                                 | Type   | Description                                                      |
| ------------------------------------ | ------ | ---------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | String | Id of the purchase, received from a SDK event or a webhook call. |

#### Query Parameters

| Name                                     | Type   | Description                                                            |
| ---------------------------------------- | ------ | ---------------------------------------------------------------------- |
| secret<mark style="color:red;">\*</mark> | String | The `purchaseViewToken` received with the same purchase created event. |

{% tabs %}
{% tab title="200: OK Returns purchase status" %}

```json
{
  "id": "123",
  "endTime": "2019-10-29T15:41:41.065Z",
  "asset": {
    "address": null,
    "symbol": "ETH",
    "name": "Ether",
    "decimals": 18,
    "type": "ETH"
  },
  "cryptoAmount": "30000000000000000",
  "fiatCurrency": "GBP",
  "fiatValue": 0.04,
  "assetExchangeRate": 1.27378941587846,
  "assetExchangeRateEur": 1.51277630353432,
  "baseRampFee": 0.09892653257425743,
  "networkFee": 0.008420210000000001,
  "appliedFee": 0.10734674257425743,
  "purchaseViewToken": "...",
  "receiverAddress": "0x2222222222222222222222222222222222222222",
  "createdAt": "2019-10-24T14:41:39.372Z",
  "updatedAt": "2019-10-24T15:41:41.065Z",
  "status": "INITIALIZED",
  "finalTxHash": null,
  "paymentMethodType": "MANUAL_BANK_TRANSFER",
  "purchaseViewToken": "4eb9ndrsb59erawh"
}
```

{% endtab %}
{% endtabs %}

## Get purchase quotation

<mark style="color:green;">`POST`</mark> `https://stakingapi.fanbase.io/v1/host-api/quote`

This endpoint returns a subset of the Ramp Purchase object.

#### Request Body

| Name                                                | Type   | Description               |
| --------------------------------------------------- | ------ | ------------------------- |
| cryptoAssetSymbol<mark style="color:red;">\*</mark> | String | Cryptocuurrecy symbol     |
| fiatCurrency<mark style="color:red;">\*</mark>      | String | Fiat currency symbol      |
| cryptoAmount                                        | String | Cryptocurrency amount     |
| fiatValue                                           | String | Fiat currency amount      |
| paymentMethodType                                   | String | Payment method enum value |

{% tabs %}
{% tab title="200: OK Returns purchase quotation" %}

```json
{
	"data": {
		"fiatCurrency": "USD",
		"cryptoAmount": "10",
		"fiatValue": 2.75,
		"fiatExchangeRateEur": 0.9246605108934255,
		"assetExchangeRateEur": 326.4276596140405,
		"baseRampFee": 2.69288022,
		"networkFee": 0.0540739,
		"appliedFee": 2.74695412,
		"asset": {
			"address": null,
			"symbol": "BSC_BNB",
			"apiV3Symbol": "BNB",
			"name": "Binance Coin",
			"decimals": 18,
			"type": "BSC",
			"apiV3Type": "NATIVE",
			"chain": "BSC"
		},
		"cryptoAssetSymbol": "BSC_BNB",
		"paymentMethodType": "CARD_PAYMENT",
		"hostFeeCut": 0,
		"assetExchangeRate": 353.02433246407327
	},
	"success": true
}
```

{% endtab %}

{% tab title="400: Bad Request Returns error exception message" %}

```json
{
	"statusCode": 400,
	"error": "Bad Request",
	"message": "\"value\" contains a conflict between optional exclusive peers [cryptoAmount, fiatValue]",
	"validation": {
		"source": "payload",
		"keys": [
			""
		]
	}
}
```

{% endtab %}
{% endtabs %}
