Skip to content

添加分账接收方

电商平台可通过此接口添加分账接收方,建立分账接收方列表。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstring公众账号ID
typestring接收方类型
accountstring接收方账号
namestring接收方名称
encrypted_namestring接收方名称的密文
relation_typestring与分账方的关系类型
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->ecommerce->profitsharing->receivers->add->postAsync([
  'json' => [
    'appid' => 'wx8888888888888888',
    'type' => 'MERCHANT_ID',
    'account' => '190001001',
    'name' => '张三网络公司',
    'encrypted_name' => 'hu89ohu89ohu89o',
    'relation_type' => 'SUPPLIER',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ecommerce/profitsharing/receivers/add')->postAsync([
  'json' => [
    'appid' => 'wx8888888888888888',
    'type' => 'MERCHANT_ID',
    'account' => '190001001',
    'name' => '张三网络公司',
    'encrypted_name' => 'hu89ohu89ohu89o',
    'relation_type' => 'SUPPLIER',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ecommerce/profitsharing/receivers/add']->postAsync([
  'json' => [
    'appid' => 'wx8888888888888888',
    'type' => 'MERCHANT_ID',
    'account' => '190001001',
    'name' => '张三网络公司',
    'encrypted_name' => 'hu89ohu89ohu89o',
    'relation_type' => 'SUPPLIER',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ecommerce->profitsharing->receivers->add->post([
  'json' => [
    'appid' => 'wx8888888888888888',
    'type' => 'MERCHANT_ID',
    'account' => '190001001',
    'name' => '张三网络公司',
    'encrypted_name' => 'hu89ohu89ohu89o',
    'relation_type' => 'SUPPLIER',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ecommerce/profitsharing/receivers/add')->post([
  'json' => [
    'appid' => 'wx8888888888888888',
    'type' => 'MERCHANT_ID',
    'account' => '190001001',
    'name' => '张三网络公司',
    'encrypted_name' => 'hu89ohu89ohu89o',
    'relation_type' => 'SUPPLIER',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ecommerce/profitsharing/receivers/add']->post([
  'json' => [
    'appid' => 'wx8888888888888888',
    'type' => 'MERCHANT_ID',
    'account' => '190001001',
    'name' => '张三网络公司',
    'encrypted_name' => 'hu89ohu89ohu89o',
    'relation_type' => 'SUPPLIER',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
typestring接收方类型
accountstring接收方账号

参阅 官方文档

Published on the GitHub by TheNorthMemory