跳转到内容
返回官网

生成商家自定义的规格

生成商家自定义的规格

一、请求参数

请求URL:

POST https://kf.fw199.com/gateway/pdd/goods/spec/id/get

参数名类型必须说明
appidString必填合作伙伴AppId
timestampString必填当前时间戳
tb_seller_nickString必填拼多多账号, 非店铺名称
signString必填如何计算生成见示例代码
parent_spec_idLONG必填拼多多标准规格ID,可以通过pdd.goods.spec.get接口获取
spec_nameString必填商家编辑的规格值,如颜色规格下设置白色属性

二、请求示例代码

Java

@Test
public void PddGoodsSpecIdGetRequest() throws Exception {
String seller_nick = Config.PddSellerNick; // 拼多多卖家账号
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("seller_nick", seller_nick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("parent_spec_id", "1216" );
data.put("spec_name", "超大号" );
// 参数签名
data.put("sign", Utils.Sign(data, Config.AppSecret));
doHttpRequest(Config.PddGoodsSpecIdGetRequestUrl, data);
}

三、返回结果

返回结果如下

{
"code": 0,
"message": "ok",
"data": {
"parent_spec_id": 1216,
"request_id": "16339218611586429",
"spec_id": 349144,
"spec_name": "超大号"
},
"trace_id": ""
}

说明: code为0表示成功,非0为失败,message会包含失败原因。

四、返回参数说明

参数接口参数类型例子说明
parent_spec_idLONG自定义规格所属的规格ID
spec_nameSTRING生成的自定义规格名称
spec_idLONG生成的自定义规格ID