Pyvio Open API Docs
首页
指南
收款
付款
换汇
收单
湃付卡
其它
更新日志
首页
指南
收款
付款
换汇
收单
湃付卡
其它
更新日志
  • 换汇

    • 发起一笔换汇
    • 批量查询汇率
    目录

    批量查询汇率

    通过 批量查询汇率接口 (opens new window),可在一次请求中查询多组币种对的参考汇率,适用于需要同时展示或比对多个汇率的场景。

    提示

    • 接口路径:POST /fx/api/v1/batch/rate
    • 权限范围:fx_read
    • 若需锁汇并创建换汇订单,请使用 单笔查询汇率接口 (opens new window) 获取 rate_id(有效期 60 秒),再调用 创建换汇订单 (opens new window)。

    # 请求参数

    参数名 说明
    query_list 币种对列表,不能为空。
    query_list[].origin_currency 卖出币种(原始币种)。
    query_list[].target_currency 买入币种(目标币种)。

    # 响应说明

    data 为数组,与 query_list 顺序一致,每项包含:

    参数名 说明
    unit_id 单元 ID。
    exchange_rate 汇率。
    origin_currency 卖出币种。
    target_currency 买入币种。

    注意

    批量接口不返回 rate_id 与 expire_time,不能用于创建换汇订单。

    # 请求示例

    curl --location --request POST '{$base_url}/fx/api/v1/batch/rate' \
    --header 'Request-Id: {unique_request_id}' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Sign: {signature}' \
    --header 'X-Timestamp: {timestamp_ms}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "query_list": [
            {
                "origin_currency": "USD",
                "target_currency": "CNH"
            },
            {
                "origin_currency": "EUR",
                "target_currency": "USD"
            }
        ]
    }'
    

    # 响应示例

    {
      "code": "SUCCESS",
      "success": true,
      "message": null,
      "data": [
        {
          "unit_id": "UT1675766643661405569",
          "exchange_rate": 7.2456123000,
          "origin_currency": "USD",
          "target_currency": "CNH"
        },
        {
          "unit_id": "UT1675766643661405569",
          "exchange_rate": 1.0854321000,
          "origin_currency": "EUR",
          "target_currency": "USD"
        }
      ]
    }
    

    # 相关文档

    • 发起一笔换汇
    • Open API:Batch Query FX Rate (opens new window)
    发起一笔换汇

    ← 发起一笔换汇

    © PYVIO Rights Reserved
    • 浅色模式
    • 阅读模式