Skip to content

请求补差

服务商下单的时候带上补差标识,微信订单支付成功并结算完成后,发起分账前,调用该口进行补差。

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

参阅 官方文档

Published on the GitHub by TheNorthMemory