notifyDeal

需要签名验签

万里汇使用此接口向集成商发送远期外汇交易结果通知。集成商收到通知后需做出回应。

接口结构

万里汇接口报文结构包括:请求头,请求体。关于头信息,详见:

请求参数

字段名

数据类型

是否必填

描述

deal

Deal 对象

远期外汇交易的交易明细

dealResult

Result 对象

代表远期外汇交易结果

请求处理

在收到万里汇的请求之后,集成商需要向万里汇发送响应信息,以确认信息已收到。

发送响应信息前,集成商需正确加签。详见:生成签名及加验签 章节。

头信息包括:

响应头参数

是否必填

范例

Signature

Signature: algorithm=RSA256, keyVersion=2, signature=*****

Content-Type

Content-Type: application/json; charset=UTF-8

Client-Id

Client-Id: *****

Response-Time

Response-Time: 2019-04-04T12:08:56+08:00

范例响应体:

copy
{
  "result":{
     "resultStatus":"S",
     "resultCode":"SUCCESS",
     "resultMessage":"success"
  }
}

更多关于响应信息,参考:API概览-响应报文结构

如果集成商不向万里汇发送响应信息,万里汇会重新发送请求通知。万里汇重发通知的规则为:

  • 重试总数:7次
  • 两次重发请求之间的间隔:2分钟,10分钟,10分钟,1小时,2小时,6小时,15小时

响应参数

字段名

数据类型

是否必填

描述

result

Result 对象

代表接口调用结果

结果码

dealResult.resultCode

resultCode

resultStatus

resultMessage

含义

SUCCESS

S

The deal is successfully completed.

远期外汇交易成功

PROCESSING

S

The forward deal is being processed.

远期外汇交易处理中

CANCELLED

F

The forward deal is canceled.

远期外汇交易取消

FAIL

F

The forward deal has failed.

远期外汇交易失败

result.resultCode

系统错误码

resultCode

resultStatus

resultMessage

处理建议

SUCCESS

S

Success

PARAM_ILLEGAL

F

Illegal parameters exist. For example, a non-numeric input, or an invalid date.

参考API文档页面,确认请求头和传参是否正确

PROCESS_FAIL

F

A general business failure occurred. Do not retry.

需要人工介入,联系万里汇技术支持以解决此问题

UNKNOWN_EXCEPTION

U

API failed due to unknown reason.

服务器错误,若稍后重试问题依旧,联系万里汇技术支持以解决问题

REQUEST_TRAFFIC_EXCEED_LIMIT

U

The request traffic exceeds the limit.

重试,若问题依旧,联系万里汇技术支持

INVALID_API

F

The called API is invalid or not active.

确认是否调用正确的API

INVALID_CLIENT

F

The client is invalid.

Client ID不存在或无效

INVALID_SIGNATURE

F

The signature is invalid.

确认请求正确加签,具体参见:

METHOD_NOT_SUPPORTED

F

The server does not implement the requested HTTP method.

确认HTTP请求方法为POST

业务结果码

resultCode

resultStatus

resultMessage

处理建议

UN_SUPPORT_BUSINESS

F

Unsupported business.

包含无效参数(如货币代码错误),使用正确的参数重试

AUTHORIZATION_NOT_EXIST

F

The authorization does not exist.

当前授权关系不存在,请联系万里汇技术支持检查授权关系

CONTRACT_CHECK_FAIL

F

The contract check has failed.

检查合约状态后重试

范例

请求

请求体范例

copy
{
    "deal": {
        "buy": {
            "currency": "USD",
            "value": 1183
        },
        "creditLine": {
            "currency": "USD",
            "value": 0
        },
        "creditLineBase": {
            "currency": "GBP",
            "value": 0
        },
        "dealId": "*****",
        "dealRequestId": "*****",
        "expiredTime": "*****",
        "forwardType": "FLEXIBLE",
        "margin": {
            "currency": "USD",
            "value": 0
        },
        "quote": {
            "quoteCurrencyPair": "EUR/USD",
            "quoteExpiryTime": "2022-07-26T05:48:16Z",
            "quoteId": "*****",
            "quotePrice": "1.18325",
            "quoteStartTime": "2022-07-26T05:47:46Z"
        },
        "sell": {
            "currency": "EUR",
            "value": 1000
        },
        "settledTime": "2022-07-26T06:48:47Z",
        "windowStartTime": "20220729"
    },
    "dealResult": {
        "resultCode": "SUCCESS",
        "resultMessage": "success.",
        "resultStatus": "S"
    }
}

响应

响应头范例

copy
{
"headers": {
  "Content-Type": "application/json",
  "client-id": "*****",
  "response-time": "2022-03-07T07:49:27Z",
  "signature": "algorithm=RSA256,keyVersion=1,signature=VelVji6jp8UJVrBUvZrwij8uPmjc//hfmVJqCCW0x+Yh/HEs5pz9wiMyYLRjykTOii+f5EznxcFIUxPae5KITe3fChufJzFhJ4iku5U/w6exmBWVR5vrvQZSYO0vG5aJKwUQW/jjgaUWg1d+ySmaJ0VZ0pniQRtwYRGCvzdey+gI0+jMFbChIQDemZ0uLCExRQ0SBKAjEH/Vq14KlY88Wr2bR829tqsxaECSq2M5eeDC7j6FGPMazfX1W+EGqa2go2Hif6BnodwXzNsEAfQlUrbwCi9Ey/uNO4ScTX6FVG1nb+q8/k09wTkCz/nHnwTQolDrLRndZqZfz79a344*****"
  }
}

响应体范例

copy
{
    "result": {
        "resultStatus": "S",
        "resultCode": "SUCCESS",
        "resultMessage": "success."
    }
}

@2024 WorldFirst