Skip to main content

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 TypeExample URL
POST{{url_base}}/PostAddRawMaterial
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddRawMaterial"

Input Parameters​

ParameterTypeRequiredDescription
RecipeNoString(25)YesExternal code of the raw material recipe
BranchNoString(25)YesExternal code of the branch
RecipeNameString(25)YesRaw material recipe name
MainProductNoString(25)YesExternal code of the main product
StandardBooleanNoFlag indicating if the raw material is standard
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists
ItemListAddRawMaterialItemListYesList of raw material items

📝 AddRawMaterialItemList Object​

The AddRawMaterialItemList object represents a list with raw material items.

Input Parameters​

ParameterTypeRequiredDescription
ItemNoString(25)YesItem code
MaterialNoString(25)NoExternal code of the material
ProductNoString(25)NoExternal code of the product
QtyFloatYesQuantity (must be greater than zero)
MinToleranceIntegerNoMinimum tolerance
MaxToleranceIntegerNoMaximum tolerance
SubstitutedRawMaterialBooleanNoFlag indicating if there is a substitute raw material
SubstitutedProductNoString(25)NoExternal code of the substitute product
SubstitutedMaterialNoString(25)NoExternal code of the substitute material
SubstitutedPercentageIntegerNoSubstitution percentage
DosedBooleanNoFlag indicating if the item is dosed
WarehouseNoString(25)NoExternal code of the warehouse
MeasurementUnitERPStringNoUnit of measurement in ERP
Note
  • It is required to provide MaterialNo OR ProductNo, but not both at the same time.
  • If SubstitutedRawMaterial is true, it is necessary to provide SubstitutedMaterialNo or SubstitutedProductNo and SubstitutedPercentage.

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
RawMaterialCodeIntegerYesInternal 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​

CodeMessage
ARM‑001The Material Number [value sent in request] does not exist in the Recipe (Raw Material) [value sent in request]!
ARM‑002You cannot provide Material and Product at the same time. Provide a Material or a Product!
ARM‑003It 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 TypeExample URL
POST{{url_base}}/PostDeleteRawMaterial
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteRawMaterial"

Input Parameters​

ParameterTypeRequiredDescription
MainProductNoString(25)YesExternal code of the main product
RecipeNoString(25)YesExternal code of the raw material recipe
BranchNoString(25)YesExternal code of the branch

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard 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​

CodeMessage
DRM‑001Raw material does not exist!
DRM‑002The Raw Material has already been used in a lot and does not allow deletion!
DRM‑003The 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 TypeExample URL
POST{{url_base}}/PostDeleteRawMaterialItem
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteRawMaterialItem"

Input Parameters​

ParameterTypeRequiredDescription
MainProductNoString(25)YesExternal code of the main product
RecipeNoString(25)YesExternal code of the raw material recipe
BranchNoString(25)YesExternal code of the branch
MaterialNoString(25)NoExternal code of the material
ProductNoString(25)NoExternal code of the product
Note
  • It is required to provide MaterialNo OR ProductNo to identify the item to be deleted.

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard 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
}
}