查询已上架且有可售规格的商品
GET/api/v1/products
| 认证 | 不需要登录 |
|---|---|
| 权限 | 无 |
查询参数
application/json
查询参数都可省略,价格是整数分
qstring按标题搜索
limitinteger每页数量
cursorstring上一页返回的 next_cursor
catalog_idstring目录 ID,字段过滤时必须同时带上
min_priceinteger最低价,整数分
max_priceinteger最高价,整数分
field.{key}.{op}string自定义字段过滤,op 只能是列出的比较符
可选值: gtlteqgtelte
查询示例
q=%E7%9F%AD%E9%9D%B4&limit=1&cursor=string&catalog_id=cat_example&min_price=159900&max_price=159900&field.weight_g.gt=string响应
200
application/json
列表在 data.items,下一页游标在 data.next_cursor
itemsobject[]必填已上架商品
items[].idstring必填商品 ID,以 prd_ 开头
items[].catalog_idstring必填目录 ID
items[].titlestring必填商品名称
items[].coverstring | null必填封面地址,没有时为 null
items[].currencystring必填货币代码
items[].offer.priceinteger必填展示价,整数分
items[].offer.currencystring必填展示价货币
items[].offer.availabilityenum<string>必填商品可售状态
可选值: in_stockout_of_stock
items[].fieldsobject必填公开字段,键是字段 key
items[].variantsobject[]必填可售规格
items[].variants[].idstring必填规格 ID,下单时作为 variant_id
items[].variants[].priceinteger必填整数分
items[].variants[].currencystring必填货币代码
items[].variants[].stockinteger | null必填库存,null 表示不限
items[].variants[].availabilityenum<string>必填可售状态
可选值: in_stockout_of_stock
items[].variants[].option_valuesobject必填规格轴取值,键是轴 key
items[].variants[].skustring | null必填SKU,没有时为 null
next_cursorstring | null必填没有下一页时为 null
响应示例
{
"items": [
{
"id": "prd_example",
"catalog_id": "cat_example",
"title": "示例",
"cover": "string",
"currency": "CNY",
"offer": {
"price": 159900,
"currency": "CNY",
"availability": "in_stock"
},
"fields": {},
"variants": [
{
"id": "var_example",
"price": 159900,
"currency": "CNY",
"stock": null,
"availability": "in_stock",
"option_values": {},
"sku": "string"
}
]
}
],
"next_cursor": "string"
}