Skip to content

查询及更新电子小票自定义入口信息

查询自定义入口

该接口为电子小票自定义入口查询接口,商家可以通过该接口查询品牌的自定义入口展示内容。

请求参数类型描述
brand_idstring自定义入口的归属品牌ID。
php
$instance->v3->marketing->shoppingReceipt->customentrances->_brand_id_->getAsync([
  'brand_id' => '1014',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/shopping-receipt/customentrances/{brand_id}')->getAsync([
  'brand_id' => '1014',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/shopping-receipt/customentrances/{brand_id}']->getAsync([
  'brand_id' => '1014',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->shoppingReceipt->customentrances->_brand_id_->get([
  'brand_id' => '1014',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/shopping-receipt/customentrances/{brand_id}')->get([
  'brand_id' => '1014',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/shopping-receipt/customentrances/{brand_id}']->get([
  'brand_id' => '1014',
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
custom_entrance_typestring自定义入口种类
MERCHANT_ACTIVITY | MERCHANT_MINI_PROGRAM 枚举值之一
subtitlestring副标题,辅助描述商家活动或商家小程序信息
goods_thumbnail_urlstring展示商品信息,当自定义入口种类为商家活动时,该字段必填,种类为商家小程序该字段不填
custom_entrance_statestring设置自定义入口的状态,ONLINE-在线对用户展示,OFFLINE-下线对用户不展示 可选取值
start_timestring自定义入口的开始时间
end_timestring自定义入口的结束时间
brand_idstring自定义入口的归属品牌ID
create_timestring自定义入口创建的时间
modify_timestring自定义入口修改的时间
out_request_nostring商户创建自定义入口的凭据号(格式:商户ID+日期+流水号),商家侧需要保持唯一且递增
jump_linkobject自定义入口跳转信息
mini_programs_appidstring自定义入口的跳转小程序AppID
mini_programs_pathstring自定义入口跳转小程序的path

参阅 官方文档

更新自定义入口

该接口为电子小票自定义入口更新接口,商家可以通过该接口为品牌更新自定义入口展示内容。

请求参数类型描述
brand_idstring自定义入口的归属品牌ID。
jsonobject声明请求的JSON数据结构
custom_entrance_typestring自定义入口种类
MERCHANT_ACTIVITY | MERCHANT_MINI_PROGRAM 枚举值之一
subtitlestring副标题,辅助描述商家活动或商家小程序信息
goods_thumbnail_urlstring展示商品信息,当自定义入口种类为商家活动时,该字段必填,种类为商家小程序该字段不填
custom_entrance_statestring设置自定义入口的状态,ONLINE-在线对用户展示,OFFLINE-下线对用户不展示 可选取值
start_timestring自定义入口的开始时间
end_timestring自定义入口的结束时间
out_request_nostring商户创建自定义入口的凭据号(格式:商户ID+日期+流水号),商家侧需要保持唯一且递增
jump_linkobject自定义入口跳转信息
mini_programs_appidstring自定义入口的跳转小程序AppID
mini_programs_pathstring自定义入口跳转小程序的path
php
$instance->v3->marketing->shoppingReceipt->customentrances->_brand_id_->patchAsync([
  'brand_id' => '1014',
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'custom_entrance_state' => 'ONLINE',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2019-12-31T13:29:35.120+08:00',
    'out_request_no'        => '100002322019090134234sfdf',
    'jump_link'             => [
      'mini_programs_appid' => 'wxea9c30a90fs8d3fe',
      'mini_programs_path'  => '/pages/bonus/bonus',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/shopping-receipt/customentrances/{brand_id}')->patchAsync([
  'brand_id' => '1014',
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'custom_entrance_state' => 'ONLINE',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2019-12-31T13:29:35.120+08:00',
    'out_request_no'        => '100002322019090134234sfdf',
    'jump_link'             => [
      'mini_programs_appid' => 'wxea9c30a90fs8d3fe',
      'mini_programs_path'  => '/pages/bonus/bonus',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/shopping-receipt/customentrances/{brand_id}']->patchAsync([
  'brand_id' => '1014',
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'custom_entrance_state' => 'ONLINE',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2019-12-31T13:29:35.120+08:00',
    'out_request_no'        => '100002322019090134234sfdf',
    'jump_link'             => [
      'mini_programs_appid' => 'wxea9c30a90fs8d3fe',
      'mini_programs_path'  => '/pages/bonus/bonus',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->shoppingReceipt->customentrances->_brand_id_->patch([
  'brand_id' => '1014',
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'custom_entrance_state' => 'ONLINE',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2019-12-31T13:29:35.120+08:00',
    'out_request_no'        => '100002322019090134234sfdf',
    'jump_link'             => [
      'mini_programs_appid' => 'wxea9c30a90fs8d3fe',
      'mini_programs_path'  => '/pages/bonus/bonus',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/shopping-receipt/customentrances/{brand_id}')->patch([
  'brand_id' => '1014',
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'custom_entrance_state' => 'ONLINE',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2019-12-31T13:29:35.120+08:00',
    'out_request_no'        => '100002322019090134234sfdf',
    'jump_link'             => [
      'mini_programs_appid' => 'wxea9c30a90fs8d3fe',
      'mini_programs_path'  => '/pages/bonus/bonus',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/shopping-receipt/customentrances/{brand_id}']->patch([
  'brand_id' => '1014',
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'custom_entrance_state' => 'ONLINE',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2019-12-31T13:29:35.120+08:00',
    'out_request_no'        => '100002322019090134234sfdf',
    'jump_link'             => [
      'mini_programs_appid' => 'wxea9c30a90fs8d3fe',
      'mini_programs_path'  => '/pages/bonus/bonus',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
custom_entrance_typestring自定义入口种类
MERCHANT_ACTIVITY | MERCHANT_MINI_PROGRAM 枚举值之一
subtitlestring副标题,辅助描述商家活动或商家小程序信息
goods_thumbnail_urlstring展示商品信息,当自定义入口种类为商家活动时,该字段必填,种类为商家小程序该字段不填
custom_entrance_statestring设置自定义入口的状态,ONLINE-在线对用户展示,OFFLINE-下线对用户不展示 可选取值
start_timestring自定义入口的开始时间
end_timestring自定义入口的结束时间
brand_idstring自定义入口的归属品牌ID
create_timestring自定义入口创建的时间
modify_timestring自定义入口修改的时间
out_request_nostring商户创建自定义入口的凭据号(格式:商户ID+日期+流水号),商家侧需要保持唯一且递增
jump_linkobject自定义入口跳转信息
mini_programs_appidstring自定义入口的跳转小程序AppID
mini_programs_pathstring自定义入口跳转小程序的path

参阅 官方文档

Published on the GitHub by TheNorthMemory