# 1. Introduction

    ​ This API provides real-time exchange rates between fiat currencies and cryptocurrencies. It supports multiple trading pairs and is available exclusively to Gate Pay merchants.

    # 2. API Interface

    # 2.1 Query Exchange Rate

    • Data Type:JSON (content-type:application/json)

    • Method:POST

    • Path: /v1/pay/currency/exchange/rate/query

    • Verification Method: Signature Verification

    • Request Content:

    Field Name Type Is Required Description
    sourceCurrency string Base currency,
    Supported:EUR/GBP/USD/CNY/JPY/AUD/CAD/CHF
    targetCurrency string Quote currency,
    Supported:USDT
    • Response Content
    Field Name Type Description
    sourceCurrency string Base currency
    targetCurrency string Quote currency
    rate string Exchange rate between base/quote currency and fiat currency
    updateTime long Quote time

    CURL Request

    curl --location 'https://openplatform.gateapi.io/v1/pay/currency/exchange/rate/query' \
                --header 'X-GatePay-Certificate-ClientId: mZ96D37oKk-HrWJc' \
                --header 'Content-Type: application/json' \
                --header 'X-GatePay-Timestamp: 1726027137585' \
                --header 'X-GatePay-Nonce: 2290830087' \
                --header 'X-GatePay-Signature: 601d560c54d53412aca5901256f101e7078b5779f61f30bedfe9a5f0b92f049589952a151ea477371e4a99ac0e1c3cc8dec62654b3c6a1794ef981efe19232bc' \
                --data '{
                "sourceCurrency":"PHP",
                "targetCurrency":"USDT"
    }' 
    

    Response:

    {
      "status": "SUCCESS",
      "code": "000000",
      "errorMessage": "",
      "data": {
    
        "sourceCurrency": "EUR",
        "targetCurrency": "USDT",
        "rate":"0.021",
        "updateTime":132456798
      }
    }
    

    # 3. Error Code

    Error Code Description Solution
    400007 Unsupported mediatype Check the mediatype supported by the API
    400001 Invalid request parameter Verify that the request parameters are valid
    400002 Invalid signature Check that the signature algorithm is correct
    400500 Unsupported currency For other error codes, refer to the official documentation