创建/修改产品
<p>[TOC]</p>
<h5>请求URL</h5>
<ul>
<li>POST</li>
<li><code>/erp/goods/create</code> </li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">goods_sn</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>产品编号(spu)</td>
</tr>
<tr>
<td style="text-align: left;">name</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>产品名称</td>
</tr>
<tr>
<td style="text-align: left;">warehouse_id</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">int</td>
<td>仓库户ID</td>
</tr>
<tr>
<td style="text-align: left;">is_spec</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">int</td>
<td>是否有规格;0无;1有</td>
</tr>
<tr>
<td style="text-align: left;">spec</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">array</td>
<td>规格描述</td>
</tr>
<tr>
<td style="text-align: left;">skus</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">array</td>
<td>sku明细</td>
</tr>
<tr>
<td style="text-align: left;">images</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">array</td>
<td>产品图片</td>
</tr>
<tr>
<td style="text-align: left;">category_list</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">array</td>
<td>分类ID集</td>
</tr>
<tr>
<td style="text-align: left;">fixed_price</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">float</td>
<td>单价</td>
</tr>
<tr>
<td style="text-align: left;">stock_amount</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>库存</td>
</tr>
<tr>
<td style="text-align: left;">definition_params</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">array</td>
<td>自定义产品数据</td>
</tr>
<tr>
<td style="text-align: left;">status</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">int</td>
<td>状态:0下架;1上架</td>
</tr>
</tbody>
</table>
<h5>definition_params 参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">erp_id</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>erp自定义参数主键</td>
</tr>
<tr>
<td style="text-align: left;">value</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>值</td>
</tr>
<tr>
<td style="text-align: left;">name</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">string</td>
<td>参数名,可以不传</td>
</tr>
</tbody>
</table>
<h5>请求示例</h5>
<pre><code>{
&quot;main_video&quot;: [],
&quot;details_video&quot;: [],
&quot;goods_sn&quot;: &quot;t0524&quot;,
&quot;warehouse_id&quot;: 15,
&quot;is_spec&quot;: 1,
&quot;spec&quot;: [
{
&quot;spec_name&quot;: &quot;颜色&quot;,
&quot;spec_value_name&quot;: [
&quot;黑色&quot;,
&quot;白色&quot;
]
}
],
&quot;skus&quot;: [
{
&quot;spec&quot;: [
{
&quot;spec_name&quot;: &quot;颜色&quot;,
&quot;spec_value_name&quot;: &quot;黑色&quot;
}
],
&quot;stock&quot;: &quot;6&quot;,
&quot;price&quot;: 900,
&quot;sku_sn&quot;: &quot;tet052401&quot;,
&quot;indexPosition&quot;: &quot;0-0&quot;,
&quot;definition_params&quot;: [
{
&quot;name&quot;: &quot;千件起批价&quot;,
&quot;value&quot;: &quot;10000&quot;,
&quot;erp_id&quot;: 162
},
{
&quot;name&quot;: &quot;大货价&quot;,
&quot;value&quot;: &quot;100&quot;,
&quot;erp_id&quot;: 152
},
{
&quot;name&quot;: &quot;剪版价&quot;,
&quot;value&quot;: &quot;1000&quot;,
&quot;erp_id&quot;: 153
}
]
},
{
&quot;spec&quot;: [
{
&quot;spec_name&quot;: &quot;颜色&quot;,
&quot;spec_value_name&quot;: &quot;白色&quot;
}
],
&quot;stock&quot;: &quot;7&quot;,
&quot;price&quot;: 900,
&quot;sku_sn&quot;: &quot;tet052402&quot;,
&quot;indexPosition&quot;: &quot;0-1&quot;,
&quot;definition_params&quot;: [
{
&quot;name&quot;: &quot;千件起批价&quot;,
&quot;value&quot;: &quot;10000&quot;,
&quot;erp_id&quot;: 162
},
{
&quot;name&quot;: &quot;大货价&quot;,
&quot;value&quot;: &quot;100&quot;,
&quot;erp_id&quot;: 152
},
{
&quot;name&quot;: &quot;剪版价&quot;,
&quot;value&quot;: &quot;1000&quot;,
&quot;erp_id&quot;: 153
}
]
}
],
&quot;images&quot;: [
{
&quot;status&quot;: &quot;success&quot;,
&quot;type&quot;: 1,
&quot;img&quot;: &quot;52/image/20240524/98524183_1716537648192.webp&quot;,
&quot;img_url&quot;: &quot;https://zlqwt-1259451404.cos.ap-guangzhou.myqcloud.com/52/image/20240524/98524183_1716537648192.webp&quot;
}
],
&quot;name&quot;: &quot;tet0524123&quot;,
&quot;category_list&quot;: [
196
],
&quot;fixed_price&quot;: &quot;&quot;,
&quot;stock_amount&quot;: 0,
&quot;marked_price&quot;: &quot;&quot;,
&quot;details&quot;: &quot;&quot;,
&quot;content&quot;: &quot;&lt;p&gt;产品介绍&lt;/p&gt;&quot;,
&quot;status&quot;: 1,
&quot;is_spec_img&quot;: false,
&quot;goods_params&quot;: [
{
&quot;params_name&quot;: &quot;材料&quot;,
&quot;params_value&quot;: &quot;棉&quot;
},
{
&quot;params_name&quot;: &quot;硬度&quot;,
&quot;params_value&quot;: &quot;高&quot;
}
],
&quot;definition_params&quot;: [
{
&quot;erp_id&quot;: 163,
&quot;name&quot;: &quot;成分&quot;,
&quot;value&quot;: &quot;成分&quot;
},
{
&quot;erp_id&quot;: 161,
&quot;name&quot;: &quot;起毛起球&quot;,
&quot;value&quot;: &quot;气球&quot;
},
{
&quot;erp_id&quot;: 160,
&quot;name&quot;: &quot;水洗色牢度&quot;,
&quot;value&quot;: &quot;色牢度&quot;
},
{
&quot;erp_id&quot;: 159,
&quot;name&quot;: &quot;湿摩擦&quot;,
&quot;value&quot;: &quot;摩擦&quot;
},
{
&quot;erp_id&quot;: 158,
&quot;name&quot;: &quot;干摩擦&quot;,
&quot;value&quot;: &quot;干&quot;
},
{
&quot;erp_id&quot;: 151,
&quot;name&quot;: &quot;剪版价&quot;,
&quot;value&quot;: &quot;剪板&quot;
},
{
&quot;erp_id&quot;: 157,
&quot;name&quot;: &quot;量化值&quot;,
&quot;value&quot;: &quot;量化&quot;
},
{
&quot;erp_id&quot;: 156,
&quot;name&quot;: &quot;克重&quot;,
&quot;value&quot;: &quot;克重&quot;
},
{
&quot;erp_id&quot;: 155,
&quot;name&quot;: &quot;幅宽&quot;,
&quot;value&quot;: &quot;宽幅&quot;
}
]
}
</code></pre>
<h5>返回示例</h5>
<pre><code>{
&quot;errcode&quot;: 0,
&quot;errmsg&quot;: &quot;&quot;,
}</code></pre>
<table>
<thead>
<tr>
<th style="text-align: left;">参数</th>
<th style="text-align: left;">类型</th>
<th style="text-align: left;">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">errcode</td>
<td style="text-align: left;">int</td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>