文档中心 > API类目 > 业务平台新零售

alibaba.tmi.fx.rate.info (获取汇率信息)

获取外汇汇率信息

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
currency_from String 必须 USD 标准货币对
currency_to String 必须 MYR 标准货币对
source String 可选 MYR_BNMK 数据来源,MYR_BNMK表示马来西亚央行

响应参数

名称 类型 示例值 描述
common_result CommonResult 接口结果
  • └ message
  • String
  • demo
  • message
  • result
  • Result
  • result
  • └ bid_price
  • String
  • 6.9244
  • 买入价
  • └ price_source
  • String
  • Bloomberg Fixing
  • 来源
  • └ market_average
  • String
  • 0
  • 市场平均价
  • └ mid_price
  • String
  • 6.9248
  • 中间价
  • └ mid_close_price
  • String
  • 6.91995
  • 中间价(收盘价)
  • └ ask_close_price
  • String
  • 6.9222
  • 卖出价(收盘价)
  • └ market_low
  • String
  • 6.9189
  • 市场最低价
  • └ bid_close_price
  • String
  • 6.9177
  • 买入价(收盘价)
  • └ market_high
  • String
  • 6.9266
  • 市场最高价
  • └ currency_pair
  • String
  • USDCNY BFIX Curncy
  • 货币对
  • └ ask_price
  • String
  • 6.9252
  • 卖出价
  • └ market_last
  • String
  • 6.1758
  • reference rate
  • └ last_update_dt
  • String
  • 19/06/2019
  • reference date 更新日期(一天更新一次)
  • └ exception
  • String
  • demo
  • 异常信息
  • └ success_flag
  • Boolean
  • true
  • 成功标识

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaTmiFxRateInfoRequest req = new AlibabaTmiFxRateInfoRequest();
req.setCurrencyFrom("USD");
req.setCurrencyTo("MYR");
req.setSource("MYR_BNMK");
AlibabaTmiFxRateInfoResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_tmi_fx_rate_info_response>
    <common_result>
        <message>demo</message>
        <result>
            <bid_price>6.9244</bid_price>
            <price_source>Bloomberg Fixing</price_source>
            <market_average>0</market_average>
            <mid_price>6.9248</mid_price>
            <mid_close_price>6.91995</mid_close_price>
            <ask_close_price>6.9222</ask_close_price>
            <market_low>6.9189</market_low>
            <bid_close_price>6.9177</bid_close_price>
            <market_high>6.9266</market_high>
            <currency_pair>USDCNY BFIX Curncy</currency_pair>
            <ask_price>6.9252</ask_price>
            <market_last>6.1758</market_last>
            <last_update_dt>19/06/2019</last_update_dt>
        </result>
        <exception>demo</exception>
        <success_flag>true</success_flag>
    </common_result>
</alibaba_tmi_fx_rate_info_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部