C300-OpenAPI
  1. 物料
C300-OpenAPI
  • API调用指南
    • 开发前必读
    • 创建openapi应用
    • 基本概念
    • 测试文档
    • Webhook
  • 认证 API
    • 生成 Token
      POST
    • 刷新 Token
      PUT
  • 制造域MFR
    • 基础数据
      • BOM
        • 删除bom
        • 创建或修改bom
        • 查询bom
      • 标准工序
        • 创建或修改工序
        • 删除工序
        • 查询工序
        • 分批查询工序
  • 供应链域SC
    • 基础数据
      • 客户
        • 删除客户
        • 新增或修改客户
        • 查询客户
        • 分批查询客户
      • 客户分类
        • 创建或修改客户分类
        • 删除客户分类
        • 查询客户分类
        • 分批查询客户分类
      • 供应商
        • 新建或修改供应商
        • 删除供应商
        • 查询供应商
        • 分批查询供应商
      • 供应商分类
        • 创建供应商分类
        • 删除供应商分类
        • 查询供应商分类
        • 分批查询供应商分类
    • 销售管理
      • 销售订单
        • 创建或修改销售订单
        • 作废销售订单
        • 删除销售订单
        • 审核销售订单
  • 厂内物流域LOG
    • 基础数据
      • 物料
        • 创建或修改物料
          POST
        • 批量创建物料
          POST
        • 删除物料
          POST
        • 启用物料
          POST
        • 禁用物料
          POST
        • 重审
          POST
        • 审核物料
          POST
        • 查询物料列表(精简物料格式)
          POST
        • 查询物料编码集合
          POST
        • 物料图纸信息上传
          POST
        • 查询物料
          POST
        • 分批查询物料
          POST
      • 物料分类
        • 创建或修改物料分类
        • 删除物料分类
        • 查询物料分类列表
        • 查询物料分类
        • 分批查询物料分类
      • 单位
        • 创建或修改物料单位
        • 删除物料单位
        • 查询物料单位列表
        • 查询单位
        • 分批查询单位
      • 规格
        • 创建或更新
        • 查询规格
        • 分批查询规格
  1. 物料

批量创建物料

POST
/api/open/v2/items/batch/create/v2

请求参数

