Raw Material
Raw Material Registration
The PostAddRawMaterial endpoint is responsible for registering a new raw material in the MIMS system.
How to register a raw material
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddRawMaterial |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddRawMaterial" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| RecipeNo | String(25) | Yes | External code of the raw material recipe |
| BranchNo | String(25) | Yes | External code of the branch |
| RecipeName | String(25) | Yes | Raw material recipe name |
| MainProductNo | String(25) | Yes | External code of the main product |
| Standard | Boolean | No | Flag indicating if the raw material is standard |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
| ItemList | AddRawMaterialItemList | Yes | List of raw material items |
📝 AddRawMaterialItemList Object
The AddRawMaterialItemList object represents a list with raw material items.
Input Parameters
Parameter Type Required Description ItemNo String(25) Yes Item code MaterialNo String(25) No External code of the material ProductNo String(25) No External code of the product Qty Float Yes Quantity (must be greater than zero) MinTolerance Integer No Minimum tolerance MaxTolerance Integer No Maximum tolerance SubstitutedRawMaterial Boolean No Flag indicating if there is a substitute raw material SubstitutedProductNo String(25) No External code of the substitute product SubstitutedMaterialNo String(25) No External code of the substitute material SubstitutedPercentage Integer No Substitution percentage Dosed Boolean No Flag indicating if the item is dosed WarehouseNo String(25) No External code of the warehouse MeasurementUnitERP String No Unit of measurement in ERP Note
- It is required to provide
MaterialNoORProductNo, but not both at the same time.- If
SubstitutedRawMaterialistrue, it is necessary to provideSubstitutedMaterialNoorSubstitutedProductNoandSubstitutedPercentage.
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| RawMaterialCode | Integer | Yes | Internal raw material code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddRawMaterial"' \
--header 'Content-Type: application/json' \
--data '{
"RecipeNo": "REC001",
"BranchNo": "FIL001",
"RecipeName": "Receita Padrão",
"MainProductNo": "PROD001",
"Standard": true,
"OverwriteIfExists": true,
"ItemList": [
{
"ItemNo": "1",
"MaterialNo": "MAT001",
"Qty": 10.5,
"MinTolerance": 0,
"MaxTolerance": 5,
"SubstitutedRawMaterial": false,
"Dosed": false,
"WarehouseNo": "ALM001",
"MeasurementUnitERP": "KG"
}
]
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"RawMaterialCode": 123
}
🐞 Possible Errors
| Code | Message |
|---|---|
| ARM‑001 | The Material Number [value sent in request] does not exist in the Recipe (Raw Material) [value sent in request]! |
| ARM‑002 | You cannot provide Material and Product at the same time. Provide a Material or a Product! |
| ARM‑003 | It is necessary to provide a Material or a Product! |
Raw Material Deletion
The PostDeleteRawMaterial endpoint is responsible for executing the deletion of a raw material in the MIMS system.
How to delete a raw material
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostDeleteRawMaterial |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteRawMaterial" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MainProductNo | String(25) | Yes | External code of the main product |
| RecipeNo | String(25) | Yes | External code of the raw material recipe |
| BranchNo | String(25) | Yes | External code of the branch |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteRawMaterial"' \
--header 'Content-Type: application/json' \
--data '{
"MainProductNo": "PROD001",
"RecipeNo": "REC001",
"BranchNo": "FIL001"
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}
🐞 Possible Errors
| Code | Message |
|---|---|
| DRM‑001 | Raw material does not exist! |
| DRM‑002 | The Raw Material has already been used in a lot and does not allow deletion! |
| DRM‑003 | The Raw Material is fixed and does not allow deletion! |
Raw Material Item Deletion
The PostDeleteRawMaterialItem endpoint is responsible for executing the deletion of a raw material item in the MIMS system.
How to delete a raw material item
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostDeleteRawMaterialItem |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteRawMaterialItem" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MainProductNo | String(25) | Yes | External code of the main product |
| RecipeNo | String(25) | Yes | External code of the raw material recipe |
| BranchNo | String(25) | Yes | External code of the branch |
| MaterialNo | String(25) | No | External code of the material |
| ProductNo | String(25) | No | External code of the product |
Note
- It is required to provide
MaterialNoORProductNoto identify the item to be deleted.
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteRawMaterialItem"' \
--header 'Content-Type: application/json' \
--data '{
"MainProductNo": "PROD001",
"RecipeNo": "REC001",
"BranchNo": "FIL001",
"MaterialNo": "MAT001"
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}