Skip to content

创建代收订单

API EndPoint

POST baseUrl + /api/payIn

请求参数

参数名必选类型字段说明示例
currencyYstring(32)货币代码NGN
payTypeYint代收支付产品编号代收paytype枚举
amountYdecimal(20,2)金额10000
reusableStatusNboolean是否多次支付只能false,无实际作用
mchOrderNoYstring(32)商户订单号商户订单号(不允许重复)
expireTimeNlong过期时间不传默认 86400
notifyUrlYstring(250)回调地址https://merchant.com/webhooks
nonceStrYstring(32)随机字符串
remarkNstring(32)备注请使用英文字符
realNameYstring(64)代收付款人姓名Jeck-Ma
phoneYstring(32)代收付款人手机号尽量传真实的手机号
emailYstring(64)邮箱邮箱格式要正确,尽量传真实的邮箱
idTypeNstring(32)付款人证件类型payType=710,711(VA)必传 代收付款人证件类型
idCardNstring(32)代收付款人证件号payType=710,711(VA)必传 请传入真实且合法的号码
bankAccountNString(32)银行帐号payType=710,711(VA)必传 请传入真实且合法的银行帐号
bankIdNint银行IdpayType=710,711(VA)必传 代收银行列表查询

INFO

realName不能有特殊字符,名字在前-姓在后中间使用 - 字符隔开 例如 Jeck-Ma 嘉诚-李

请求示例

bash
curl -L 'baseUrl/api/payIn' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"realName":"Reza Wijaya","amount":"20000.00","reusableStatus":false,"payType":"43","expireTime":3600,"mchOrderNo":"1386556787811426305","notifyUrl":"https://merchant.com/webhooks/payin","currency":"IDR","remark":"Electronic Cigarettes","nonceStr":"16a5a70f43384134bfae33acc77132e0"}'

响应参数

参数名类型说明
merchantIdlong商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
amountdecimal(20,2)金额
orderFeedecimal(20,2)手续费
payCodestring(32)付款账户 VA
payUrlstring(250)收银台支付地址

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556787811426305",
    "orderNo": "PAYIN8551844049125523456",
    "payCode": "RN123456",
    "payUrl": "https://gcash.com/pay?bizNo=20241202111212800110166154827",
    "biller": "Gcash",
    "amount": "20000",
    "orderFee": "1700"
  }
}
json
{
  "msg": "Payin_Order_Error",
  "code": 500
}

查询代收订单

API EndPoint

POST baseUrl + /api/payInQuery

请求参数

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

TIP

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

请求示例

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

响应参数

参数名类型字段说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
channelOrderNostring(32)渠道订单号
payTypestring(32)代收PayType枚举
payCodestring(32)支付码
payUrlstring(250)付款二维码
amountdecimal(20,0)金额
feedecimal(20,4)手续费
orderStatusstring(32)代收订单状态枚举
completionTimedate完成时间

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556575370063873",
    "orderNo": "PAYIN8551843837024997376",
    "payType": "43",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=202412021112128001101660361270",
    "payDeskUrl": "https://idpaydesk2.brcashypro.com/views/pay.html?PAYIN8551843837024997376",
    "amount": "20000",
    "fee": "1700",
    "orderStatus": "PAYING",
    "completionTime": null,
    "nonceStr": null
  }
}
json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556575370063873",
    "orderNo": "PAYIN8551843837024997376",
    "payType": "43",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=202412021112128001101660361270",
    "payDeskUrl": "https://idpaydesk2.brcashypro.com/views/pay.html?PAYIN8551843837024997376",
    "amount": "20000",
    "fee": "1700",
    "orderStatus": "SUCCESS",
    "completionTime": "2024-12-02 15:40:50",
    "nonceStr": null
  }
}

代收订单结果通知

异步通知请求

通知地址由商户提供

POST Merchant NotifyUrl

异步通知请求参数

参数名类型说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
amountdecimal(20,2)金额
feedecimal(20,4)手续费
payUrlstring(32)收银台Url
payDeskUrlstring(250)收银台地址
payTypestring(32)代收PayType枚举
orderStatusstring(32)代收订单状态枚举
completionTimedate完成时间
nonceStrstring(32)随机字符串
patchOrderNostring(32)关联的原订单的平台订单号
patchMchOrderNostring(32)关联的原订单的商户订单号
orderTypestring(32)API=API接口 MCH=商户后台 DESK=收银台 PATCH=补单

异步通知请求示例

bash
curl -L 'merchant.com/webhooks/payin' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"amount":20000.00,"completionTime":"2024-12-02 12:07:06","fee":2500.0000,"mchOrderNo":"1386503284355244033","merchantId":"3002120","nonceStr":"1733116026894","orderNo":"PAYIN8551790545658687488","orderStatus":"SUCCESS","payCode":"OR.GPNQR..INOPROID_BS","payType":"41","payUrl":"https://payurl.com"}'
json
{
  "amount": 1000.0,
  "completionTime": "2024-11-24 21:56:55",
  "fee": 2.0,
  "mchOrderNo": "order_xxxxxxxxxxxxxx",
  "merchantId": "1012345",
  "nonceStr": "1732507016285",
  "orderNo": "PAYIN1234500000000001",
  "orderStatus": "SUCCESS",
  "orderType": "API",
  "patchMchOrderNo": "order_xxxxxxxxxxxxxx",
  "patchOrderNo": "PAYIN1234500000000001",
  "payCode": "60088888888888",
  "payType": "69",
  "payUrl": "https://xxxxx.xxxx.com/xxx/xx/xxx"
}
json
{
  "amount": 1000.0,
  "completionTime": "2024-11-24 21:56:55",
  "fee": 2.0,
  "mchOrderNo": "order_xxxxxxxxxxxxxx",
  "merchantId": "2004015",
  "nonceStr": "1732507016285",
  "orderNo": "PAYIN1234500000000002",
  "orderStatus": "SUCCESS",
  "orderType": "PATCH",
  "patchMchOrderNo": "order_xxxxxxxxxxxxxx0001",
  "patchOrderNo": "PAYIN1234500000000001",
  "payCode": "60088888888888",
  "payType": "69"
}

TIP

feecompletionTime 仅在订单成功支付时有值。completionTime的格式为 yyyy-MM-dd HH:mm:ss

关于orderTypePATCH时的补充说明

用户不按照订单金额付款或者重复付款会出现补单订单,此时补单订单的orderTypePATCH:

  • orderNo是针对这笔订单新生成的平台订单号。
  • patchOrderNo 为关联的原订单的平台订单号,
  • patchMchOrderNo为关联的原订单的商户订单号。
  • mchOrderNo 为关联的原订单的商户订单号(带序列号标识)。注意,此时回调返回的 mchOrderNo 末尾会增加序列号标识,用于区分多笔部分还款的订单。

例如您的商户订单号是MCH20230088,当产生第一笔部分支付时,我们会在原订单的商户订单号mchOrderNo末尾增加序列号00001 ,您收到的回调的mchOrderNo就是MCH2023008800001,以此类推。

当发生补单行为时,我们的机器人也会在对应的商户群进行通知,通知会包含所有您需要的信息。

订单的orderTypeAPI时:

  • patchOrderNo 和orderNo相同
  • patchMchOrderNo 和mchOrderNo相同

此时上述参数没有额外的意义。

TIP

Http响应状态码为200、301或302表示已正常发送回调,其它状态码我们会认为回调失败。回调失败后会在1,2,4,8,16,32,64,128,256,512分钟 重试,一共重试回调10次。

Released under the MIT License.