Body 参数application/json
body
array[object (ItemSaveParamV2) {23}]  | null 
必需
code
string  | null 
物料编码
必需
name
string  | null 
名称
必需
>= 1 字符<= 200 字符
categoryCode
string  | null 
物料分类编码
必需
unit
string  | null 
单位
必需
type
enum<string>  | enum<null> 
物料类型
必需
枚举值:
PRODUCTSSEMI_PRODUCTSMATERIALS
allowSale
boolean 
允许销售
可选
allowPurchase
boolean 
允许采购
可选
allowProduction
boolean 
允许生产
可选
allowOutsource
boolean 
允许委外
可选
auditStatus
enum<string> 
可选
物料审核状态
默认为已审核
枚举值:
TO_BE_SUBMITAUDITINGAUDITED
status
enum<string> 
可选
物料状态
默认为已启用
枚举值:
DISABLEDENABLETO_BE_DISABLEDTO_BE_ENABLE
attributes
array[object (Spec) {3}] 
可选
规格属性,最多 5 条
inventoryAttributes
object (InventoryAttributes) 
库存属性
可选
manufactureAttributes
object (ManufactureAttributes) 
计划&生产属性
可选
itemSupplyChainAttributes
object (ItemSupplyChainAttributes) 
供应链属性
可选
itemQualityInspectionAttributes
object (ItemQualityInspectionAttributes) 
采购收货检验属性
可选
updateItemSpecificationConfig
boolean 
可选
是否更新配置属性项,默认false
itemSpecificationConfigParams
array[object (ItemSpecificationConfigParam) {3}] 
可配置规格
可选
itemAssistUnits
array[object (ItemAssistUnitParam) {3}] 
辅助单位
可选
<= 10 items
itemUnit
object (ItemUnit) 
多单位属性
可选
itemAttachmentAttributes
object (ItemAttachmentAttributes) 
物料附件属性
可选
itemCustomizeFields
object (MapObject) 
自定义字段
可选
itemUnitParam
object (ItemUnitParam) 
物料单位
可选
示例
{
  "body": [
    {
      "code": "string",
      "name": "string",
      "categoryCode": "string",
      "unit": "string",
      "type": "PRODUCTS",
      "allowSale": true,
      "allowPurchase": true,
      "allowProduction": true,
      "allowOutsource": true,
      "auditStatus": "TO_BE_SUBMIT",
      "status": "DISABLED",
      "attributes": [
        {
          "key": "string",
          "value": "string",
          "code": "string"
        }
      ],
      "inventoryAttributes": {
        "useBatch": true,
        "useSN": true,
        "snType": "CATEGORY",
        "useKey": true,
        "shelfLife": 0,
        "useOverdueMessage": true,
        "useSafetyInventory": true,
        "maxInventory": 0,
        "safetyInventory": 0,
        "minInventory": 0,
        "rePurchasePoint": 0,
        "defaultWarehouseCode": "string",
        "defaultWarehouseLocation": "string",
        "abcCategory": 0,
        "cost": 0,
        "realCostPrice": 0,
        "minPackQuantity": 0,
        "useLockInventory": true,
        "enableInteger": true,
        "integerWay": "UP",
        "fifo": "NONE",
        "fifoRule": "STOCK_BATCH_CREATE",
        "enableFifoScanCheck": true
      },
      "manufactureAttributes": {
        "dailyProduction": 0,
        "defectiveRate": 0,
        "planStrategy": "MTO",
        "planBatchSize": 0,
        "batchSize": 0,
        "incrementSize": 0
      },
      "itemSupplyChainAttributes": {
        "procurementPriceType": "INCLUDE_TAX_PRICE",
        "procurementPrice": 0,
        "procurementTax": 0,
        "overReceiveRate": 0,
        "salePriceType": "INCLUDE_TAX_PRICE",
        "salePrice": 0,
        "saleTax": 0,
        "overDeliveryRate": 0,
        "isConfigurable": true
      },
      "itemQualityInspectionAttributes": {
        "useProcurementInspection": true,
        "procurementInspectionScheme": "string",
        "procurementInspectionStandard": "string"
      },
      "updateItemSpecificationConfig": true,
      "itemSpecificationConfigParams": [
        {
          "key": "string",
          "valueSet": [
            "string"
          ],
          "valuesFrom": "CUSTOM"
        }
      ],
      "itemAssistUnits": [
        {
          "unitCode": "string",
          "baseToAssistRatioVal": 0.01,
          "assistToBaseRatioVal": 0.01
        }
      ],
      "itemUnit": {
        "inventoryUnit": "string",
        "productionUnit": "string",
        "jbkUnit": "string",
        "saleUnit": "string",
        "purchaseUnit": "string"
      },
      "itemAttachmentAttributes": {
        "attachments": [
          {
            "url": "string",
            "type": "string",
            "name": "string",
            "size": 0
          }
        ],
        "blueprints": [
          {
            "url": "string",
            "type": "string",
            "name": "string",
            "size": 0
          }
        ],
        "comments": "string"
      },
      "itemCustomizeFields": {
        "key": {}
      },
      "itemUnitParam": {
        "baseUnitName": "string",
        "inventoryUnitName": "string",
        "inventoryToBaseQuantity": 0,
        "baseToInventoryQuantity": 0,
        "productionUnitName": "string",
        "productionToBaseQuantity": 0,
        "baseToProductionQuantity": 0,
        "jbkUnitName": "string",
        "productionToJbkQuantity": 0,
        "jbkToProductionQuantity": 0,
        "saleUnitName": "string",
        "saleToBaseQuantity": 0,
        "baseToSaleQuantity": 0,
        "purchaseUnitName": "string",
        "purchaseToBaseQuantity": 0,
        "baseToPurchaseQuantity": 0
      }
    }
  ]
}

