请求分账回退
如果订单已经分账,在退款时,可以先调此接口,将已分账的资金从商户类型的分账接收方的账户回退给分账方,再发起退款。
请求参数 | 类型 | 描述 |
---|---|---|
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->brand->profitsharing->returnorders->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => 'P20150806125346',
'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/brand/profitsharing/returnorders')->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => 'P20150806125346',
'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/brand/profitsharing/returnorders']->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => 'P20150806125346',
'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->brand->profitsharing->returnorders->post([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => 'P20150806125346',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '分账回退',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/brand/profitsharing/returnorders')->post([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => 'P20150806125346',
'out_return_no' => 'R20190516001',
'return_mchid' => '86693852',
'amount' => 10,
'description' => '分账回退',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/brand/profitsharing/returnorders']->post([
'json' => [
'sub_mchid' => '1900000109',
'order_id' => '3008450740201411110007820472',
'out_order_no' => 'P20150806125346',
'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_mchid | string | 回退商户号 |
amount | integer | 回退金额 |
return_no | string | 微信回退单号 |
result | string | 回退结果 |
fail_reason | string | 失败原因 |
finish_time | string | 完成时间 |
参阅 官方文档
查询分账回退结果
商户需要核实回退结果,可调用此接口查询回退结果。如果分账回退接口返回状态为处理中,可调用此接口查询回退结果
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
sub_mchid | string | 子商户号 |
out_return_no | string | 商户回退单号 |
order_id | string | 微信分帐单号 |
out_order_no | string | 商户分账单号 |
php
$instance->v3->brand->profitsharing->returnorders->getAsync([
'query' => [
'sub_mchid' => '1900000109',
'out_return_no' => 'R20190516001',
'order_id' => '4208450740201411110007820472',
'out_order_no' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/brand/profitsharing/returnorders')->getAsync([
'query' => [
'sub_mchid' => '1900000109',
'out_return_no' => 'R20190516001',
'order_id' => '4208450740201411110007820472',
'out_order_no' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/brand/profitsharing/returnorders']->getAsync([
'query' => [
'sub_mchid' => '1900000109',
'out_return_no' => 'R20190516001',
'order_id' => '4208450740201411110007820472',
'out_order_no' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->brand->profitsharing->returnorders->get([
'query' => [
'sub_mchid' => '1900000109',
'out_return_no' => 'R20190516001',
'order_id' => '4208450740201411110007820472',
'out_order_no' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/brand/profitsharing/returnorders')->get([
'query' => [
'sub_mchid' => '1900000109',
'out_return_no' => 'R20190516001',
'order_id' => '4208450740201411110007820472',
'out_order_no' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/brand/profitsharing/returnorders']->get([
'query' => [
'sub_mchid' => '1900000109',
'out_return_no' => 'R20190516001',
'order_id' => '4208450740201411110007820472',
'out_order_no' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
sub_mchid | string | 子商户号 |
order_id | string | 微信分账单号 |
out_order_no | string | 商户分账单号 |
out_return_no | string | 商户回退单号 |
return_mchid | string | 回退商户号 |
return_no | string | 微信回退单号 |
amount | integer | 回退金额 |
result | string | 回退结果 |
fail_reason | string | 失败原因 |
finish_time | string | 完成时间 |
参阅 官方文档