优惠券-营销统计列表
接口信息
- 接口地址:
{your-site-url}/api/skill/coupon/get-all-coupon-statistics
- 基础 URL:
{your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
- 请求方式:
GET
- 说明: 此接口用于获取所有优惠券的统计数据列表。每个子项为单个优惠券的统计数据信息,包含统计指标和关联的优惠券基本信息。支持时间范围筛选和分页。
认证
请求头中需要携带 skill-access-token:
| Header |
值 |
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数 (Query String)
| 字段 |
类型 |
必填 |
说明 |
created_at_begin |
string |
否 |
统计时间区间 - 开始时间,格式 YYYY-MM-DD。用于筛选订单召回时间和优惠券使用时间 |
created_at_end |
string |
否 |
统计时间区间 - 结束时间,格式 YYYY-MM-DD。用于筛选订单召回时间和优惠券使用时间 |
pageNum |
int |
否 |
页码,默认 1 |
pageSize |
int |
否 |
每页条数,默认 20 |
请求示例
cURL
curl --location --request GET '{your-site-url}/api/skill/coupon/get-all-coupon-statistics?created_at_begin=2026-05-05&created_at_end=2026-06-04&pageNum=1&pageSize=20' \
--header 'skill-access-token: {your-skill-access-token}'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
成功响应
{
"code": 200,
"data": {
"list": [
{
"id": 18,
"shop_id": 15,
"coupon_id": 69,
"tem_use_count": 0,
"used_count": 2,
"base_discount_amount": "20.00",
"base_order_amount": "2728.25",
"order_product_count": 6,
"average_unit_amount": "1364.13",
"average_product_count": "3.00",
"created_at": "2026-06-04 10:03:18",
"updated_at": "2026-06-04 10:10:13",
"coupon": {
"id": 69,
"code": "LX4ABQ14",
"minimum_requirements_type": 2,
"prerequisite_subtotal": "50.00",
"prerequisite_quantity": 0,
"value_type": 1,
"value": "10.00",
"title": "terry coupon"
}
}
],
"total": 1,
"pageSize": 20,
"totalPage": 1
},
"message": "success"
}
返回字段说明
| 字段 |
类型 |
说明 |
code |
Number |
状态码,200 表示成功 |
message |
String |
执行结果的文字描述 |
data.list |
Array[Object] |
优惠券统计数据列表 |
data.total |
int |
优惠券总数 |
data.pageSize |
int |
每页条数 |
data.totalPage |
int |
总页数 |
list 子项 - 统计字段
| 字段 |
类型 |
说明 |
id |
int |
统计记录 ID |
shop_id |
int |
店铺 ID |
coupon_id |
int |
优惠券 ID |
tem_use_count |
int |
已占用的个数。订单已使用该优惠券但尚未完成支付(未召回订单) |
used_count |
int |
已使用的个数。订单已完成支付(已召回订单) |
base_discount_amount |
string |
优惠总金额(基础货币)。已召回订单的优惠金额总和 |
base_order_amount |
string |
订单总金额(基础货币)。已召回订单的订单总额 |
order_product_count |
int |
订单商品总件数。已召回订单的商品件数总和 |
average_unit_amount |
string |
平均客单价。已使用此优惠券的累计订单总额 ÷ 订单总数 |
average_product_count |
string |
平均客单件。已使用此优惠券的累计商品数量 ÷ 订单总数 |
created_at |
string |
统计记录创建时间 |
updated_at |
string |
统计记录最后更新时间 |
list 子项 - coupon 关联的优惠券基本信息
| 字段 |
类型 |
说明 |
coupon.id |
int |
优惠券 ID |
coupon.code |
string |
优惠券码 |
coupon.title |
string |
优惠券标题 |
coupon.value_type |
int |
折扣类型。1 = 固定金额,2 = 百分比 |
coupon.value |
string |
折扣值 |
coupon.minimum_requirements_type |
int |
使用该优惠券的最低要求类型。1 = 无限制,2 = 最低金额,3 = 最低数量 |
coupon.prerequisite_subtotal |
string |
最低购买金额。当 minimum_requirements_type = 2 时有效 |
coupon.prerequisite_quantity |
int |
最低购买数量。当 minimum_requirements_type = 3 时有效 |
注意事项
- 该接口按优惠券维度返回每条优惠券的统计数据,与 优惠券-全部优惠券-汇总统计 (返回汇总值)不同
created_at_begin / created_at_end 的时间范围作用于订单召回时间和优惠券使用时间两个维度
coupon 对象为优惠券的基本信息,便于展示时关联优惠券标题、码等
- 各类金额均为基础货币