示例代码

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/items/batch/create/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
    "body": [
        {
            "code": "string",
            "name": "string",
            "categoryCode": "string",
            "unit": "string",
            "type": "PRODUCTS",
            "allowSale": true,
            "allowPurchase": true,
            "allowProduction": true,
            "allowOutsource": true,
            "auditStatus": "TO_BE_SUBMIT",
            "status": "DISABLED",
            "attributes": [
                {
                    "key": "string",
                    "value": "string",
                    "code": "string"
                }
            ],
            "inventoryAttributes": {
                "useBatch": true,
                "useSN": true,
                "snType": "CATEGORY",
                "useKey": true,
                "shelfLife": 0,
                "useOverdueMessage": true,
                "useSafetyInventory": true,
                "maxInventory": 0,
                "safetyInventory": 0,
                "minInventory": 0,
                "rePurchasePoint": 0,
                "defaultWarehouseCode": "string",
                "defaultWarehouseLocation": "string",
                "abcCategory": 0,
                "cost": 0,
                "realCostPrice": 0,
                "minPackQuantity": 0,
                "useLockInventory": true,
                "enableInteger": true,
                "integerWay": "UP",
                "fifo": "NONE",
                "fifoRule": "STOCK_BATCH_CREATE",
                "enableFifoScanCheck": true
            },
            "manufactureAttributes": {
                "dailyProduction": 0,
                "defectiveRate": 0,
                "planStrategy": "MTO",
                "planBatchSize": 0,
                "batchSize": 0,
                "incrementSize": 0
            },
            "itemSupplyChainAttributes": {
                "procurementPriceType": "INCLUDE_TAX_PRICE",
                "procurementPrice": 0,
                "procurementTax": 0,
                "overReceiveRate": 0,
                "salePriceType": "INCLUDE_TAX_PRICE",
                "salePrice": 0,
                "saleTax": 0,
                "overDeliveryRate": 0,
                "isConfigurable": true
            },
            "itemQualityInspectionAttributes": {
                "useProcurementInspection": true,
                "procurementInspectionScheme": "string",
                "procurementInspectionStandard": "string"
            },
            "updateItemSpecificationConfig": true,
            "itemSpecificationConfigParams": [
                {
                    "key": "string",
                    "valueSet": [
                        "string"
                    ],
                    "valuesFrom": "CUSTOM"
                }
            ],
            "itemAssistUnits": [
                {
                    "unitCode": "string",
                    "baseToAssistRatioVal": 0.01,
                    "assistToBaseRatioVal": 0.01
                }
            ],
            "itemUnit": {
                "inventoryUnit": "string",
                "productionUnit": "string",
                "jbkUnit": "string",
                "saleUnit": "string",
                "purchaseUnit": "string"
            },
            "itemAttachmentAttributes": {
                "attachments": [
                    {
                        "url": "string",
                        "type": "string",
                        "name": "string",
                        "size": 0
                    }
                ],
                "blueprints": [
                    {
                        "url": "string",
                        "type": "string",
                        "name": "string",
                        "size": 0
                    }
                ],
                "comments": "string"
            },
            "itemCustomizeFields": {
                "key": {}
            },
            "itemUnitParam": {
                "baseUnitName": "string",
                "inventoryUnitName": "string",
                "inventoryToBaseQuantity": 0,
                "baseToInventoryQuantity": 0,
                "productionUnitName": "string",
                "productionToBaseQuantity": 0,
                "baseToProductionQuantity": 0,
                "jbkUnitName": "string",
                "productionToJbkQuantity": 0,
                "jbkToProductionQuantity": 0,
                "saleUnitName": "string",
                "saleToBaseQuantity": 0,
                "baseToSaleQuantity": 0,
                "purchaseUnitName": "string",
                "purchaseToBaseQuantity": 0,
                "baseToPurchaseQuantity": 0
            }
        }
    ]
}'

返回响应

🟢200成功
application/json
Body
基础http返回信息
code
integer 
可选
message
string 
可选
示例
{
  "code": 0,
  "message": ""
}
上一页
创建或修改物料
下一页
删除物料
Built with