# 报价查询接口

该接口可获取当前 partnerId 基于输入的法定货币金额查询当前加密货币报价，接口正常将返回为报价明细和对应的支付方式详情

## 法定货币查询接口

<mark style="color:blue;">`GET`</mark> `https://api.ramp.fatpay.xyz/open/api/onramp/price`

基于输入的法定货币金额查询当前加密货币报价

#### Query Parameters

| Name                                                 | Type    | Description                                                                                                                                                 |
| ---------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fiatCurrency<mark style="color:red;">\*</mark>       | String  | <p>法币ISO代码 <a data-mention href="/pages/f5zI9xYaAZ8aEEjCEGkp">/pages/f5zI9xYaAZ8aEEjCEGkp</a><br>e.g. USD </p>                                              |
| currencyAmount<mark style="color:red;">\*</mark>     | Decimal | <p>buyType=nft，提交加密货币数量</p><p>buyType=crypto，提交加密货币数量</p><p>buyType=fiat，提交法币数量</p><p>e.g. 199</p>                                                          |
| cryptoCurrencyCode<mark style="color:red;">\*</mark> | String  | <p>加密货币类型 <a data-mention href="/pages/1lZG3OIg0b9HsyneU2vK">/pages/1lZG3OIg0b9HsyneU2vK</a></p><p>e.g. USDT\_ERC20</p>                                     |
| payment                                              | String  | <p>付款方式，来自 <a data-mention href="/pages/evavhaPG8aGp3cfrqGcp#paymentoption">/pages/evavhaPG8aGp3cfrqGcp#paymentoption</a><br> e.g. BANK\_CARD\_TRANSFER</p> |
| buyType                                              | String  | <p>buyType=nft：nft报价查询</p><p>on-ramp不需要该参数</p>                                                                                                              |

#### Headers

| Name                                              | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>    | String  | application/json                                                                                                                                                                                                                                                                                                                                                                                              |
| X-Fp-Version<mark style="color:red;">\*</mark>    | String  | <p>FaTPay API 接口版本</p><p>e.g. v1.0</p>                                                                                                                                                                                                                                                                                                                                                                        |
| X-Fp-Timestamp<mark style="color:red;">\*</mark>  | Integer | <p>Unixtime 时间戳，秒</p><p>e.g. 1661346861</p>                                                                                                                                                                                                                                                                                                                                                                   |
| X-Fp-Nonce<mark style="color:red;">\*</mark>      | Integer | <p>6位随机正整数</p><p>e.g. 868964</p>                                                                                                                                                                                                                                                                                                                                                                              |
| X-Fp-Partner-Id<mark style="color:red;">\*</mark> | String  | <p>申请高级合作伙伴时，由 FaTPay 分配的 partner ID</p><p>e.g. 2yQrS9A0xmM8xpfa</p>                                                                                                                                                                                                                                                                                                                                          |
| X-Fp-Signature<mark style="color:red;">\*</mark>  | String  | <p>由 <code>APIPrivateKey</code> 生成的签名</p><p>e.g. zbBQ+1nv/5up9riH1wbTSSMmkb26LQj3g1cNWsutOordOrtpk8agcA5D5bdYaGeVlHK0qZ2MlUV+ZfOK9cXMuficeIm5fnEjMEm7s1IZtSivMt5te7EFqe52dtVFafE4hUgwqH6QBZB0yZ1FSqHs2dOCI0e8RKJQBDitxtHkibStl1Jt5wulzzq96qWbbVnwoBqGDT52OtwwEcDqMI4SIAzUAdBhAuLqUig1U4Ne9ufT8B1aAohEk5fvn/Sbom21bEjLdgbt5PwH2wmmuBx4tq31IgcP4V+qEBILY2eMAFzkvxNXaX3PsLbj9NpgyIc3HQl0FtRq3gdN7FsSvyvcWA==</p> |

{% tabs %}
{% tab title="200: OK 正常返回" %}

```javascript
{
    "code": 10000,
    "msg": "Success",
    "data": {
        "fiatCurrency": "USD",
        "currencyAmount": 199,
        "cryptoCurrency": "USDT",
        "network": "ethereum_rinkeby",
        "cryptoCurrencyCode": "USDT_ERC20" 
        "cryptoCurrencyAmount": 182.0,
        "gasFee": 1.32,
        "cryptoCurrencyUnitPrice": 1.03,
        "platformFee": 11.94,
        "totalFee": 13.26,
        "paymentOptions": {
            "name": "CREDIT_DEBIT_CARD",
            "processingTime": "3 - 7Min",
            "icon": "https://fatpay.xyz/img/1.png",
            "maxAmount": 4000,
            "minAmount": 1
        }
    }
}
```

{% endtab %}
{% endtabs %}

## 返回的对象

### `CryptoCurrencyQuote`

<table><thead><tr><th>参数名称</th><th width="127">类型</th><th width="114">是否必须</th><th>参数说明</th></tr></thead><tbody><tr><td>fiatCurrency</td><td>String</td><td>是</td><td>法币ISO代码，如 USD、THB</td></tr><tr><td>currencyAmount</td><td>Decimal</td><td>是</td><td>法币金额，最多 2 位小数，如 199</td></tr><tr><td>cryptoCurrency</td><td>String</td><td>是</td><td>加密货币名称，如 USDT</td></tr><tr><td>network</td><td>String</td><td>是</td><td>加密货币所在公链，如ethereum_mainnet</td></tr><tr><td>cryptoCurrencyCode</td><td>String</td><td>是</td><td>加密货币标识码，如 USDT_ERC20</td></tr><tr><td>cryptoCurrencyAmount</td><td>Decimal</td><td>是</td><td>加密货币数量，最多 2 位小数，如 182</td></tr><tr><td>cryptoCurrencyUnitPrice</td><td>Decimal</td><td>是</td><td>加密货币单价，最多 2 位小数，如 1.03</td></tr><tr><td>gasFee</td><td>Decimal</td><td>是</td><td>网络手续费，最多 2 位小数，如 1.32，按照购买的Token为计价单位，如TRX</td></tr><tr><td>platformFee</td><td>Decimal</td><td>是</td><td>平台支付手续费，最多 2 位小数，如 11.94，按照用户支付的法币为计价单位，如USD</td></tr><tr><td>totalFee</td><td>Decimal</td><td>是</td><td>totalFee=platformFee</td></tr><tr><td>paymentOptions</td><td>Object</td><td>是</td><td>法币支持的付款方式，见 <a data-mention href="/pages/evavhaPG8aGp3cfrqGcp#paymentoption">/pages/evavhaPG8aGp3cfrqGcp#paymentoption</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.fatpay.org/zh/reference/api-reference/on-ramp-apis/retrieve-quoted-price.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
