创建或修改bom
POST
/api/open/v2/boms/createOrUpdate
请求参数
Body 参数application/json
body
必需
Any of
itemCode
string | null
物料编码
useQty
number | null
父项物料基础数量
comment
string
备注
bomVersion
string
bom版本
bomComponents
array[object (ComponentBomParam) {7}] | null
必需
index: BOM节点ID, index 由调用者自定义, index 必须大于 等于 1;
parentIndex: BOM节点父节点ID,当 parentIndex 为 0 的时候。为根节点。一次请求有且仅能有一个 parentIndex 为 0 的节点
syncRouting
boolean
可选
默认不更新对应工艺路线
示例
{
"body": {
"itemCode": "string", // 物料编码
"useQty": 0, // 父项物料基础数量
"comment": "string", // 备注
"bomVersion": "string", // bom版本
"bomComponents": [ // bom节点
{
"itemCode": "string", // 物料编号
"useQty": 0, // 需求数
"bomVersion": "string", // 版本
"comment": "string", // 备注
"attritionRate": 0, // 损耗率
"procedureCode": "string", // 工序
"distributeOrder": "string" // 发料顺序
}
],
"syncRouting": true // 是否更新工艺路线
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://c2.xinheyun.com/api/open/v2/boms/createOrUpdate' \
--header 'Content-Type: application/json' \
--data-raw '{
"body": {
"itemCode": "string", // 物料编码
"useQty": 0, // 父项物料基础数量
"comment": "string", // 备注
"bomVersion": "string", // bom版本
"bomComponents": [ // bom节点
{
"itemCode": "string", // 物料编号
"useQty": 0, // 需求数
"bomVersion": "string", // 版本
"comment": "string", // 备注
"attritionRate": 0, // 损耗率
"procedureCode": "string", // 工序
"distributeOrder": "string" // 发料顺序
}
],
"syncRouting": true // 是否更新工艺路线
}
}'
返回响应
🟢200成功
application/json
Body
基础http返回信息
code
integer
可选
message
string
可选
示例
{
"code": 0,
"message": ""
}