卖家同意退款,支持批量退款,只允许子账号操作。淘宝/天猫退款一次最多能退20笔,总金额不限。新增是否需要短信验证,默认为需要。
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
code | String | 可选 | 839212 | 短信验证码,如果退款金额达到一定的数量,后端会返回调用失败,并同时往卖家的手机发送一条短信验证码。接下来用收到的短信验证码再次发起API调用即可完成退款操作。 | |
refund_infos | String | 必须 | 43234234|20000|1409294148714,3123123|12000|1409294148715 | 退款信息,格式:refund_id|amount|version|phase,其中refund_id为退款编号,amount为退款金额(以分为单位),version为退款最后更新时间(时间戳格式),phase为退款阶段(可选值为:onsale, aftersale,天猫退款必值,淘宝退款不需要传),多个退款以半角逗号分隔。 | |
ignore_code | Boolean | 可选 | false |
|
是否不校验短信验证码,如果为true,则不会校验短信验证码,直接对传入的退款单进行同意退款操作。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
message | String | 信息 | 信息 |
succ | Boolean | true | 操作成功 |
results | RefundMappingResult [] | 退款操作结果列表 | |
|
|||
msg_code | String | OP_SUCC | 批量退款操作情况,可选值:OP_SUCC(全部成功),SOME_OP_SUCC(部分成功),OP_FAILURE_UE(全部失败) |
1 2 3 4 5 6 7 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); RpRefundsAgreeRequest req = new RpRefundsAgreeRequest(); req.setCode( "839212" ); req.setRefundInfos( "43234234|20000|1409294148714,3123123|12000|1409294148715" ); req.setIgnoreCode( false ); RpRefundsAgreeResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 7 8 9 10 11 12 | < rp_refunds_agree_response > < message >信息</ message > < succ >true</ succ > < results > < refund_mapping_result > < message >succ</ message > < refund_id >54324331233</ refund_id > < succ >true</ succ > </ refund_mapping_result > </ results > < msg_code >OP_SUCC</ msg_code > </ rp_refunds_agree_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|---|---|
isv.invalid-parameter:code.invalid | 传入了无效的code | 请检查传入的短信验证码是否正确,或者是否已经被使用过了。 |
isv.invalid-parameter:refund_infos | 传入了无效的refund_infos | 请检查refund_infos的格式是否正确。 |