创建SPV

接口描述

该接口可创建已存在的SPL下的SPV及相应ITEM, 也可单独创建SPV后,ITEM模块信息使用对应的创建接口创建。

URL

/ark/open_api/v1/spl/{spl_id}/spv

URL Parameter

名称 类型 必填 说明
spl_id String Yes 已存在的SPL ID

Method

POST

Request Body (content-type:application/json;charset=utf8)

请务必按以下字段要求添加数据,以免系统报错。

{
    "spv":{
            "qty": 1,
            "unit": "件",
            "net_weight": 250,
            "gross_weight": 450,
            "barcode": "test02",
            "barcode_type": "upc",
            "country": "中国",
            "shelf_life":190,
            "non_desc_variants":[
                {
                 "id": "56d84f9a805d891008705276",
                 "value": "M",
                 "value_id": "56d84f9a805d891008705666"
                }
            ],
            "import_cost":1234,
            "manufacturer": "test",
            "ingredient": "test",
            "usage": "test",
            "customs_photos_urls":[
                        "http://img.xiaohongshu.com/items/3135edc58855dcf047fc39161ee9f687@2o.jpg"
                        ],
            "customs_specification":"test specification"
    },
    "item":{
            "price": 252.69,
            "original_price": 699.0,
            "pre_tax_price": 200.0
    }
}

Request Body Parameters

名称 类型 说明
spv Dict spv模块信息
barcode String 商品条形码,只能输入“字母 数字 / -” (创建商品时手动填入,首选upc码,但不介意商家使用自定义商品编码)
barcode_type String 条码类型
non_desc_variants Array SPV规格, 无SPV规格可不填
id String SPV规格id
value String SPV规格值
value_id String 属性值id,若传入该值则value不生效,以value_id为准;若不使用属性值id请不要传入该字段。
net_weight Float 净重
gross_weight Float 毛重
country String 原产国
qty Int 件数,内含数量
unit String 单位
shelf_life Int 保质期(天)
import_cost Float 进口成本价(CNY)(可粗略估计)
manufacturer String 生产厂家(填写全称,中文/英文)
customs_specification String 规格型号(例如,液体:10ml,10ml/支 (等其他计量单位) ;固体:10g,10g/支 (等其他计量单位);配饰/鞋子/服装:尺寸、尺码、颜色。)
ingredient String 材质或成分含量(例如,水、二氧化碳等;帆布、牛皮等)
usage String 用途(例如,护肤等;背包、双肩包、凉鞋等)
customs_photos_urls Array 商品图片(用于海关备案)
item Dict item模块信息
original_price Float 商品原价
pre_tax_price Float 税前价,跨境税商家必填
price Float 税后价,非跨境税商家必填

补充说明

创建接口内的“qty”指内含数量不是库存数量

Response 200 (application/json;charset=utf-8)

