Skip to content

请求分账回退

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

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

参阅 官方文档

Published on the GitHub by TheNorthMemory