换汇申请
- Endpoint:
POST /aggregate-pay/api/gateway/exchange - Tags: 外汇(老)
Description
换汇功能用于将商户不同币种之间的可用余额进行换汇(当前仅支持其中一个币种为USD)。
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
Content-Type | header | string | Yes | ||
sign | header | string | Yes | 签名信息请参考技术文档 |
Parameter Examples
Content-Type:"application/json"sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
version | string | Yes | 接口版本 当前值为:1.1 | ||
keyVersion | string | Yes | maxLength: 8 | 密钥版本 当前值为:1 | |
requestTime | string | Yes | maxLength: 32 | 请求时间,符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX 时间需要在当前时间两分钟内 | |
appId | string | Yes | maxLength: 64 | 商户应用Id,PayerMax分配给商户应用的唯一标识 | |
merchantNo | string | No | maxLength: 32 | 商户号,商户与PayerMax业务签约时生成的唯一标识 | |
data | object | Yes | |||
data.ccyPair | string | Yes | maxLength: 6, minLength: 6 | 货币对 | |
data.outTradeNo | string | Yes | maxLength: 64, minLength: 1 | 商户订单号 | |
data.side | string | Yes | 针对交易货币的买卖方向,买入BUY,卖出SELL | ||
data.transactionAmount | string | Yes | maxLength: 162 | 交易货币金额 | |
data.transactionCcy | string | Yes | maxLength: 3, minLength: 3 | 交易货币 | |
data.targetCcy | string | Yes | maxLength: 3, minLength: 3 | 目标币种 | |
data.rateVersion | string | No | maxLength: 64 | 汇率版本,如果不输入则表示使用最近一次版本进行交易 |
Example
json
{
"version": "1.1",
"keyVersion": "1",
"requestTime": "2022-11-17T09:20:21.000Z",
"appId": "2222fd568ab5452b906a3d65a1fbac19",
"merchantNo": "P01010113842047",
"data": {
"ccyPair": "USDINR",
"outTradeNo": "exchange1668765794665}",
"side": "BUY",
"targetCcy": "INR",
"transactionAmount": "0.1",
"transactionCcy": "USD"
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | 返回码,’APPLY_SUCCESS’代表成功 | ||
msg | string | Yes | 返回描述,’Success.’ | ||
data | object | Yes | |||
data.transactionCcy | string | Yes | maxLength: 3 | ||
data.side | string | Yes | maxLength: 4 | ||
data.tradeNo | string | Yes | maxLength: 64 | ||
data.targetAmount | string | Yes | maxLength: 133333200 | ||
data.rateTime | string | Yes | maxLength: 13 | 符合rfc3339规范,格式:yyyy-MM-dd’T’HH:mm:ss.SSSXXX | |
data.completeTime | string | Yes | maxLength: 32 | 符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX | |
data.errorCode | string | Yes | maxLength: 32 | ||
data.rateVersion | string | Yes | maxLength: 64 | ||
data.targetCcy | string | Yes | maxLength: 3 | ||
data.errorMsg | string | Yes | maxLength: 256 | ||
data.ccyPair | string | Yes | maxLength: 6 | ||
data.rate | string | Yes | maxLength: 248 | ||
data.outTradeNo | string | Yes | maxLength: 64 | ||
data.transactionAmount | string | Yes | maxLength: 162 | ||
data.status | string | Yes | maxLength: 32 |
Response Example
json
{
"msg": "",
"code": "APPLY_SUCCESS",
"data": {
"transactionCcy": "USD",
"side": "BUY",
"tradeNo": "20221118100315TU69880006003061",
"targetAmount": "7.77",
"rateTime": "2022-11-18T10:03:15.000Z",
"completeTime": "2022-11-18T10:03:15.000Z",
"errorCode": "",
"rateVersion": "batch0034166876579518629680057",
"targetCcy": "INR",
"errorMsg": "",
"ccyPair": "USDINR",
"rate": "77.6983742600",
"outTradeNo": "exchange1668765794665",
"transactionAmount": "0.10",
"status": "SUCCESS"
}
}