Skip to content

创建代付订单

API EndPoint

POST baseUrl/api/payOut

请求参数

参数名必选类型字段说明示例值
accountNameYstring(64)收款人姓名限制最长64个字符Brandme
accountNoYstring(32)收款银行账号03126012345
accountTypeYint账户类型1 请参考代付账户类型
currencyYstring(32)货币代码PKR
amountYdecimal(20,2)金额[100.00,50000.00]
bankIdYint银行 Id请参考代付银行列表
mchOrderNoYstring(32)商户订单号1386556787811426305
notifyUrlYString(250)回调地址https://merchant.com/webhooks
nonceStrYstring(32)随机字符串1863484722378907648
idCardYstring(32)收款人证件号8220296123456
phoneYstring(32)收款人手机号长度10位或者0开头11位3001234567
emailYstring(64)收款人邮箱example@maildomain.com
remarkYstring(32)备注 (请使用英文字符或不带重音的西语)remark
idTypeNstring(32)代付收款人证件类型暂无

请求示例

bash
curl -L 'baseUrl/api/payOut' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"accountName":"Brandme","accountNo":"03126012345","accountType":"1","amount":"100","currency":"PKR","mchOrderNo":"test2280881511","nonceStr":"123456","notifyUrl":"https://testclient.idcashypay.com/stage-api/notify/test","remark":"test","bankId":"1","idCard":"8220296123456","email":"example@maildomain.com","phone":"3001234567"}'

响应参数

参数名类型参数说明
merchantIdint商户 Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
amountdecimal(20,2)金额
feedecimal(20,2)手续费
orderStatusstring订单状态 请参考代付订单状态枚举

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "order000000001",
    "orderNo": "PAYOUT8232147000000000001",
    "amount": 100,
    "fee": 0,
    "orderStatus": "PROCESSING"
  }
}
json
{
  "msg": "System_error",
  "code": 500
}

查询代付订单

API EndPoint

POST baseUrl + /api/payOutQuery

请求参数

参数名必选类型示例值字段说明
mchOrderNoNstring(32)1863484722378907648商户订单号
orderNoNstring(32)PAYOUT8551739282639106048平台订单号
nonceStrYstring(32)9459931608随机字符串

TIP

我们建议优先使用orderNo(平台订单号),平台订单号和商户订单号至少需要传递一个。

请求示例

bash
curl -L 'baseUrl/api/payOutQuery' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"mchOrderNo":"1863484722378907648","nonceStr":"9459931608","orderNo":"PAYOUT8551739282639106048"}'

响应参数

参数名类型说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
channelOrderNostring(32)渠道订单号
amountdecimal(20,2)金额
feedecimal(20,2)手续费
orderStatusstring(32)代付订单状态枚举
resultDescstring(64)订单状态具体描述
completionTimeyyyy-MM-dd HH:mm:ss订单完成完成时间

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1863484722378907648",
    "orderNo": "PAYOUT8551739282639106048",
    "amount": "60000",
    "fee": "5150",
    "orderStatus": "PAYING",
    "completionTime": null,
    "resultDesc": null
  }
}

代付订单结果通知

通知地址由商户提供

POST Merchant NotifyUrl

异步通知请求参数

参数名类型说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
channelOrderNostring(32)渠道订单号
amountdecimal(20,2)金额
feedecimal(20,4)手续费
orderStatusstring(32)代付订单状态枚举
resultDescstring(64)订单状态具体描述
completionTimeyyyy-MM-dd HH:mm:ss订单完成完成时间

异步通知请求示例

bash
curl -L 'merchant.com/webhools/payout' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"amount":60000.00,"completionTime":"2024-12-02 08:42:54","fee":5150.0000,"mchOrderNo":"1863484722378907648","merchantId":"3002124","nonceStr":"1733103774518","orderNo":"PAYOUT8551739282639106048","orderStatus":"SUCCESS","payType":"11"}'
json
{
  "amount": 60000.0,
  "completionTime": "2024-12-02 08:42:54",
  "fee": 5150.0,
  "mchOrderNo": "1863484722378907648",
  "merchantId": "1002001",
  "nonceStr": "1733103774518",
  "orderNo": "PAYOUT8551739282639106048",
  "orderStatus": "SUCCESS",
  "payType": "11"
}
json
{
  "amount": 60000.0,
  "completionTime": "2024-12-02 08:42:54",
  "fee": 5150.0,
  "mchOrderNo": "1863484722378907648",
  "merchantId": "1002001",
  "nonceStr": "1733103774518",
  "orderNo": "PAYOUT8551739282639106048",
  "orderStatus": "FAIL",
  "resultDesc": "ACCOUNT NOT EXITS",
  "payType": "11"
}

订单结果反转处理

请注意,极少数的情况下代付订单会发生结果反转通知,您的回调处理逻辑应当考虑成功->失败,失败->成功状态的处理。

异步通知响应示例

json
{
  "status": "SUCCESS"
}

TIP

当回调响应HTTP状态码为200、301或302时,我们认为商户已经成功接收并处理回调, 其它状态我们会认为商户处理回调失败。

回调失败后会在1,2,4,8,16,32,64,128,256,512分钟重试,一共重试回调10次

Released under the MIT License.