Skip to content

建立合作关系

该接口主要为商户提供营销资源的授权能力,可授权给其他商户或小程序,方便商户间的互利合作。

请求参数类型描述
jsonobject声明请求的JSON数据结构
partnerobject合作方信息
typestring合作方类别
APPID | MERCHANT 枚举值之一
appidstring合作方APPID
merchant_idstring合作方商户ID
authorized_dataobject被授权数据
business_typestring授权业务类别
FAVOR_STOCK | BUSIFAVOR_STOCK 枚举值之一
stock_idstring授权批次ID
headersobject声明请求的头参数
Idempotency-Keystring业务请求幂等值
php
$instance->v3->marketing->partnerships->build->postAsync([
  'json' => [
    'partner'         => [
      'type'        => 'APPID',
      'appid'       => '',
      'merchant_id' => '',
    ],
    'authorized_data' => [
      'business_type' => 'FAVOR_STOCK',
      'stock_id'      => '',
    ],
  ],
  'headers' => [
    'Idempotency-Key' => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/partnerships/build')->postAsync([
  'json' => [
    'partner'         => [
      'type'        => 'APPID',
      'appid'       => '',
      'merchant_id' => '',
    ],
    'authorized_data' => [
      'business_type' => 'FAVOR_STOCK',
      'stock_id'      => '',
    ],
  ],
  'headers' => [
    'Idempotency-Key' => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/partnerships/build']->postAsync([
  'json' => [
    'partner'         => [
      'type'        => 'APPID',
      'appid'       => '',
      'merchant_id' => '',
    ],
    'authorized_data' => [
      'business_type' => 'FAVOR_STOCK',
      'stock_id'      => '',
    ],
  ],
  'headers' => [
    'Idempotency-Key' => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->partnerships->build->post([
  'json' => [
    'partner'         => [
      'type'        => 'APPID',
      'appid'       => '',
      'merchant_id' => '',
    ],
    'authorized_data' => [
      'business_type' => 'FAVOR_STOCK',
      'stock_id'      => '',
    ],
  ],
  'headers' => [
    'Idempotency-Key' => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/partnerships/build')->post([
  'json' => [
    'partner'         => [
      'type'        => 'APPID',
      'appid'       => '',
      'merchant_id' => '',
    ],
    'authorized_data' => [
      'business_type' => 'FAVOR_STOCK',
      'stock_id'      => '',
    ],
  ],
  'headers' => [
    'Idempotency-Key' => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/partnerships/build']->post([
  'json' => [
    'partner'         => [
      'type'        => 'APPID',
      'appid'       => '',
      'merchant_id' => '',
    ],
    'authorized_data' => [
      'business_type' => 'FAVOR_STOCK',
      'stock_id'      => '',
    ],
  ],
  'headers' => [
    'Idempotency-Key' => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
partnerobject合作方信息
typestring合作方类别
APPID | MERCHANT 枚举值之一
appidstring合作方APPID
merchant_idstring合作方商户ID
authorized_dataobject被授权数据
business_typestring授权业务类别
FAVOR_STOCK | BUSIFAVOR_STOCK 枚举值之一
stock_idstring授权批次ID
statestring合作状态
ESTABLISHED | TERMINATED 枚举值之一
build_timestring建立合作关系时间
create_timestring创建时间
update_timestring更新时间

参阅 官方文档

Published on the GitHub by TheNorthMemory