Skip to main content

Materials

The PostAddMaterial endpoint is responsible for registering a new material in the MIMS system. The registration can be viewed on screen CAD021.


How to register a material

HTTP POST Request

Request TypeExample URL
POST{{url_base}}/PostAddMaterial
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterial"

Input Parameters

ParameterTypeRequiredDescription
BranchNoString(25)YesExternal branch code
MaterialNoString(25)YesExternal material code
MaterialNameString(60)YesMaterial name
ShortNameString(20)NoShort material name
UnitMeasurementString(2)YesMaterial unit of measurement
MaterialTypeNoString(25)YesExternal material type code
CategoryNoString(25)YesExternal material category code
SubcategoryNoString(25)YesExternal material subcategory code
GroupNoString(25)YesExternal material group code
OriginNoString(25)YesExternal material origin code
ClassificationNoString(25)YesExternal material classification code
TreatmentNoString(25)YesExternal material treatment code
WarehouseNoString(25)YesExternal material warehouse code
AnimalTypeNoString(25)NoExternal bird type code
GrossWeightFloatNoMaterial gross weight
NetWeightFloatNoMaterial net weight
RegisterDateDataHoraYesRecord inclusion date
UpdateDateDataHoraNoRecord update date
EANString(26)NoMaterial EAN code
LOFBooleanNoLOF mandatory
LastBuyDateDataHoraNoMaterial last purchase date
ComplementaryTypeString(2)NoComplementary type
ANVISAMedicineCodeString(13)NoANVISA medicine code
ANVISAExemptionReasonString(255)NoANVISA exemption reason
ObservationsString(2000)NoObservations
MaterialLengthFloatNoMaterial length
MaterialHeightFloatNoMaterial height
MaterialWidthFloatNoMaterial width
MovingAverageCostFloatNoMoving Average Cost
ValidityDaysIntegerNoValidity in days
MaximumPriceFloatNoMaximum consumer price
AveragePriceFloatNoReplacement price
LastPriceFloatNoLast price
ProducedBooleanNoFlag indicating whether the material is produced or not
AcquiredBooleanNoFlag indicating whether the material is acquired or not
InventoryBooleanNoFlag indicating whether Material stock is controlled or not
ShelfLifeBooleanNoFlag indicating whether Material validity is controlled or not
AnimalBooleanNoFlag indicating whether the Material is a live Animal or not
WeightEntryBooleanNoFlag indicating whether the Material is weighed at entry or not
ActiveBooleanNoFlag indicating whether the material is Active or not
TemporarilyBlockBooleanNoFlag indicating whether the Material is temporarily blocked
TraceabilityBooleanNoFlag indicating whether Secondary Material traceability is controlled
TraceabilityLotTraceabilityLotTypeNoEnumerator with possible values for Material Traceability Lot Type: ttSupplierLot (Supplier Lot), ttClientLot (Client Lot) or ttBothLot (Both)
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists
Observation
  • For parameters MaterialTypeNo, CategoryNo, SubcategoryNo, GroupNo, OriginNo, ClassificationNo, TreatmentNo, WarehouseNo and AnimalTypeNo, when the request is a material change and the informed value is equal to the standard integration text (defined in the StandardIntegration variable in the INI file), the system does not update the value of these fields. In these cases, the value already existing in the material registration will be maintained.

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
MaterialCodeIntegerYesInternal Material code generated in the MIMS system

Request Example

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterial"' \
--header 'Content-Type: application/json' \
--data '{
"BranchNo": "101",
"MaterialNo": "1",
"MaterialName": "Example Material",
"ShortName": "Mat Test",
"UnitMeasurement": "UN",
"MaterialTypeNo": "MATT5874",
"CategoryNo": "INT",
"SubcategoryNo": "INT",
"GroupNo": "INT",
"OriginNo": "INT",
"ClassificationNo": "INT",
"TreatmentNo": "INT",
"WarehouseNo": "INT",
"Produced": true,
"Acquired": true,
"Inventory": true,
"ShelfLife": true,
"GrossWeight": 12.5,
"NetWeight": 10.0,
"Animal": true,
"WeightEntry": true,
"Active": true,
"AnimalTypeNo": "INT",
"Traceability": true,
"TraceabilityLot": "ttSupplierLot",
"RegisterDate": "2023-11-10",
"UpdateDate": "2023-11-16",
"TemporarilyBlock": false,
"EAN": "7891234567890",
"LOF": false,
"LastBuyDate": "2023-11-10",
"ComplementaryType": "02",
"ANVISAMedicineCode": "123456789",
"ANVISAExemptionReason": "ANVISA Exemption Reason Test",
"Observations": "Test Observation",
"MaterialLength": 10,
"MaterialHeight": 20,
"MaterialWidth": 30,
"MovingAverageCost": 35.50,
"ValidityDays": 40,
"MaximumPrice": 45.60,
"AveragePrice": 50.70,
"LastPrice": 60.80,
"OverwriteIfExists": true
}'

Response Example

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"MaterialCode": 1023
}

🐞 Possible Errors

CodeMessage
AMA‑001The informed "MaterialNo" already exists!