# 物料

本文档将列举物料相关的 webhook

# 创建物料

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 9100,//业务类型,参考[webhook](/webhook/)定义
	"data": {
        "attributes": [ //物料自定义规格
            {
                "key": "颜色", //规格名
                "value": "新核云蓝" // 规格值
            }
        ],
        "category": { //物料分类
            "code": "IRON_001", // 物料分类编码
            "inventoryCycle": 90, // 物料分类循环时间
            "name": "五金件", // 物料分类名称
            "parentCode": "Mat_101" //父分类编码
        },
        "code": "IRON_001_001", // 物料编码
        "name": "法兰盘", // 物料名称
        "type": "products", // 物料类型,products: 产品; semi_products: 半成品;materials: 原料,workInProcess:在制品。
        "unit": "PCS", // 物料单位
        "allowProduction": 0,// 允许生产
        "allowPurchase": 0, // 允许采购
        "allowSale": 0, //允许销售
        "inventory": {
          "abcCategory": 0,
          "cost": 0,
          "defaultWarehouseCode": "",
          "defaultWarehouseLocation": "",
          "maxInventory": 0,
          "minInventory": 0,
          "minPackQuantity": 0,
          "rePurchasePoint": 0,
          "realCostPrice": 0,
          "safetyInventory": 0,
          "shelfLife": 0,
          "useBatch": 0,
          "useLockInventory": 0,
          "useSafetyInventory": 0
        },
        "supplyChain": {
          "isConfigurable": "",
          "overDeliveryRate": 0,
          "overReceiveRate": 0,
          "procurementPrice": 0,
          "procurementPriceType": "",
          "procurementTax": 0,
          "salePrice": 0,
          "salePriceType": "",
          "saleTax": 0
        }
    }
}

# 修改物料

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 9101,//业务类型,参考[webhook](/webhook/)定义
	"data": {
        "attributes": [ //物料自定义规格
            {
                "key": "颜色", //规格名
                "value": "新核云蓝" // 规格值
            }
        ],
        "category": { //物料分类
            "code": "IRON_001", // 物料分类编码
            "inventoryCycle": 90, // 物料分类循环时间
            "name": "五金件", // 物料分类名称
            "parentCode": "Mat_101" //父分类编码
        },
        "code": "IRON_001_001", // 物料编码
        "name": "法兰盘", // 物料名称
        "type": "products", // 物料类型,products: 产品; semi_products: 半成品;materials: 原料,workInProcess:在制品。
        "unit": "PCS", // 物料单位
        "allowProduction": 0,// 允许生产
        "allowPurchase": 0, // 允许采购
        "allowSale": 0, //允许销售
        "inventory": {
          "abcCategory": 0,
          "cost": 0,
          "defaultWarehouseCode": "",
          "defaultWarehouseLocation": "",
          "maxInventory": 0,
          "minInventory": 0,
          "minPackQuantity": 0,
          "rePurchasePoint": 0,
          "realCostPrice": 0,
          "safetyInventory": 0,
          "shelfLife": 0,
          "useBatch": 0,
          "useLockInventory": 0,
          "useSafetyInventory": 0
        },
        "supplyChain": {
          "isConfigurable": "",
          "overDeliveryRate": 0,
          "overReceiveRate": 0,
          "procurementPrice": 0,
          "procurementPriceType": "",
          "procurementTax": 0,
          "salePrice": 0,
          "salePriceType": "",
          "saleTax": 0
        }
    }
}

# 删除物料

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 9102,//业务类型,参考[webhook](/webhook/)定义
	"data": {"code":"IRON_001_001"} //物料编码
}

# 创建物料单位

请求报文说明

{
    "requestId":"b72dc2d6-c01a-42d0-9c87-06748b5a9e9f",//请求ID,供日后 DEBUG 用,暂无业务意义
    "businessType":9103,//业务类型,参考[webhook](/webhook/)定义
    "data":{
                "name":"件",//物料单位名字
                "isProductDefaultUnit":0,//是否是默认产品单位
                "isSemiProductDefaultUnit":1,//是否是默认半成品单位
                "isMaterialDefaultUnit":0//是否是默认原料单位
            }
}