Skip to content

请求补差回退

订单发送退款的时候,可以对补贴成功的补差单发起回退。

请求参数类型描述
jsonobject声明请求的JSON数据结构
sub_mchidstring二级商户号
out_order_nostring商户补差回退单号
transaction_idstring微信订单号
refund_idstring微信退款单号
amountinteger补差回退金额
descriptionstring补差回退描述
php
$instance->v3->ecommerce->subsidies->return->postAsync([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_order_no'   => 'P20150806125346',
    'transaction_id' => '4208450740201411110007820472',
    'refund_id'      => '3008450740201411110007820472',
    'amount'         => 10,
    'description'    => '测试备注',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ecommerce/subsidies/return')->postAsync([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_order_no'   => 'P20150806125346',
    'transaction_id' => '4208450740201411110007820472',
    'refund_id'      => '3008450740201411110007820472',
    'amount'         => 10,
    'description'    => '测试备注',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ecommerce/subsidies/return']->postAsync([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_order_no'   => 'P20150806125346',
    'transaction_id' => '4208450740201411110007820472',
    'refund_id'      => '3008450740201411110007820472',
    'amount'         => 10,
    'description'    => '测试备注',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ecommerce->subsidies->return->post([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_order_no'   => 'P20150806125346',
    'transaction_id' => '4208450740201411110007820472',
    'refund_id'      => '3008450740201411110007820472',
    'amount'         => 10,
    'description'    => '测试备注',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ecommerce/subsidies/return')->post([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_order_no'   => 'P20150806125346',
    'transaction_id' => '4208450740201411110007820472',
    'refund_id'      => '3008450740201411110007820472',
    'amount'         => 10,
    'description'    => '测试备注',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ecommerce/subsidies/return']->post([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_order_no'   => 'P20150806125346',
    'transaction_id' => '4208450740201411110007820472',
    'refund_id'      => '3008450740201411110007820472',
    'amount'         => 10,
    'description'    => '测试备注',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sub_mchidstring二级商户号
transaction_idstring微信订单号
subsidy_refund_idstring微信补差回退单号
refund_idstring微信退款单号
out_order_nostring商户补差回退单号
amountinteger补差回退金额
descriptionstring补差回退描述
resultstring补差回退结果
success_timestring补差回退完成时间

参阅 官方文档

Published on the GitHub by TheNorthMemory