添加分账接收方
服务商发起添加分账接收方请求,建立分账接收方列表。后续可通过发起分账请求,将分账方商户结算后的资金,分到该分账接收方
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| sub_mchid | string | 子商户号 |
| appid | string | 应用ID |
| sub_appid | string | 子商户应用ID |
| type | string | 分账接收方类型MERCHANT_ID | PERSONAL_OPENID | PERSONAL_SUB_OPENID 枚举值之一 |
| account | string | 分账接收方帐号 |
| name | string | 分账个人接收方姓名 |
| relation_type | string | 与分账方的关系类型SERVICE_PROVIDER | STORE | STAFF | STORE_OWNER | PARTNER | HEADQUARTER | BRAND | DISTRIBUTOR | USER | SUPPLIER | CUSTOM 枚举值之一 |
| custom_relation | string | 自定义的分账关系 |
| headers | object | 声明请求的头参数 |
| Wechatpay-Serial | string | 微信支付公钥ID/平台证书序列号 |
php
$instance->v3->profitsharing->receivers->add->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888889',
'type' => 'MERCHANT_ID',
'account' => '86693852',
'name' => 'hu89ohu89ohu89o',
'relation_type' => 'SERVICE_PROVIDER',
'custom_relation' => '代理商',
],
'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/profitsharing/receivers/add')->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888889',
'type' => 'MERCHANT_ID',
'account' => '86693852',
'name' => 'hu89ohu89ohu89o',
'relation_type' => 'SERVICE_PROVIDER',
'custom_relation' => '代理商',
],
'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/profitsharing/receivers/add']->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888889',
'type' => 'MERCHANT_ID',
'account' => '86693852',
'name' => 'hu89ohu89ohu89o',
'relation_type' => 'SERVICE_PROVIDER',
'custom_relation' => '代理商',
],
'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->profitsharing->receivers->add->post([
'json' => [
'sub_mchid' => '1900000109',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888889',
'type' => 'MERCHANT_ID',
'account' => '86693852',
'name' => 'hu89ohu89ohu89o',
'relation_type' => 'SERVICE_PROVIDER',
'custom_relation' => '代理商',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/profitsharing/receivers/add')->post([
'json' => [
'sub_mchid' => '1900000109',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888889',
'type' => 'MERCHANT_ID',
'account' => '86693852',
'name' => 'hu89ohu89ohu89o',
'relation_type' => 'SERVICE_PROVIDER',
'custom_relation' => '代理商',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/profitsharing/receivers/add']->post([
'json' => [
'sub_mchid' => '1900000109',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888889',
'type' => 'MERCHANT_ID',
'account' => '86693852',
'name' => 'hu89ohu89ohu89o',
'relation_type' => 'SERVICE_PROVIDER',
'custom_relation' => '代理商',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| sub_mchid | string | 子商户号 |
| type | string | 分账接收方类型MERCHANT_ID | PERSONAL_OPENID | PERSONAL_SUB_OPENID 枚举值之一 |
| account | string | 分账接收方账号 |
| name | string | 分账接收方全称 |
| relation_type | string | 与分账方的关系类型SERVICE_PROVIDER | STORE | STAFF | STORE_OWNER | PARTNER | HEADQUARTER | BRAND | DISTRIBUTOR | USER | SUPPLIER | CUSTOM 枚举值之一 |
| custom_relation | string | 自定义的分账关系 |