添加分账接收方
电商平台可通过此接口添加分账接收方,建立分账接收方列表。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
appid | string | 公众账号ID |
type | string | 接收方类型 |
account | string | 接收方账号 |
name | string | 接收方名称 |
encrypted_name | string | 接收方名称的密文 |
relation_type | string | 与分账方的关系类型 |
headers | object | 声明请求的头参数 |
Wechatpay-Serial | string | 平台公钥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));
返回字典 | 类型 | 描述 |
---|---|---|
type | string | 接收方类型 |
account | string | 接收方账号 |
参阅 官方文档