开放Api-产品-详情
Api描述:获取产品详细信息
URL: /manager/api/apps/openapi/product/info
格式:json
方式:get
数据请求部分
1.Request Header 参数:
参数名称 | 是否必须 | 类型 | 描述 |
---|---|---|---|
open-access-token | 必须 | String | 在开放api插件中,创建权限后即可获取该token |
2.Request JSON Data(Body):
参数名称 | 是否必须 | 类型 | 描述 |
---|---|---|---|
id | 必填 | String | 产品id |
譬如,url中加入参数:
?id=657
数据返回部分
1.Response JSON Data(Body):
格式:json
参数名称 | 是否必须 | 类型 | 描述 |
---|---|---|---|
code | 必须 | Number | 200 代表成功 |
data > id | 必须 | int | 产品id |
data > title | 必须 | string | 产品标题 |
data > sub_title | 选填 | string | 产品副标题 |
data > body_html | 必须 | string | 产品描述 |
data > meta_title | 选填 | string | 【seo标题】 meta title |
data > meta_keywords | 选填 | string | 【seo关键字】 meta keywords |
data > meta_description | 选填 | string | 【seo描述】 meta description |
data > handle | 选填 | string | 【seo链接】 产品url path, 如果不填写,则使用title字符串生成 |
data > status | 选填 | string | 产品状态,1代表上架,2代表下架 ,默认为上架 |
data > type | 必填 | string | 产品规格类型,1为单规格,2为多规格(规格指的是颜色,尺码等) |
data > virtual_sales_count | 选填 | int | 产品虚拟销量 |
data > qty | 选填 | int | 库存 |
data > vendor | 选填 | string | 产品厂家名称(品牌名称) |
data > variant_need_image | 选填 | int | 产品规格是否需要图片, 1代表需要,2代表不需要 默认为1需要 |
data > variant_need_note | 选填 | int | 变体是否需要备注,1代表需要备注,2代表不需要备注 |
data > inventory_police | 选填 | int | 是否跟踪库存,1为跟踪,2为不跟踪,默认为1跟踪库存 |
data > inventory_police_type | 选填 | int | 1为库存为0,允许购买,2为库存为0不允许购买,3为库存为0,则产品直接下架。(默认为1允许购买) |
data > created_at | 选填 | string | 创建事件 |
data > updated_at | 选填 | string | 更新事件 |
data > variants | 必须 | array | 产品变体(规格) ,当为单规格产品,将属性填写到该部分下面即可(数组只有一个子项) |
data > variants > id | 必须 | int | 产品变体-id |
data > variants > product_id | 必须 | int | 产品-id |
data > variants > title | 必须 | string | 规格名称 |
data > variants > cost_price | 选填 | float | 产品变体-成本价格 |
data > variants > price | 必填 | float | 产品变体-售卖价格 |
data > variants > compare_at_price | 选填 | float | 产品变体-划线价格 |
data > variants > sku | 必须/选填 | string | 产品变sku,根据配置项,来决定必填唯一,选填唯一,选填非唯一 |
data > variants > gram | 必须 | int | 克 |
data > variants > barcode | 选填 | string | 产品变体条形码 |
data > variants > image_id | 必须 | int | 图片-id |
data > variants > image | 选填 | string | 产品变体图片路径(这里填写路径即可,在保存的时候,会到产品图片表里面查找,找到得到image_id,然后赋值。),注意,这里的image,必须在 images参数中存在,否则将无法保存 |
data > variants > qty | 必须 | string | 产品变体库存,默认0 |
data > variants > option1 | 选填 | string | 产品变体规格1 |
data > variants > option2 | 选填 | string | 产品变体规格2 |
data > variants > option3 | 选填 | string | 产品变体规格3 |
data > variants > weight | 必须 | string | 产品变体重量 |
data > variants > weight_unit | 必须 | string | 产品变体重量单位 |
data > variants > note | 选填 | string | 产品变体备注 |
data > options | 选填 | array | 单规格为空,多规格必填不为空 |
data > options > id | 必须 | int | option id |
data > options > product_id | 必须 | int | 产品id |
data > options > name | 必须 | string | 规格名称 |
data > options > position | 必须 | string | 规格排序 |
data > options > items | 必须 | array | 规格子项数组 |
data > images | 必填 | array | 产品图片 |
data > images > id | 必须 | int | image id |
data > images > product_id | 必须 | int | 产品id |
data > images > src | 必须 | string | 产品图片路径 |
data > images > alt | 选填 | string | 图片 alt |
data > images > position | 必须 | string | 产品图片位置,按照顺序,从1开始,依次递增(必须从1开始,标识为1的将作为主图) |
data > collection_ids | 选填 | array[int] | 产品对应的 专辑ids 数组,一个产品可以对应多个专辑,是多对多关系,因此这里是数组可以,可以传递多个专辑id |
Response JSON Data(示例数据):
{
"code": 200,
"data": {
"id": 657,
"shop_id": 15,
"handle": "cartoon-bear-printing-womens-cardigan-pajamas-short-sleeve-shorts-household-clothing-suit-i5oc75",
"spu": "xxxxx",
"title": "Cartoon Bear Printing Women's Cardigan Pajamas Short Sleeve Shorts Household Clothing Suit",
"sub_title": "",
"body_html": "The fashionable cardigan pajamas has a cute cartoon bear print which adds more charm to your look.",
"meta_is_edit": 1,
"meta_title": "Cartoon Bear Printing Women's Cardigan Pajamas Short Sleeve Shorts Household Clothing Suit",
"meta_keywords": "",
"meta_description": "The fashionable cardigan pajamas has a cute cartoon bear print which adds more charm to your look.",
"status": 1,
"availability": 1,
"virtual_sales_count": 0,
"type": 2,
"vendor": "",
"qty": 435,
"price": "13.28",
"compare_at_price": "0.00",
"sale_count": 0,
"final_sale_count": 0,
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21",
"is_deleted": 2,
"deleted_at": 0,
"inventory_police": 1,
"inventory_police_type": 1,
"variant_need_image": 1,
"variant_need_note": 1,
"note": "",
"variants": [
{
"id": 4394,
"shop_id": 15,
"product_id": 657,
"title": "Green / M",
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652L28037",
"gram": 0,
"position": 0,
"barcode": "",
"image_id": 7410,
"qty": 79,
"option1": "Green",
"option2": "M",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"sale_count": 0,
"note": "",
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"id": 4395,
"shop_id": 15,
"product_id": 657,
"title": "Green / L",
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652M28037",
"gram": 0,
"position": 0,
"barcode": "",
"image_id": 7410,
"qty": 66,
"option1": "Green",
"option2": "L",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"sale_count": 0,
"note": "",
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"id": 4396,
"shop_id": 15,
"product_id": 657,
"title": "Green / XL",
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652XL28037",
"gram": 0,
"position": 0,
"barcode": "",
"image_id": 7410,
"qty": 97,
"option1": "Green",
"option2": "XL",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"sale_count": 0,
"note": "",
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"id": 4397,
"shop_id": 15,
"product_id": 657,
"title": "Green / 2XL",
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652XXL28037",
"gram": 0,
"position": 0,
"barcode": "",
"image_id": 7410,
"qty": 123,
"option1": "Green",
"option2": "2XL",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"sale_count": 0,
"note": "",
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"id": 4398,
"shop_id": 15,
"product_id": 657,
"title": "Green / 3XL",
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652XXXL28037",
"gram": 0,
"position": 0,
"barcode": "",
"image_id": 7410,
"qty": 70,
"option1": "Green",
"option2": "3XL",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"sale_count": 0,
"note": "",
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
}
],
"options": [
{
"id": 833,
"shop_id": 15,
"product_id": 657,
"name": "Color",
"position": 1,
"items": [
"Green"
],
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21"
},
{
"id": 834,
"shop_id": 15,
"product_id": 657,
"name": "Size",
"position": 2,
"items": [
"M",
"L",
"XL",
"2XL",
"3XL"
],
"created_at": "2023-02-08 11:07:21",
"updated_at": "2023-02-08 11:07:21"
}
],
"images": [
{
"id": 7409,
"product_id": 657,
"position": 1,
"src": "/product/15/image/2023/01/30/5b17ccf2483c46a900f569aac7924c61.jpg",
"alt": ""
},
{
"id": 7410,
"product_id": 657,
"position": 2,
"src": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg",
"alt": ""
},
{
"id": 7411,
"product_id": 657,
"position": 3,
"src": "/product/15/image/2023/01/30/7ffd9f95c0c286688a4227ada013ad46.jpg",
"alt": ""
},
{
"id": 7412,
"product_id": 657,
"position": 4,
"src": "/product/15/image/2023/01/30/c9e676731970bce0df818ad76c8ec6ea.jpg",
"alt": ""
},
{
"id": 7413,
"product_id": 657,
"position": 5,
"src": "/product/15/image/2023/01/30/480d64f2fca90319e4d899d6f63a8735.jpeg",
"alt": ""
},
{
"id": 7414,
"product_id": 657,
"position": 6,
"src": "/product/15/image/2023/01/30/3f0b6db5065e0ac910940f3b0bd8e445.jpg",
"alt": ""
}
],
"collectionIds": [
44
]
},
"message": "success"
}