---
title: "flashSaleCampaignByProduct"
description: "根据商品查询限时活动"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/queries/flash-sale-campaign-by-product'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/queries/flash-sale-campaign-by-product.md'
---
# flashSaleCampaignByProduct

根据商品查询限时活动

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`FlashSaleCampaign`

## Arguments

* `flashSaleProduct`

  [FlashSaleProductInput!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/products/inputs/flash-sale-product-input.md)

  需要查询限时促销活动的商品

* `buyerId`

  [ID](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/id.md)

  传入时会校验用户维度当前可用活动库存，若无可用活动则不返回活动信息

## Returns

* `combinesWithDiscounts`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/boolean.md)

  活动优惠后是否可以叠加折扣码和自动折扣活动

* `displaySettings`

  [FlashSaleDisplaySettings](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/flash-sale-display-settings.md)

  活动展示设置

* `endsAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  活动结束时间

* `flashSaleInfoByVariant`

  [[FlashSaleItem]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/flash-sale-item.md)

  商品款式的活动信息

* `id`

  [ID](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/id.md)

  限时活动唯一id

* `productInventory`

  [Int](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/int.md)

  活动商品的总共可售数量

* `purchaseLimitConfiguration`

  [PurchaseLimitConfiguration](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/purchase-limit-configuration.md)

  客户购买数量限制设置

* `seoHandleUrl`

  [String](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  用于在网店查看活动商品信息的活动落地页链接。当活动未创建落地页时，返回null。

* `soldQuantity`

  [Int](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/int.md)

  活动商品的总共已售卖数量

* `startsAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  活动开始时间

* `title`

  [String](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  限时活动标题

## Code Example

```graphql
 {
	flashSaleCampaignByProduct(flashSaleProduct, buyerId ) 
		 {
			# FlashSaleCampaign fields
		}
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes)。

