申请退款API(支持单品)报错:“invalid detail参数格式错误”该如何处理
接口URL:
https://api.mch.weixin.qq.com/secapi/pay/refundv2
接口文档地址:
https://pay.weixin.qq.com/wiki/doc/api/danpin.php?chapter=9_103&index=3
问题:
申请退款API(支持单品)报错:“invalid detail参数格式错误”该如何处理?
请求参数:
<xml>
<appid>wx355cXXX67063c515</appid>
<detail>{"goods_detail":[{"goods_id":"10","refund_amount":19600,"refund_quantity":"2","price":9800}]}</detail>
<mch_id>1560XXX761</mch_id>
<nonce_str>0o22pS6XXXXGtk9N1QzgXUbMOAgQZmFi</nonce_str>
<op_user_id>15608XXX61</op_user_id>
<out_refund_no>20210520XXX2875794</out_refund_no>
<out_trade_no>202XXX207551914670</out_trade_no>
<refund_fee>14700</refund_fee>
<total_fee>14700</total_fee>
<sign>FA682DXXXD710A3E07A9B25972DEFB7E</sign>
</xml>
返回报错:“invalid detail参数格式错误”
解决方案:
<detail>{"goods_detail":[{"goods_id":"10","refund_amount":19600,"refund_quantity":"2","price":9800}]}</detail>
"refund_quantity":"2"改为"refund_quantity":2