跳转至

关单接口

请求方式 body 编码 接口地址
POST application/json UTF-8 集测:https://mchapitest.shengpay.com/pay/closeOrder
生产:https://mchapi.shengpay.com/pay/closeOrder

请求参数

变量名 类型 必填 示例值 描述
mchId String(16) Y 93751497 商户号
outTradeNo String(64) Y SDFASDFASF 商户订单号
nonceStr String(32) Y 随机字符串
signType String Y RSA 签名类型
sign String Y 签名 (见签名介绍)

请求示例

1
2
3
4
5
6
7
{
    "mchId": "93751497",
    "nonceStr": "i6ctBYyfNChW83dbBRcSpWjiUQFoVZVi",
    "outTradeNo": "6z8zqza77zwgorfa08pz",
    "sign": "fI4CWmHWomCCdn7yuQ8v3ax41rYQAEfdK3cxi9q3rMJOKMxfEpP1KmaP5a9MMmmyB0sWYXnvYTH46lediqNdrRe/6lTdwH9Yd6TvUy+lX5sxyrvfp+4W4XKQOLgKjjkWhe5YXi94wjFXjjwXnDAJfg8Kxu5zv4jCEG1JJuQYb+GcoHPIsu5Z2DGKDSF3ZDz9ogxP/45aNdVqp61aACExyErgETiDorFAQn75s68XuopQz26+ItZJ2WjojTcMh3gePuZQ2lZpaH4KjZW8CVCp7boQJS2pTZG3WE689ku4zr+cSCp6gZsHufmGkaMLz5yFI38Jry6MdDc+OEIC3sr9FA==",
    "signType": "RSA"
}

响应参数

变量名 类型 必填 示例值 描述
returnCode String Y SUCCESS 返回码(SUCCESS/FAIL)
returnMsg String N 返回消息(当returnCode为FAIL时使用)
resultCode String Y SUCCESS 业务结果(SUCCESS/FAIL)
errorCode String N 错误代码(当resultCode为FAIL时使用)
errorCodeDes String N 错误描述(当resultCode为FAIL时使用)
nonceStr String N 随机字符串
signType String N RSA 签名类型
sign String N 签名 (见签名介绍)

响应示例

1
2
3
4
5
6
7
{
    "returnCode": "SUCCESS",
    "resultCode": "SUCCESS",
    "sign": "J1cNH7Vq8niSfNwxgSUyr8IBU/Lykruia4oo6UEPwwweD3a4cgfZSF34VTgK7ipQdVWbTadmJF1c6e+mOwzMUV8JHEYY0HaBkRXQLOaouv3288hqcaqTtpsRFw/aF8SQ8dcEeB9fmB+AMbHCORa1C3mCZOG1IqWIg4sGUypR5FM=",
    "signType": "RSA",
    "nonceStr": "DSJOSNBSEmXLjKCzVKXEwtUyVAMDPxvM"
}

备注:当订单交易类型为微信或者支付宝交易,才能调用关单接口;另外关单的订单状态必须是PAY_INIT,PAY_ING两种情况下才允许调用;

Back to top