Skip to content

商品与 SKU

GET /products

分页获取所有已上架商品。

Query 参数

参数类型必填默认说明
pagenumber1页码
page_sizenumber20每页 1~100 条

响应

json
{
  "ok": true,
  "items": [
    {
      "id": 1,
      "slug": "example-product",
      "title": { "zh-CN": "示例商品", "en-US": "Example Product" },
      "description": { "zh-CN": "商品描述" },
      "content": {},
      "seo_meta": {},
      "images": ["https://example.com/image.jpg"],
      "tags": ["hot"],
      "price_amount": "7.90",
      "fulfillment_type": "auto",
      "manual_form_schema": null,
      "is_active": true,
      "category_id": 1,
      "skus": [
        {
          "id": 11,
          "sku_code": "SKU-1",
          "spec_values": { "类型": "标准" },
          "price_amount": "7.90",
          "stock_status": "in_stock",
          "stock_quantity": 100,
          "is_active": true
        }
      ],
      "created_at": "2026-03-01T12:00:00Z",
      "updated_at": "2026-03-01T12:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 20
}

Product 字段

字段类型说明
idnumber商品 ID
slugstring商品 URL 标识
titleobject多语言标题
descriptionobject多语言描述
contentobject多语言详情内容
seo_metaobjectSEO 元信息
imagesstring[]图片列表
tagsstring[]标签
price_amountstring实际售价
original_pricestring原价,有折扣时返回
member_pricestring会员价,有会员折扣时返回
fulfillment_typestringautomanual
manual_form_schemaobject人工交付表单结构
category_idnumber分类 ID
skusarraySKU 列表

SKU 字段

字段类型说明
idnumber创建订单时使用的 sku_id
sku_codestring稳定的业务映射编码
spec_valuesobject规格键值
price_amountstringSKU 实际售价
original_pricestring原价
member_pricestring会员价
stock_statusstring库存状态
stock_quantitynumber-1 表示无限库存
is_activeboolean是否启用

sku_codesku_id

本地配置建议保存 sku_code,同步商品时解析成当前 sku_id。调用 POST /orders 时必须提交数字 sku_id,不能直接提交 sku_code

库存状态

状态说明
unlimited无限库存,stock_quantity = -1
in_stock库存充足
low_stock低库存
out_of_stock已售罄

GET /products/:id

按商品 ID 获取单个商品,成功时返回:

json
{
  "ok": true,
  "product": {}
}
错误码HTTP说明
product_not_found404商品不存在
product_unavailable404商品已下架

分页同步建议

  1. 使用 page_size=100
  2. 逐页请求,直到累计数量达到 total
  3. sku_code 作为外部映射键,同时更新 sku_id、价格与库存。
  4. 不要只请求第一页。

完整分页实现已经包含在 Python 客户端Go 客户端中。

CheapEmail Open API Documentation