Skip to content

商品列表 ​

GET /products

权限范围幂等operationId
catalog:read只读Catalog_products

categoryId 可选;默认只返回上架商品,status=all 返回全部。

参数 ​

名称位置类型必填说明
categoryId查询string只看这个分类下的
status查询stringenabled 只看上架的(默认)/ all 全部(默认 enabled)

示例 ​

js
const res = await client.get("/products");
http
GET /open/v1/products HTTP/1.1
Host: api.sybb.pw
Authorization: SY-HMAC-SHA256 Credential=ak_…, Timestamp=1796035200, Nonce=…, Signature=…

响应 200:

json
{
  "items": [
    {
      "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 ​

字段类型必填说明
productIdstring商品 ID(prd_…)
categoryIdstring商品分类 ID(cat_…)
namestring名称
unitPriceCentsinteger是金额(分)
durationHoursnumber单份服务时长(小时)
descriptionstring说明
iconUrlstring图标 URL
enabledboolean是是否启用
standardServiceCountinteger标准服务数量(如时长、局数)
forceAnonymousboolean是商品要求必须匿名
additionalServicesAdditionalServiceView[]

AdditionalServiceView ​

字段类型必填说明
serviceIdstring附加服务 ID(as_…)
namestring名称
unitPriceCentsinteger金额(分)
chargeModestringfixed 按单价 / ratio 按主订单金额比例
ratioPercentnumber附加服务加价比例(%)
quantityRelationstringfollow_order 随订单数量 / one_per_order 一单一个 / custom 下单者自定义
descriptionstring说明

错误 ​

签名、权限、限流等通用错误见错误处理。

ByteForge · 神运开放平台接口地址 https://api.sybb.pw/open/v1