# 同步支付结果

视频号场景请忽略此接口

# 接口调用请求说明

如果action_type=1,即支付成功调用该接口后,订单状态status会从10(待付款)或11(收银台支付完成)变成20(待发货)。

否则,订单状态status会从10(待付款)变成250(取消)

如果订单状态不是10(待付款)将报错,错误码为100000。

transaction_id在以下情况下必填:

action_type=1order/add时传的pay_method_type=0(默认0)时必填

http请求方式:POST
https://api.weixin.qq.com/shop/order/pay?access_token=xxxxxxxxx

# 请求参数示例

{
    "order_id":32434234,
    "out_order_id": "xxxxx",
    "openid": "oTVP50O53a7jgmawAmxKukNlq3XI",
    "action_type": 1, 
    "transaction_id": "131456479687",     
    "pay_time": "2020-03-25 14:04:25"     
}

# 回包示例

{
    "errcode": 0,
    "errmsg":"ok"
}

# 请求参数说明

参数 类型 是否必填 说明
order_id number(uint64) 订单ID
out_order_id string 商家自定义订单ID,与 order_id 二选一
openid string 用户的openid
action_type number 类型,默认1:支付成功,2:支付失败,3:用户取消,4:超时未支付;5:商家取消;10:其他原因取消
action_remark string 其他具体原因
transaction_id string 支付订单号,action_type=1且order/add时传的pay_method_type=0时必填
pay_time string 支付完成时间,action_type=1时必填,yyyy-MM-dd HH:mm:ss

# 回包参数说明

参数 类型 说明
errcode number 错误码
errmsg string 错误信息