请求分账回退
如果订单已经分账,在退款时,可以先调此接口,将已分账的资金从分账接收方的账户回退给分账方,再发起退款
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| sub_mchid | string | 子商户号 |
| order_id | string | 微信分账单号 |
| out_order_no | string | 商户分账单号 |
| out_return_no | string | 商户回退单号 |
| return_mchid | string | 回退商户号 |
| amount | integer | 回退金额 |
| description | string | 回退描述 |
php
$instance->v3->profitsharing->returnOrders->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => '',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '用户退款',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/profitsharing/return-orders')->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => '',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '用户退款',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/profitsharing/return-orders']->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => '',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '用户退款',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->profitsharing->returnOrders->post([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => '',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '用户退款',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/profitsharing/return-orders')->post([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => '',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '用户退款',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/profitsharing/return-orders']->post([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => '',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '用户退款',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| sub_mchid | string | 子商户号 |
| order_id | string | 微信分账单号 |
| out_order_no | string | 商户分账单号 |
| out_return_no | string | 商户回退单号 |
| return_id | string | 微信回退单号 |
| return_mchid | string | 回退商户号 |
| amount | integer | 回退金额 |
| description | string | 回退描述 |
| result | string | 回退结果PROCESSING | SUCCESS | FAILED 枚举值之一 |
| fail_reason | string | 失败原因ACCOUNT_ABNORMAL | BALANCE_NOT_ENOUGH | TIME_OUT_CLOSED | PAYER_ACCOUNT_ABNORMAL | INVALID_REQUEST 枚举值之一 |
| create_time | string | 创建时间 |
| finish_time | string | 完成时间 |