文档中心 > API类目 > AliOS支付API

aliyun.alios.pay.refund (退款接口)

商户用来发起退款的接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
refund_request RefundRequest 可选 请求参数
  • └ trace_id
  • String
  • 必须
  • 0b0aad0e15441575065206212d0756
  • 请求唯一id,不可重复,服务端会根据此参数防重放
  • └ lang
  • String
  • 必须
  • en
  • 语言,en表示英文,zh表示中文
  • └ time
  • String
  • 必须
  • 1559200938392
  • 请求时间戳
  • └ biz_order_id
  • String
  • 必须
  • 格式由cp自行决定,长度限定64位
  • 业务订单号
  • └ refund_amount
  • Number
  • 必须
  • 10
  • 退款金额,单位分
  • └ refund_reason
  • String
  • 可选
  • 正常退款
  • 退款原因
  • └ out_request_no
  • String
  • 必须
  • 1559200938392
  • 标识一次退款请求,保证唯一

响应参数

名称 类型 示例值 描述
aliospay_response AliOSPayResponse 响应参数
  • └ trace_id
  • String
  • 0b0aad0e15441575065206212d0756
  • 请求唯一id,不可重复,服务端会根据此参数防重放
  • └ code
  • Number
  • 0
  • 错误码
  • └ message
  • String
  • success
  • 错误信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliyunAliosPayRefundRequest req = new AliyunAliosPayRefundRequest();
AliyunAliosPayRefundRequest.RefundRequest obj1 = new AliyunAliosPayRefundRequest.RefundRequest();
obj1.setTraceId("0b0aad0e15441575065206212d0756");
obj1.setLang("en");
obj1.setTime("1559200938392");
obj1.setBizOrderId("格式由cp自行决定,长度限定64位");
obj1.setRefundAmount(10L);
obj1.setRefundReason("正常退款");
obj1.setOutRequestNo("1559200938392");
req.setRefundRequest(obj1);
AliyunAliosPayRefundResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<aliyun_alios_pay_refund_response>
    <aliospay_response>
        <trace_id>0b0aad0e15441575065206212d0756</trace_id>
        <code>0</code>
        <message>success</message>
    </aliospay_response>
</aliyun_alios_pay_refund_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部