Skip to main content

Products

The PostAddProduct endpoint is responsible for registering a new product in the MIMS system. The registration can be viewed on screens CAD022 and CAD223.


How to register a product

HTTP POST Request

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

Input Parameters

ParameterTypeRequiredDescription
ProductNoString(25)YesExternal code of the product
NameString(60)YesProduct description
ReducedNameString(28)YesReduced product description
ProductionCodeString(10)NoProduct code in production
MaterialNoString(25)YesExternal code of the material
PackageNoString(25)YesExternal code of the package
FamilyNoString(25)YesExternal code of the product family
BrandNoString(25)YesExternal code of the brand
AnimalTypeNoString(25)YesExternal code of the animal type
IntegrationNoString(25)NoProduct integration code
UnitMeasurementNoString(25)NoExternal code of the piece unit of measurement
BillingUnitMeasurementNoString(25)NoExternal code of the billing unit of measurement
ValidityRuleNoString(25)NoExternal code of the validity rule
LabelTemplateCodeIntegerNoLabel template
PreIdentificationLabel
TemplateCode
IntegerNoPre-Identification label template
PrimaryLabelTemplateCodeIntegerNoPrimary label template
ConditionConditionProductYesEnumerator with possible values for Product Condition: cdFresh (Fresh), cdDeepChill (Chilled) or cdFrozen (Frozen)
SpeciesSpeciesProductYesEnumerator with possible values for Product Species: spcWhole (Whole), spcCut (Cut), spcGiblets (Giblets), spcByProduct (By-Product) or spcOther (Other)
RawMaterialStateRawMaterialStateProductYesEnumerator with possible values for Product State: stInNatura (In Natura) or stSazonado (Seasoned)
EAN13String(13)NoEAN 13 code
EAN14String(14)NoEAN 14 code
MaxTolerancePercentageFloatNoMaximum tolerance percentage
MinTolerancePercentageFloatNoMinimum tolerance percentage
AnimalsInPackageQtyIntegerNoQuantity of animals in package
ProductInPackageQtyIntegerNoQuantity of products in package
MaximumCapacityFloatNoMaximum Capacity
AverageCapacityFloatNoAverage Capacity
MinimumCapacityFloatNoMinimum Capacity
StandardCapacityFloatNoStandard Capacity
ProductBranchListProductBranchListYesObject containing product information by branch
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists
Note
  • In the parameters LabelTemplateCode, PreIdentificationLabelTemplateCode and PrimaryLabelTemplateCode, we validate if the passed value is greater than 0 and check the existence only of labels that have a code greater than or equal to 1000, as these are the labels that have a record in the "VW_ETIQUETA" view. If the label is not registered, we generate the exception "The label "[value sent in request]" provided was not found!"
  • In the parameters FamilyNo, BrandNo and AnimalTypeNo, when the request is a product modification and the provided value equals the standard integration text (defined in the StandardIntegration variable of the INI file), the system does not update the value of these fields. In these cases, the existing value in the product registration will be maintained.
  • Make sure that the parameters ProductNo, MaterialNo, PackageNo, FamilyNo, BrandNo, AnimalTypeNo and other external codes are valid and not duplicated in the MIMS system.

📝 ProductBranchList Object

The ProductBranchList object represents a list of product information by branch.

Input Parameters

ParametersTypeRequiredDescription
BranchNoString(25)YesExternal code of the branch
NameString(120)NoProduct description in the branch
ProductionGroupNoString(25)NoExternal code of the production group
WarehouseNoString(25)NoExternal code of the warehouse
ClassifierGridNoString(25)NoExternal code of the classifier grid
StructureNoString(25)NoExternal code of the analytical structure
UnitMeasurementNoString(25)NoExternal code of the piece unit of measurement
UnitMeasurementIndividual
UnitNo
String(25)NoExternal code of the individual unit unit of measurement
StockSequestrationDaysIntegerNoStock sequestration days
ToleranceStandardDateDaysIntegerNoStandard date tolerance days
DefaultQuantityinPalletIntegerNoDefault quantity of packages for pallet assembly
UnidPartQtyIntegerNoQuantity of pieces per unit
AnimalsInPackageQtyIntegerNoQuantity of animals in package
ProductInPackageQtyIntegerNoQuantity of products in package
MinRawMaterialPercentageFloatNoMinimum raw material product percentage
WeightToleranceUpon
GroupedWeighingPercentage
FloatNoWeight tolerance percentage in Grouped Weighing
MaxTolerancePercentageFloatNoMaximum weight tolerance percentage
MinTolerancePercentageFloatNoMinimum weight tolerance percentage
PreIdentificationLabel
TemplateCode
IntegerNoPre-Identification Label Template
PrimaryLabelTemplateCodeIntegerNoPrimary Label Template
RegisterAgricultureMinistryCodeString(14)YesAgriculture Ministry registration number
AgricultureMinistryNameString(180)YesDescription in Agriculture Ministry
IdentifiesTypeIdentifiesTypeNoEnumerator with possible values for Product Identification Type: itOpticalReading (Optical Reading) or itManualTyping (Manual Typing)
DispatchTypeDispatchTypeYesEnumerator with possible values for Product Dispatch Type: dtOpticalReading (Optical Reading), dtManualDispatching (Manual Dispatch), dtAutomaticDispatching (Automatic Dispatch) or dtInBulk (In Bulk)
OwnProductionOwnProductionYesEnumerator with possible values for Own Production: opYes (Yes), opNo (No) or opBoth (Both)
IsInactiveBooleanNoFlag indicating that the product is inactive
IsTunnelControlDisabledBooleanNoFlag indicating that Tunnel Control is Inactive
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists
Note
  • In the parameters PreIdentificationLabelTemplateCode and PrimaryLabelTemplateCode, we validate if the passed value is greater than 0 and check the existence only of labels that have a code greater than or equal to 1000, as these are the labels that have a record in the "VW_ETIQUETA" view. If the label is not registered, we generate the exception "The label "[value sent in request]" provided was not found!"
  • In the parameters ClassifierGridNo, WarehouseNo and ProductionGroupNo, when the request is a product modification and the provided value equals the standard integration text (defined in the StandardIntegration variable of the INI file), the system does not update the value of these fields. In these cases, the existing value in the product registration will be maintained.

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
ProductCodeIntegerYesInternal product code generated in the MIMS system

