Skip to content

添加分账接收方

商户发起添加分账接收方请求,建立分账接收方列表。后续可通过发起分账请求,将分账方商户结算后的资金,分给该分账接收方。

请求参数类型描述
base_uristring声明接入点https://apihk.mch.weixin.qq.com/(香港接入)
jsonobject声明请求的JSON数据结构
sub_mchidstring子商户号
appidstring应用ID
sub_appidstring子商户应用ID
typestring分账接收方类型
accountstring分账接收方帐号
namestring分账个人接收方姓名
authorizedboolean是否已经获取用户实名信息授权
relation_typestring与分账方的关系类型
custom_relationstring自定义的分账关系
scenestring分账场景详细描述
major_servicestring接收方商户的主营业务范围
expected_ratiointeger分账接收方预计分账比例
application_file_idstring增加分账接收方申请函文件ID
partnership_file_idstring分账方与接收方合作关系证明文件ID
php
$instance->v3->global->profitSharing->receivers->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
    'name' => 'hu89ohu89ohu89o',
    'authorized' => true,
    'relation_type' => 'SERVICE_PROVIDER',
    'custom_relation' => '代理商',
    'scene' => '该分账接收方是境内税费服务提供方,帮助商户向境内海关代扣代缴税费。',
    'major_service' => '税务准备服务',
    'expected_ratio' => 2000,
    'application_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
    'partnership_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/global/profit-sharing/receivers')->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
    'name' => 'hu89ohu89ohu89o',
    'authorized' => true,
    'relation_type' => 'SERVICE_PROVIDER',
    'custom_relation' => '代理商',
    'scene' => '该分账接收方是境内税费服务提供方,帮助商户向境内海关代扣代缴税费。',
    'major_service' => '税务准备服务',
    'expected_ratio' => 2000,
    'application_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
    'partnership_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/global/profit-sharing/receivers']->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
    'name' => 'hu89ohu89ohu89o',
    'authorized' => true,
    'relation_type' => 'SERVICE_PROVIDER',
    'custom_relation' => '代理商',
    'scene' => '该分账接收方是境内税费服务提供方,帮助商户向境内海关代扣代缴税费。',
    'major_service' => '税务准备服务',
    'expected_ratio' => 2000,
    'application_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
    'partnership_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->global->profitSharing->receivers->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
    'name' => 'hu89ohu89ohu89o',
    'authorized' => true,
    'relation_type' => 'SERVICE_PROVIDER',
    'custom_relation' => '代理商',
    'scene' => '该分账接收方是境内税费服务提供方,帮助商户向境内海关代扣代缴税费。',
    'major_service' => '税务准备服务',
    'expected_ratio' => 2000,
    'application_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
    'partnership_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/global/profit-sharing/receivers')->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
    'name' => 'hu89ohu89ohu89o',
    'authorized' => true,
    'relation_type' => 'SERVICE_PROVIDER',
    'custom_relation' => '代理商',
    'scene' => '该分账接收方是境内税费服务提供方,帮助商户向境内海关代扣代缴税费。',
    'major_service' => '税务准备服务',
    'expected_ratio' => 2000,
    'application_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
    'partnership_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/global/profit-sharing/receivers']->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
    'name' => 'hu89ohu89ohu89o',
    'authorized' => true,
    'relation_type' => 'SERVICE_PROVIDER',
    'custom_relation' => '代理商',
    'scene' => '该分账接收方是境内税费服务提供方,帮助商户向境内海关代扣代缴税费。',
    'major_service' => '税务准备服务',
    'expected_ratio' => 2000,
    'application_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
    'partnership_file_id' => 'de851a06-5a38-9d31-a102-275a17c477de',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sub_mchidstring子商户号
typestring分账接收方类型
accountstring分账接收方账号
namestring分账接收方全称
relation_typestring与分账方的关系类型
custom_relationstring自定义的分账关系
scenestring分账场景详细描述
major_servicestring接收方商户的主营业务范围
expected_ratiointeger分账接收方预计分账比例
file_idstring微信文件标识ID
statestring接收方关系状态
fail_reasonstring接收关系添加失败原因
application_file_idstring增加分账接收方申请函文件ID
partnership_file_idstring分账方与接收方合作关系证明文件ID

参阅 官方文档

删除分账接收方

商户发起删除分账接收方请求。删除后,不支持将分账方商户结算后的资金再分给该分账接收方。

请求参数类型描述
base_uristring声明接入点https://apihk.mch.weixin.qq.com/(香港接入)
jsonobject声明请求的JSON数据结构
sub_mchidstring子商户号
appidstring应用ID
sub_appidstring子商户应用ID
typestring分账接收方类型
accountstring分账接收方帐号
php
$instance->v3->global->profitSharing->receivers->deleteAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/global/profit-sharing/receivers')->deleteAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/global/profit-sharing/receivers']->deleteAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->global->profitSharing->receivers->delete([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/global/profit-sharing/receivers')->delete([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/global/profit-sharing/receivers']->delete([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'sub_mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888889',
    'type' => 'MERCHANT_ID',
    'account' => '86693852',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory