外观
商品详情
GET /products/{productId}
| 权限范围 | 幂等 | operationId |
|---|---|---|
catalog:read | 只读 | Catalog_productDetail |
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
productId | 路径 | string | 是 | 商品 ID(prd_…) |
示例
js
const res = await client.get("/products/prd_109i0QtQIDMt0qCKdVjF8CL");http
GET /open/v1/products/prd_109i0QtQIDMt0qCKdVjF8CL HTTP/1.1
Host: api.sybb.pw
Authorization: SY-HMAC-SHA256 Credential=ak_…, Timestamp=1796035200, Nonce=…, Signature=…响应 200:
json
{
"productId": "prd_109i0QtQIDMt0qCKdVjF8CL",
"categoryId": "cat_1Yrxlo5gHYwz6FCJlUWBjrD",
"name": "周末双排体验券",
"unitPriceCents": 10000,
"durationHours": 1,
"description": "说明文字",
"iconUrl": "https://example.com/icon.png",
"enabled": true,
"standardServiceCount": 1,
"forceAnonymous": false,
"additionalServices": [
{
"serviceId": "as_1yj4IvwV7CZNvkbED2pDqa8",
"name": "周末双排体验券",
"unitPriceCents": 10000,
"chargeMode": "fixed",
"ratioPercent": 20,
"quantityRelation": "follow_order",
"description": "说明文字"
}
]
}响应
ProductView
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
productId | string | 商品 ID(prd_…) | |
categoryId | string | 商品分类 ID(cat_…) | |
name | string | 名称 | |
unitPriceCents | integer | 是 | 金额(分) |
durationHours | number | 单份服务时长(小时) | |
description | string | 说明 | |
iconUrl | string | 图标 URL | |
enabled | boolean | 是 | 是否启用 |
standardServiceCount | integer | 标准服务数量(如时长、局数) | |
forceAnonymous | boolean | 是 | 商品要求必须匿名 |
additionalServices | AdditionalServiceView[] |
AdditionalServiceView
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
serviceId | string | 附加服务 ID(as_…) | |
name | string | 名称 | |
unitPriceCents | integer | 金额(分) | |
chargeMode | string | fixed 按单价 / ratio 按主订单金额比例 | |
ratioPercent | number | 附加服务加价比例(%) | |
quantityRelation | string | follow_order 随订单数量 / one_per_order 一单一个 / custom 下单者自定义 | |
description | string | 说明 |
错误
| HTTP | 错误码 | 含义 |
|---|---|---|
| 404 | NOT_FOUND | 资源不存在或不属于本店 |
签名、权限、限流等通用错误见错误处理。