获取商品信息
2024年11月10日大约 2 分钟
open.goods.list.get
全渠道批量获取自建商城的商品数据。
如何触发接口
请求参数
| 参数 | 类型 | 说明 |
|---|---|---|
| offset | long | 偏移量/不是页码 (size=20,offset=80 即是取81-100的记录) |
| size | long | 每页条数 |
请求示例
{
"offset": 0,
"size": 50
}响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| code | string | 响应代码 |
| message | string | 响应消息 |
| data | object | 响应数据 |
data 数据结构
| 参数名 | 类型 | 说明 |
|---|---|---|
| total | int | 列表总数 |
| items | object[] | 数据列表 |
items 数据结构
| 参数名 | 类型 | 说明 |
|---|---|---|
| outerID | string | 商品商家编码 |
| goodsID | string | 商品ID |
| goodsName | string | 商品名称 |
| goodsCode | string | 商品编号 |
| imageUrl | string | 商品对应的图片 |
| isonsale | int | 在售状态标识:1=在售,0=下架 |
| quantity | int | 商品库存数量 |
| skus | object[] | 商品的SKU详情列表 |
skus 数据结构:
| 参数名 | 类型 | 说明 |
|---|---|---|
| outerID | string | 规格商家编码 |
| skuID | string | 规格ID |
| skuName | string | 规格名称 |
| skuCode | string | 规格编号 |
| barcode | string | 条码 |
| imageUrl | string | sku对应的图片 |
| quantity | int | sku库存数量 |
自动关联商品
skus有数据时,取skus中的outerID(规格商家编码)与全渠道的商品商家编码进行自动关联匹配。
skus无数据时,取items中的outerID(商品商家编码)与全渠道的商品商家编码进行自动关联匹配。
响应示例
{
"code": "success",
"message": "成功",
"data": {
"total": 1,
"items": [
{
"goodsID": "G123456",
"goodsName": "无线蓝牙耳机",
"goodsCode": "BT-001",
"imageUrl": "http://example.com/images/bt-headphones.jpg",
"isonsale": 1,
"quantity": 50,
"outerID": "E123456",
"skus": [
{
"outerID": "E123456-SKU01",
"quantity": 25,
"skuID": "SKU12345",
"skuName": "黑色",
"skuCode": "SKUCODE-BLACK",
"barcode": "BARCODE123456789",
"imageUrl": "http://example.com/images/bt-headphones-black.jpg"
}
]
}
]
}
}