商品新增接口
单个商品发布,需要配合pdd.goods.image.upload上传主图及商品详情图片。
一、请求参数
请求URL:
| 参数名 | 类型 | 必须 | 说明 |
|---|---|---|---|
| appid | String | 必填 | 合作伙伴AppId |
| timestamp | String | 必填 | 当前时间戳 |
| tb_seller_nick | String | 必填 | 拼多多账号, 非店铺名称 |
| sign | String | 必填 | 如何计算生成见示例代码 |
| request_data | json | 必填 | 商品数据,参考示例 |
request_data请求报文示例
{ "multi_price": 80000, "thumb_url": "https://img.pddpic.com/open-gw/2021-10-11/ffc9a1e35840c3cf7f7af66f56c004c1.jpeg", "two_pieces_discount": 95, "shipment_limit_second": "86400", "is_onsale": 0, "is_folt": true, "image_url":"https://img.pddpic.com/garner-api-open/2025-08-11/39b3e14a36a0e0e4e79681381d6e6c73.jpg", "sku_properties": [ { "template_pid": 96688, "template_module_id": 22326, "ref_pid": 310, "pid": 5, "value": "", "value_unit": "" } ], "second_hand": false, "price": 80000, "cat_id": 8464, "limit_quantity": 999, "is_pre_sale": false, "goods_name": "女装测试的宝贝,不要拍!!!", "quantity": 100, "weight": 100, "goods_desc": "女装测试的内容,好宝贝", "detail_gallery": [ "https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg", "https://img.pddpic.com/garner-api-open/2025-08-11/39b3e14a36a0e0e4e79681381d6e6c73.jpg" ], "carousel_gallery": [ "https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg" ], "is_refundable": true, "sku_list": [ { "id": 0, "limit_quantity": 0, "out_sku_sn": "", "spec_id_list": "[765]", "is_onsale": 0, "price_in_yuan": "10", "multi_price": 79900, "price": 80000, "quantity": 20, "thumb_url": "https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg", "thumb_url_file_id": 898996070, "weight": 0, "spec": [ { "parent_id": 1216, "parent_name": "尺寸", "spec_id": 765, "spec_name": "小号" } ], "sku_srv_templates": "" }, { "id": 0, "limit_quantity": 0, "out_sku_sn": "", "spec_id_list": "[767]", "is_onsale": 1, "price_in_yuan": "11", "multi_price": 79900, "price": 80000, "quantity": 20, "thumb_url": "https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg", "thumb_url_file_id": 898953569, "weight": 0, "spec": [ { "parent_id": 1216, "parent_name": "尺寸", "spec_id": 767, "spec_name": "大号" } ], "sku_srv_templates": "" } ], "market_price": 82000, "goods_type": "2", "cost_template_id": "163280639235619", "country_id": "10"}相关的商品部分入参见拼多多文档
二、请求示例代码
Java
@Test public void PddGoodsAddRequestByReqData() 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()); String reqData ="{\n" + " \"multi_price\": 80000,\n" + " \"thumb_url\": \"https://img.pddpic.com/open-gw/2021-10-11/ffc9a1e35840c3cf7f7af66f56c004c1.jpeg\",\n" + " \"two_pieces_discount\": 95,\n" + " \"shipment_limit_second\": \"86400\",\n" + " \"is_onsale\": 0,\n" + " \"is_folt\": true,\n" + " \"image_url\":\"https://img.pddpic.com/garner-api-open/2025-08-11/39b3e14a36a0e0e4e79681381d6e6c73.jpg\",\n" + " \"sku_properties\": [\n" + " {\n" + " \"template_pid\": 96688,\n" + " \"template_module_id\": 22326,\n" + " \"ref_pid\": 310,\n" + " \"pid\": 5,\n" + " \"value\": \"\",\n" + " \"value_unit\": \"\"\n" + " }\n" + " ],\n" + " \"second_hand\": false,\n" + " \"price\": 80000,\n" + " \"cat_id\": 8464,\n" + " \"limit_quantity\": 999,\n" + " \"is_pre_sale\": false,\n" + " \"goods_name\": \"女装测试的宝贝,不要拍!!!\",\n" + " \"quantity\": 100,\n" + " \"weight\": 100,\n" + " \"goods_desc\": \"女装测试的内容,好宝贝\",\n" + " \"detail_gallery\": [\n" + " \"https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg\",\n" + " \"https://img.pddpic.com/garner-api-open/2025-08-11/39b3e14a36a0e0e4e79681381d6e6c73.jpg\"\n" + " ],\n" + " \"carousel_gallery\": [\n" + " \"https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg\"\n" + " ],\n" + " \"is_refundable\": true,\n" + " \"sku_list\": [\n" + " {\n" + " \"id\": 0,\n" + " \"limit_quantity\": 0,\n" + " \"out_sku_sn\": \"\",\n" + " \"spec_id_list\": \"[765]\",\n" + " \"is_onsale\": 0,\n" + " \"price_in_yuan\": \"10\",\n" + " \"multi_price\": 79900,\n" + " \"price\": 80000,\n" + " \"quantity\": 20,\n" + " \"thumb_url\": \"https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg\",\n" + " \"thumb_url_file_id\": 898996070,\n" + " \"weight\": 0,\n" + " \"spec\": [\n" + " {\n" + " \"parent_id\": 1216,\n" + " \"parent_name\": \"尺寸\",\n" + " \"spec_id\": 765,\n" + " \"spec_name\": \"小号\"\n" + " }\n" + " ],\n" + " \"sku_srv_templates\": \"\"\n" + " },\n" + " {\n" + " \"id\": 0,\n" + " \"limit_quantity\": 0,\n" + " \"out_sku_sn\": \"\",\n" + " \"spec_id_list\": \"[767]\",\n" + " \"is_onsale\": 1,\n" + " \"price_in_yuan\": \"11\",\n" + " \"multi_price\": 79900,\n" + " \"price\": 80000,\n" + " \"quantity\": 20,\n" + " \"thumb_url\": \"https://img.pddpic.com/garner-api-open/2025-08-11/767ce4d219ac4364eb868457af68e70e.jpg\",\n" + " \"thumb_url_file_id\": 898953569,\n" + " \"weight\": 0,\n" + " \"spec\": [\n" + " {\n" + " \"parent_id\": 1216,\n" + " \"parent_name\": \"尺寸\",\n" + " \"spec_id\": 767,\n" + " \"spec_name\": \"大号\"\n" + " }\n" + " ],\n" + " \"sku_srv_templates\": \"\"\n" + " }\n" + " ],\n" + " \"market_price\": 82000,\n" + " \"goods_type\": \"2\",\n" + " \"cost_template_id\": \"163280639235619\",\n" + " \"country_id\": \"10\"\n" + "}"; data.put("request_data",reqData); // 参数签名 data.put("sign", Utils.Sign(data, Config.AppSecret)); doHttpRequest(Config.PddGoodsAddRequestUrl, data);
}三、返回结果
返回结果如下。
{ "code": 0, "data": { "goods_commit_id": 164489173095, "goods_id": 794029426838, "matched_spu_id": null, "request_id": "17549067735883097" }, "message": "ok"}说明: code为0表示成功,非0为失败,message会包含失败原因。