Skip to content

条件查询批次列表

通过此接口可查询多个批次的信息,包括批次的配置信息以及批次概况数据。

请求参数类型描述
queryobject声明请求的查询参数
offsetinteger分页页码
limitinteger分页大小
stock_creator_mchidstring创建批次的商户号
create_start_timestring起始时间
create_end_timestring终止时间
statusstring批次状态
unactivated | audit | running | stoped | paused 枚举值之一
php
$instance->v3->marketing->favor->stocks->getAsync([
  'query' => [
    'offset'              => 0,
    'limit'               => 0,
    'stock_creator_mchid' => '',
    'create_start_time'   => '2015-05-20T13:29:35.120+08:00',
    'create_end_time'     => '2015-05-20T13:29:35.120+08:00',
    'status'              => 'unactivated',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/favor/stocks')->getAsync([
  'query' => [
    'offset'              => 0,
    'limit'               => 0,
    'stock_creator_mchid' => '',
    'create_start_time'   => '2015-05-20T13:29:35.120+08:00',
    'create_end_time'     => '2015-05-20T13:29:35.120+08:00',
    'status'              => 'unactivated',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/favor/stocks']->getAsync([
  'query' => [
    'offset'              => 0,
    'limit'               => 0,
    'stock_creator_mchid' => '',
    'create_start_time'   => '2015-05-20T13:29:35.120+08:00',
    'create_end_time'     => '2015-05-20T13:29:35.120+08:00',
    'status'              => 'unactivated',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->favor->stocks->get([
  'query' => [
    'offset'              => 0,
    'limit'               => 0,
    'stock_creator_mchid' => '',
    'create_start_time'   => '2015-05-20T13:29:35.120+08:00',
    'create_end_time'     => '2015-05-20T13:29:35.120+08:00',
    'status'              => 'unactivated',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/favor/stocks')->get([
  'query' => [
    'offset'              => 0,
    'limit'               => 0,
    'stock_creator_mchid' => '',
    'create_start_time'   => '2015-05-20T13:29:35.120+08:00',
    'create_end_time'     => '2015-05-20T13:29:35.120+08:00',
    'status'              => 'unactivated',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/favor/stocks']->get([
  'query' => [
    'offset'              => 0,
    'limit'               => 0,
    'stock_creator_mchid' => '',
    'create_start_time'   => '2015-05-20T13:29:35.120+08:00',
    'create_end_time'     => '2015-05-20T13:29:35.120+08:00',
    'status'              => 'unactivated',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
total_countinteger批次总数
limitinteger分页大小
offsetinteger分页页码
dataobject[]批次详情
stock_namestring批次名称
available_begin_timestring开始时间
available_end_timestring结束时间
stock_use_ruleobject发放规则
max_couponsinteger发放总上限
max_amountinteger总预算
max_amount_by_dayinteger单天发放上限金额
max_coupons_per_userinteger单个用户可领个数
natural_person_limitboolean是否开启自然人限制
prevent_api_abusebooleanapi发券防刷
no_cashboolean是否无资金流
stock_typestring批次类型
NORMAL | DISCOUNT | EXCHAHGE | RANDOM | DISCOUNT_CUT 枚举值之一
stock_idstring批次号
stock_creator_mchidstring创建批次的商户号
statusstring批次状态
unactivated | audit | running | stoped | paused 枚举值之一
descriptionstring使用说明
create_timestring创建时间
start_timestring激活批次的时间
stop_timestring终止批次的时间
singleitemboolean是否单品优惠
cut_to_messageobject减至批次特定信息
single_price_maxinteger可用优惠的商品最高单价
cut_to_priceinteger减至后的优惠单价
distributed_couponsinteger已发券数量
business_typestring业务类型
MULTIUSE 枚举值
available_region_listobject[]消费金可用地域
typestring类型
provincestring
citystring
districtstring
countrystring国家
available_industry_liststring[]消费金可用行业

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory