Skip to content

请求分账回退

如果订单已经分账,在退款时,可以先调此接口,将已分账的资金从商户类型的分账接收方的账户回退给分账方,再发起退款。

请求参数类型描述
jsonobject声明请求的JSON数据结构
sub_mchidstring子商户号
order_idstring微信分账单号
out_order_nostring商户分账单号
out_return_nostring商户回退单号
return_mchidstring回退商户号
amountinteger回退金额
descriptionstring回退描述
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_mchidstring子商户号
order_idstring微信分账单号
out_order_nostring商户分账单号
out_return_nostring商户回退单号
return_mchidstring回退商户号
amountinteger回退金额
return_nostring微信回退单号
resultstring回退结果
fail_reasonstring失败原因
finish_timestring完成时间

参阅 官方文档

查询分账回退结果

商户需要核实回退结果,可调用此接口查询回退结果。如果分账回退接口返回状态为处理中,可调用此接口查询回退结果

请求参数类型描述
queryobject声明请求的查询参数
sub_mchidstring子商户号
out_return_nostring商户回退单号
order_idstring微信分帐单号
out_order_nostring商户分账单号
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_mchidstring子商户号
order_idstring微信分账单号
out_order_nostring商户分账单号
out_return_nostring商户回退单号
return_mchidstring回退商户号
return_nostring微信回退单号
amountinteger回退金额
resultstring回退结果
fail_reasonstring失败原因
finish_timestring完成时间

参阅 官方文档

Published on the GitHub by TheNorthMemory