Request Example

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddProduct"' \
--header 'Content-Type: application/json' \
--data '{
"ProductNo": "PROD001",
"Name": "Nome do produto Teste",
"ReducedName": "Produto Teste",
"ProductionCode": "FRG001",
"MaterialNo": "MATE123",
"PackageNo": "EMBA123",
"FamilyNo": "FAMI123",
"BrandNo": "MARC123",
"AnimalTypeNo": "TPAVE123",
"IntegrationNo": "INT123456",
"UnitMeasurementNo": "UN",
"BillingUnitMeasurementNo": "UN",
"ValidityRuleNo": "VALI123",
"LabelTemplateCode": 5011,
"PreIdentificationLabelTemplateCode": 5014,
"PrimaryLabelTemplateCode": 5015,
"Condition": "cdFresh",
"Species": "spcCut",
"RawMaterialState": "stInNatura",
"EAN13": "1234567899874",
"EAN14": "12345678998745",
"MaxTolerancePercentage": 85,
"MinTolerancePercentage": 60,
"AnimalsInPackageQty": 10,
"ProductInPackageQty": 30,
"MaximumCapacity": 100,
"AverageCapacity": 50,
"MinimumCapacity": 20,
"StandardCapacity": 60,
"OverwriteIfExists": true,
"ProductBranchList":[
{
"BranchNo": "BR001",
"Name": "Produto Exemplo - Filial",
"ProductionGroupNo": "GRP001",
"ClassifierGridNo": "CLF001",
"WarehouseNo": "WH001",
"StructureNo": "STR001",
"UnitMeasurementNo": "UND001",
"UnitMeasurementIndividualUnitNo": "UNDIND001",
"StockSequestrationDays": 7,
"ToleranceStandardDateDays": 3,
"DefaultQuantityinPallet": 20,
"UnidPartQty": 10,
"AnimalsInPackageQty": 5,
"ProductInPackageQty": 50,
"MinRawMaterialPercentage": 1.5,
"WeightToleranceUponGroupedWeighingPercentage": 2.0,
"MaxTolerancePercentage": 4.0,
"MinTolerancePercentage": 1.0,
"PreIdentificationLabelTemplateCode": 1001,
"PrimaryLabelTemplateCode": 1002,
"RegisterAgricultureMinistryCode": "REG1234567890",
"AgricultureMinistryName": "Ministério da Agricultura - Unidade Exemplo",
"IdentifiesType": "itOpticalReading",
"DispatchType": "dtAutomaticDispatching",
"OwnProduction": "opYes",
"IsInactive": false,
"IsTunnelControlDisabled": false,
"OverwriteIfExists": true
}
]
}'

Response Example

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"ProductCode": 789
}

🐞 Possible Errors

CodeMessage
APR‑001The provided "External Product Code (ProductNo)" parameter already exists!
APR‑002The provided "LabelTemplateCode" label was not found!
APR‑002The provided "PreIdentificationLabelTemplateCode" label was not found!
APR‑002The provided "PrimaryLabelTemplateCode" label was not found!
APR‑002The provided "PreIdentificationLabelTemplateCode" label was not found!
APR‑003The "Standard Capacity (StandardCapacity)" parameter and the "Average Capacity (AverageCapacity)" parameter were not provided. Provide at least one!
APR‑004The Package "Standard Capacity (StandardCapacity)" parameter cannot be less than the "Minimum Capacity (MinimumCapacity)" parameter!
APR‑005The Package "Average Capacity (AverageCapacity)" parameter cannot be less than the "Minimum Capacity (MinimumCapacity)" parameter!
APR‑006The Package "Maximum Capacity (MaximumCapacity)" parameter cannot be less than the "Minimum Capacity (MinimumCapacity)" parameter!
APR‑007The Package "Standard Capacity (StandardCapacity)" parameter cannot be greater than the "Maximum Capacity (MaximumCapacity)" parameter!
APR‑008The Package "Average Capacity (AverageCapacity)" parameter cannot be greater than the "Maximum Capacity (MaximumCapacity)" parameter!
APR‑009The Package "Minimum Capacity (MinimumCapacity)" parameter cannot be greater than the "Maximum Capacity (MaximumCapacity)" parameter!
APR‑010The "Minimum Tolerance (MinimumTolerancePercentage)" parameter cannot be greater than the "Maximum Tolerance (MaximumTolerancePercentage)" parameter!
APR‑011The "Production Code (ProductionCode)" parameter exceeded the maximum size of "[Maximum number of characters allowed for the product production code]" characters!
APR‑012The "Production Code (ProductionCode)" parameter is already linked to another product!
APR‑013There is a product registration with package ([value sent in request]) and material ([value sent in request]) linked to another external product code ([found external product code])!