Skip to content

创建自定义入口

接口介绍:该接口为电子小票自定义入口创建接口,商家可以通过该接口为品牌创建自定义入口展示内容。

请求参数类型描述
jsonobject声明请求的JSON数据结构
custom_entrance_typestring自定义入口种类
MERCHANT_ACTIVITY | MERCHANT_MINI_PROGRAM 枚举值之一
subtitlestring副标题,辅助描述商家活动或商家小程序信息
goods_thumbnail_urlstring展示商品信息,当自定义入口种类为商家活动时,该字段必填,种类为商家小程序该字段不填
start_timestring自定义入口的开始时间
end_timestring自定义入口的结束时间
custom_entrance_statestring设置自定义入口的状态,ONLINE-在线对用户展示,OFFLINE-下线对用户不展示 可选取值
brand_idstring自定义入口的归属品牌ID
out_request_nostring商户创建自定义入口的凭据号(格式:商户ID+日期+流水号),商家侧需要保持唯一且递增
jump_linkobject自定义入口跳转信息
mini_programs_appidstring自定义入口的跳转小程序AppID
mini_programs_pathstring自定义入口跳转小程序的path
php
$instance->v3->marketing->shoppingReceipt->customentrances->postAsync([
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2015-05-20T13:29:35+08:00',
    'custom_entrance_state' => 'ONLINE',
    'brand_id'              => '1014',
    'out_request_no'        => '6122352020010133287985742',
    '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')->postAsync([
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2015-05-20T13:29:35+08:00',
    'custom_entrance_state' => 'ONLINE',
    'brand_id'              => '1014',
    'out_request_no'        => '6122352020010133287985742',
    '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']->postAsync([
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2015-05-20T13:29:35+08:00',
    'custom_entrance_state' => 'ONLINE',
    'brand_id'              => '1014',
    'out_request_no'        => '6122352020010133287985742',
    '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->post([
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2015-05-20T13:29:35+08:00',
    'custom_entrance_state' => 'ONLINE',
    'brand_id'              => '1014',
    'out_request_no'        => '6122352020010133287985742',
    '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')->post([
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2015-05-20T13:29:35+08:00',
    'custom_entrance_state' => 'ONLINE',
    'brand_id'              => '1014',
    'out_request_no'        => '6122352020010133287985742',
    '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']->post([
  'json' => [
    'custom_entrance_type'  => 'MERCHANT_ACTIVITY',
    'subtitle'              => '双十一8折活动',
    'goods_thumbnail_url'   => 'https://qpic.cn/xxx',
    'start_time'            => '2015-05-20T13:29:35+08:00',
    'end_time'              => '2015-05-20T13:29:35+08:00',
    'custom_entrance_state' => 'ONLINE',
    'brand_id'              => '1014',
    'out_request_no'        => '6122352020010133287985742',
    '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