5.3 物料创建及更新
test-测试环境
https://oc-test.onecontract-cloud.com
test-测试环境
https://oc-test.onecontract-cloud.com
POST
/api/hitf/v2p/rest/invoke/SFpFUk86T1JDSEVTVFJBVElPTjpISVRGLkFQSS5EQVRBX0lNUE9SVA==
请求参数
Query 参数
domain
string
可选
示例值:
MATERIALS
Header 参数
Authorization
string
可选
默认值:
{{token}}
Body 参数application/json
userIdType
enum<string>
用户ID类型
枚举值:
EMAILUSERIDLOGINNAME
userId
string
userId
data
array[object (物料) {11}]
物料数据
materialsCode
string
物料编码
isActive
boolean
是否启用(true启用/false禁用)
materialsName
string
物料名称
materialsClassification
string
物料类型
materialsType
string
物料分类
materialsUnit
string
物料单位
,当物料类型为库存物料(INV)时必填
proposedPrice
number
参考价格
noTaxAmount
number
不含税价格
taxRate
integer
税率,13 表示13%
includingTaxPrice
number
含税金额
taxAmount
number
税额
示例
{
"userIdType": "LOGINNAME",
"userId": "zhenling_openapi_admin",
"data": [
{
"materialsCode": "P23479126",
"isActive": true,
"materialsName": "螺旋浆叶1",
"materialsClassification": "INV",
"materialsType": "CM",
"materialsUnit": "PCS",
"proposedPrice": 124,
"noTaxAmount": 12421,
"taxRate": "13",
"includingTaxPrice": 14035.73,
"taxAmount": 1614.73,
"classificationCode": ""
},
{
"materialsCode": "P23479125",
"isActive": true,
"materialsName": "螺旋浆叶2",
"materialsClassification": "INV",
"materialsType": "CM",
"materialsUnit": "PCS",
"proposedPrice": 124,
"noTaxAmount": 12421,
"taxRate": "13",
"includingTaxPrice": 14035.73,
"taxAmount": 1614.73
}
]
}
示例代码
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://oc-test.onecontract-cloud.com/api/hitf/v2p/rest/invoke/SFpFUk86T1JDSEVTVFJBVElPTjpISVRGLkFQSS5EQVRBX0lNUE9SVA==?domain=MATERIALS' \
--header 'Authorization: bearer eb2446a6-93f9-456b-b713-5cb6f6adf765' \
--header 'Content-Type: application/json' \
--data-raw '{
"userIdType": "LOGINNAME",
"userId": "zhenling_openapi_admin",
"data": [
{
"materialsCode": "P23479126",
"isActive": true,
"materialsName": "螺旋浆叶1",
"materialsClassification": "INV",
"materialsType": "CM",
"materialsUnit": "PCS",
"proposedPrice": 124,
"noTaxAmount": 12421,
"taxRate": "13",
"includingTaxPrice": 14035.73,
"taxAmount": 1614.73,
"classificationCode": ""
},
{
"materialsCode": "P23479125",
"isActive": true,
"materialsName": "螺旋浆叶2",
"materialsClassification": "INV",
"materialsType": "CM",
"materialsUnit": "PCS",
"proposedPrice": 124,
"noTaxAmount": 12421,
"taxRate": "13",
"includingTaxPrice": 14035.73,
"taxAmount": 1614.73
}
]
}'
返回响应
🟢200成功
application/json
Body
message
string
必需
result
object
必需
data
array [object {14}]
必需
success
boolean
必需
示例
{
"message": "execute success",
"result": {
"data": [
{
"materialsClassification": "INV",
"sourceSystem": "DEFAULT",
"lastUpdateDate": "2025-04-09 16:47:28",
"materialsType": "CM",
"isActive": true,
"noTaxAmount": "12421",
"includingTaxPrice": "14035.73",
"id": "5151671",
"lang": "zh_CN",
"materialsName": "螺旋浆叶1",
"materialsUnit": "PCS",
"proposedPrice": "124",
"active": "0",
"creationDate": "2025-04-09 16:47:27",
"taxRate": "13",
"classificationCode": "",
"tenantId": "1273",
"materialsCode": "P23479126",
"taxAmount": "1614.73",
"syncStatus": "PERSISTED"
},
{
"proposedPrice": "124",
"materialsClassification": "INV",
"sourceSystem": "DEFAULT",
"lastUpdateDate": "2025-04-09 16:47:28",
"active": "0",
"materialsType": "CM",
"isActive": true,
"noTaxAmount": "12421",
"creationDate": "2025-04-09 16:47:27",
"taxRate": "13",
"includingTaxPrice": "14035.73",
"tenantId": "1273",
"id": "5151672",
"materialsCode": "P23479125",
"taxAmount": "1614.73",
"lang": "zh_CN",
"materialsName": "螺旋浆叶2",
"materialsUnit": "PCS",
"syncStatus": "PERSISTED"
}
],
"userIdType": "LOGINNAME",
"batchId": "053cb24f-4220-43d2-806e-fc6ad0e57721",
"userId": "ebmpapst_admin"
},
"success": true
}