通过属性ID,获取类目的新属性,可以查询销售属性
通过属性ID,获取类目的新属性,可以查询销售属性
一、请求参数
请求URL:
POST https://kf.fw199.com/gateway/jd/sku/write/mergeskufeatures
公共参数
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| appid | String | 是 | 合作伙伴AppId | |
| timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
| seller_nick | String | 是 | 38173182 | 京东的账号,对应蜂巢授权返回jdseller字段 |
| sign | String | 是 |
业务参数
| 名称 | 类型 | 必须 | 示例值 | 描述 |
|---|---|---|---|---|
| attrId | Number | 是 | 10001 | 属性ID |
| field | String[] | 否 | 如:attrValueList,attrGroup | 属性对可选返回字段,可用值为 attrValueList ,attrGroup ps:返回对象中带@Field注解的为默认不返回项,需要在fields中传入对应字段才会返回 |
二、请求示例代码
Java
请求示例代码
@Test public void JDFindAttrByIdUnlimitCate() throws Exception { String sellerNick = Config.JDSellerNick ; //业务参数 Map<String, String> data = new HashMap<String, String>(); data.put("appid", Config.AppId); data.put("seller_nick", sellerNick); Long timestamp = System.currentTimeMillis() / 1000; data.put("timestamp", timestamp.toString()); data.put("attrId","1000021481"); data.put("field","attrValueList,attrGroup"); data.put("sign", Utils.Sign(data, Config.AppSecret)); doHttpRequest(Config.JDFindAttrByIdUnlimitCate, data); }三、返回结果
{ "code": 0, "message": "ok", "data": { "attrValueList": [{ "attId": 1000021481, "catId": 12034, "features": [{ "fvalue": "#FF0000", "key": "class" }], "id": 4156864013, "name": "红色", "orderSort": 1 }, { "attId": 1000021481, "catId": 12034, "features": [{ "fvalue": "#990000", "key": "class" }], "id": 4156864020, "name": "深红色", "orderSort": 2 }], "attributeType": 4, "catId": 12034, "features": [{ "fvalue": "1", "key": "color" }, { "fvalue": "0", "key": "required" }, { "fvalue": "1", "key": "dim" }], "id": 1000021481, "inputType": 2, "isRequired": false, "name": "颜色", "orderSort": 7 }}说明: code为0表示成功,非0为失败,message会包含失败原因。
四、返回字段说明
| 名称 | 类型 | 必须 | 示例值 | 描述 |
|---|---|---|---|---|
| id | Number | 是 | 10001 | 属性ID |
| name | String | 是 | 手机屏幕 | 属性名称 |
| catId | Number | 是 | 655 | 类目ID |
| orderSort | Number | 是 | 1 | 排序,越小越靠前 |
| attributeType | Number | 是 | 3 | 属性类型 1.关键属性 3.可变属性 4.销售属性 |
| inputType | Number | 是 | 1 | 录入方式: 1.单选 2.多选 3.可输入 |
| graphic | String | 否 | jfs/demo.jpg | 属性图示(图片地址) |
| isRequired | Boolean | 是 | true | 是否必填 |
| features | java.util.Set | 否 | 无 | 特性 |
| -key | String | 否 | key样例 | 类目属性特殊属性key |
| -fvalue | String | 否 | fvalue样例 | 类目属性特殊属性value |
| -cn | String | 否 | cn样例 | 类目属性特殊属性中文含义 |
| attrValueList | java.util.List | 否 | 无 | 属性值集合 |
| -id | Number | 是 | 100011 | 属性值ID |
| -attId | Number | 是 | 10001 | 属性ID |
| -catId | Number | 是 | 655 | 类目ID |
| -name | String | 是 | 大屏幕 | 属性值名称 |
| -orderSort | Number | 是 | 1 | 排序,越小越靠前 |
| features | java.util.Set | 否 | 无 | 特性: key value options 第一位:0 非必填 1 必填;第二位:0 不筛选 1 筛选;第三位:0 不导航 1 导航 attrLevel 若值为1 或 2:则此属性可以在商品维度及sku维度使用 xzstr 此属性为文本输入方式,可输入字符长度为标值 xzdate4 此属性仅可输入年 例:1991 xzdate7 此属性仅可输入年月日 例:1991-01-01 xzdate 此属性仅可输入年月日时分秒 例:1991-01-01 00:00:00 xznum 此属性仅可输入数字,可输入字符长度为标值 xzns 此属性仅可输入字符、数字,可输入字符长度为标值 xzchi 此属性仅可输入汉字,可输入字符长度为标值 erpAttType 此属性类型 GGCS:规格参数 KZSX:扩展属性 brand 若值为1,则是品牌 |
| -key | String | 否 | key样例 | 特殊属性key |
| -fvalue | String | 否 | fvalue样例 | 特殊属性value |
| -cn | String | 否 | cn样例 | 特殊属性中文含义 |
| attrGroup | com.jd.pop.ware.ic.api.domain.CategoryAttrGroupUnlimit | 否 | 无 | 属性分组 |
| -id | Number | 是 | 1001 | 属性组ID |
| -name | String | 是 | 外观 | 属性组名称 |
| -orderSort | Number | 是 | 1 | 排序,越小越靠前 |
| features | java.util.Set | 否 | 无 | 特征 |
| -key | String | 否 | key样例 | 特殊属性key |
| -fvalue | String | 否 | fvalue样例 | 特殊属性value |
| -cn | String | 否 | cn样例 | 特殊属性中文含义 |