查询代金券可用单品
通过此接口可查询批次的可用商品编码,判断券是否可用于某些商品,来决定是否展示。
请求参数 | 类型 | 描述 |
---|---|---|
stock_id | string | 批次号 |
query | object | 声明请求的查询参数 |
stock_creator_mchid | string | 创建批次的商户号 |
offset | integer | 分页页码 |
limit | string | 分页大小 |
php
$instance->v3->marketing->favor->stocks->_stock_id_->items->getAsync([
'stock_id' => '',
'query' => [
'stock_creator_mchid' => '',
'offset' => 0,
'limit' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/favor/stocks/{stock_id}/items')->getAsync([
'stock_id' => '',
'query' => [
'stock_creator_mchid' => '',
'offset' => 0,
'limit' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/favor/stocks/{stock_id}/items']->getAsync([
'stock_id' => '',
'query' => [
'stock_creator_mchid' => '',
'offset' => 0,
'limit' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->favor->stocks->_stock_id_->items->get([
'stock_id' => '',
'query' => [
'stock_creator_mchid' => '',
'offset' => 0,
'limit' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/favor/stocks/{stock_id}/items')->get([
'stock_id' => '',
'query' => [
'stock_creator_mchid' => '',
'offset' => 0,
'limit' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/favor/stocks/{stock_id}/items']->get([
'stock_id' => '',
'query' => [
'stock_creator_mchid' => '',
'offset' => 0,
'limit' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
total_count | integer | 可用单品编码总数 |
data | string[] | 可用单品编码 |
offset | integer | 分页页码 |
limit | integer | 分页大小 |
stock_id | string | 批次号 |
参阅 官方文档