GET
/api/v1/storefront/products?page=1&page_size=10权限:公开读取
只显示已上架商品。价格保留字符串精度。policy 包含商品种类、交付格式、数量限制与售后说明,不包含库存内容。
| 参数 | 类型 / 必填 | 说明 |
|---|---|---|
page | 整数 · 可选 | 页码,默认 1 |
page_size | 整数 · 可选 | 5 / 10 / 20 / 30 / 40 / 50 / 100,默认 10 |
q | 字符串 · 可选 | 商品名称或 SKU,最多 160 字符 |
product_id | UUID · 可选 | 指定商品 |
请求示例
查询参数:
{
"page": 1,
"page_size": 10
}响应示例
HTTP 200
Content-Type: application/json
{
"data": {
"items": [
{
"id": "00000000-0000-4000-8000-000000000001",
"sku": "DEMO",
"title": "示例数字商品",
"description": "示例说明",
"asset": "USDT",
"price": "10",
"available": 3,
"policy": {
"schema_version": 1,
"kind": "generic",
"category": "",
"platform": "",
"region": "",
"inventory_format": null,
"min_quantity": 1,
"max_quantity": 100,
"after_sales": "",
"after_sales_policy": {
"replacement_enabled": false,
"refund_after_reveal": false,
"window_hours": 168
}
}
}
],
"total": 1,
"page": 1,
"page_size": 10
},
"meta": {
"request_id": "example-request-id"
}
}通用响应与错误
成功响应包含 data 和 meta.request_id。金额字段均为十进制字符串。受保护商城接口使用 IAM OIDC 令牌、huhuapi.api scope 和对应业务授权。
401:登录无效;403:权限不足;409:版本或幂等请求冲突;422:参数或游标无效;429:请求限额;503:功能未开启。
{
"error": {
"code": "COMMERCE_DISABLED",
"message": "This commerce feature is not enabled",
"request_id": "example-request-id"
}
}