{
    "error_code": 0,
    "data": {
        "spvs": [
            {
                "spu_id": "58e4a96caf0a672dcda6db07",
                "pending_changes": null,
                "import_cost": 1234,
                "net_weight": 250,
                "qty": 1,
                "spl_id": "58e4a96caf0a672dcda6db08",
                "id": "58e4a96daf0a672dcda6db0b",
                "unit": "件",
                "barcode_type": "upc",
                "non_desc_variants": [
                    {
                        "ename": "Shoes Size",
                        "id": "56d84f9a805d891008705276",
                        "value": "M",
                        "name": "尺码"
                    }
                ],
                "state": 1,
                "usage": "test",
                "shelf_life": 190,
                "ingredient": "test",
                "status": 2,
                "customs_photos_urls": [
                    "http://img.xiaohongshu.com/items/3135edc58855dcf047fc39161ee9f687@2o.jpg"
                ],
                "barcode": "test01",
                "gross_weight": 450,
                "customs_photos": [],
                "manufacturer": "test",
                "customs_specification": "test specification",
                "country": "中国"
            }
        ],
        "items": [
            {
                "spu_id": "58e4a96caf0a672dcda6db07",
                "update_time": 1491380589,
                "ename": "GUCCI test1 white L",
                "name": "GUCCI古驰 test1 white L",
                "skucode": "test01",
                "original_price": 699.0,
                "tax": 52.700000000000003,   
                "pre_tax_price": 200.0,   
                "price": 252.69999999999999,   
                "tax_rate": 0.26350000000000001,
                "barcode": "test01",
                "pending_changes": null,
                "available": true,
                "buyable": false,
                "spv_id": "58e4a96daf0a672dcda6db0b",
                "state": 1,
                "create_time": 1491380589,
                "status": 1,
                "spl_id": "58e4a96caf0a672dcda6db08",
                "top_image": null,
                "id": "58e4a96daf0a672dcda6db0d",
                "barcode_type": "upc"
            }
        ],
        "spls": [
            {
                "spu_id": "58e4a96caf0a672dcda6db07",
                "status": 2,
                "id": "58e4a96caf0a672dcda6db08",
                "state": 1,
                "variants": [
                    {
                        "ename": "Color",
                        "id": "56d84f9a805d891008705275",
                        "value": "white",
                        "name": "颜色"
                    }
                ],
                "pending_change": null
            }
        ],
        "spus": [
            {
                "pending_changes": null,
                "ename": "test1",
                "name": "test1",
                "short_name": "test1",
                "brand": {
                    "ename": "GUCCI",
                    "id": "52d0deb1b4c4d655316b7d4b",
                    "name": "古驰"
                },
                "brand_id": "52d0deb1b4c4d655316b7d4b",
                "category_id": "572dd173939e250d08ec59f2",
                "id": "58e4a96caf0a672dcda6db07",
                "categories": [
                    {
                        "ename": "Shoes",
                        "id": "52ce1c02b4c4d649b58b892f",
                        "name": "鞋子"
                    },
                    {
                        "ename": "Women's shoes",
                        "id": "56a6eecd8e7989cd56fcea7f",
                        "name": "女鞋"
                    },
                    {
                        "ename": "Women's high heels",
                        "id": "572dd173939e250d08ec59f2",
                        "name": "女士高跟鞋"
                    }
                ]
            }
        ],
        "spl_items": [
            {
                "spu_id": "58e4a96caf0a672dcda6db07",
                "status": 2,
                "videos": null,
                "spl_id": "58e4a96caf0a672dcda6db08",
                "feature": "initial",
                "image_urls": [
                    "http://img.xiaohongshu.com/items/3135edc58855dcf047fc39161ee9f687@2o.jpg"
                ],
                "faqs": [
                    {
                        "answer": "answer",
                        "question": "question"
                    }
                ],
                "state": 1,
                "pending_changes": {
                    "status": 0,
                    "videos": null,
                    "feature": null,
                    "faqs": null,
                    "images": [
                        {
                            "name": null,
                            "extension": ".jpg",
                            "height": 1200,
                            "width": 900,
                            "link": "http://img.xiaohongshu.com/items/d84d018842bbff888a8a132fcf445769",
                            "path": "items/d84d018842bbff888a8a132fcf445769"
                        }
                    ],
                    "attributes": null,
                    "desc": null
                },
                "user_guide": {
                    "images": [
                        {
                            "name": null,
                            "extension": ".jpg",
                            "height": 1200,
                            "width": 900,
                            "link": "//img.xiaohongshu.com/items/d84d018842bbff888a8a132fcf445769",
                            "path": "items/d84d018842bbff888a8a132fcf445769"
                        }
                    ],
                    "videos": []
                },
                "image_desc": {
                    "images": [
                        {
                            "name": null,
                            "extension": ".jpg",
                            "height": 1200,
                            "width": 900,
                            "link": "//img.xiaohongshu.com/items/d84d018842bbff888a8a132fcf445769",
                            "path": "items/d84d018842bbff888a8a132fcf445769"
                        }
                    ],
                    "image_urls": []
                },
                "images": null,
                "attributes": [
                    {
                        "ename": null,
                        "name": "材质",
                        "image": null,
                        "value": "TEST MATERIAL",
                        "image_url": null,
                        "property_id": "58450b30805d89635938325e"
                    },
                    {
                        "ename": null,
                        "name": "产地",
                        "image": null,
                        "value": "CHINA",
                        "image_url": null,
                        "property_id": "58450b30805d89635938325f"
                    }
                ],
                "id": "58e4a96caf0a672dcda6db09",
                "desc": "initial"
            }
        ]
    },
    "error_msg": 0,
    "success": true
}

Response parameters

名称 类型 说明
pending_changes Array 待审核的更改信息
spus Array SPU模块信息
id String SPU ID
categories Array 分类列表,从一级分类到末级分类
spls Array SPL模块信息
id String SPV ID
spl_items Array SPL ITEM模块信息
id String SPL ID
spvs Array SPV模块信息
id String SPV ID
items Array ITEM模块信息
id String ITEM ID
available Bool true为可选择上架,false为不可选择上架
buyable Bool true为可售卖,实际上架状态, false为不可售卖,实际下架状态
top_image String 天王图
create_time Int 商品创建时间
update_time Int 最后更新时间
original_price Float 商品原价
tax Float 税金
pre_tax_price Float 税前价,跨境税商家必填
price Float 税后价,非跨境税商家必填
tax_rate Float 税率
spu_id String SPU ID
spl_id String SPL ID
spv_id String SPV ID
id String ITEM ID,商品id

补充说明

  1. state & status 具体状态码请参考商品状态码