Skip to main content

Packages

The PostAddPackage endpoint is responsible for registering a new package in the MIMS system. This registration can be viewed on screen CAD016.


How to register a package

HTTP POST Request

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

Input Parameters

ParameterTypeRequiredDescription
PackageNoString(25)YesExternal code of the package
PackageNameString(40)YesPackage description
ShortNameString(15)YesShort description of the package
UnitMeasurementString(2)YesPackage unit of measurement
PackageTypeNoString(25)YesExternal code of the package type
PackageClassificationPackageClassificationYesEnumerator with possible values for Package Classification/Species: pcNotAssigned (Not Assigned), pcPackaging (Packaging), pcBag (Bag), pcBasePackaging (Base Packaging), pcPallet (Pallet) or pcCage (Cage)
TareFloatNoPackage tare
TareUnitMeasurementString(2)YesPackage tare unit of measurement
PackageLengthFloatNoPackage length
PackageHeightFloatNoPackage height
PackageWidthFloatNoPackage width
DimensionUnitMeasurementString(2)YesPackage dimensions unit of measurement
PackageMeasurementListPackageMeasurementListNoObject with Package Measurement information
PackageVariationListPackageVariationListNoObject with Package Variation information
IsActiveBooleanNoFlag indicating if the package is active or not
OverwriteIfExistsBooleanNoFlag to overwrite if the package already exists
Note
  • The PackageTypeNo parameter, when the request is a package modification and the provided value equals the standard integration text (information defined in the "PadraoIntegracao" variable in the "GERAL" key of the INI), the system does not update the value of this field. In this case, the existing value in the package registration will be maintained.

📝 PackageMeasurementList Object

The PackageMeasurementList object represents a list of Package Measurement information.

Input Parameters

ParametersTypeRequiredDescription
BranchNoString(25)YesExternal branch code
TareFloatYesPackage tare
PackageMeasurementValueFloatNoPackage value
PackageMeasurementNotesString(2000)NoNotes regarding package measurements
IsControlledBooleanNoFlag indicating if the package is controlled or not

📝 PackageVariationList Object

The PackageVariationList object represents a list of Package Variation information.

Input Parameters

ParameterTypeRequiredDescription
PackageVariationNoString(15)YesExternal code of the variation
VariationNameString(40)YesPackage variation description
IdentificationCodeIntegerYesIdentification code
PackageVariationClassificationPackageClassificationNoEnumerator with possible values for Package Classification/Species: pcNotAssigned (Not Assigned), pcPackaging (Packaging), pcBag (Bag), pcBasePackaging (Base Packaging), pcPallet (Pallet) or pcCage (Cage)
TareFloatYesPackage variation tare
TareUnitMeasurementString(2)YesPackage variation tare unit of measurement
VariationLengthFloatYesPackage variation length
VariationHeightFloatYesPackage variation height
VariationWidthFloatYesPackage variation width
DimensionUnitMeasurementString(2)YesPackage variation dimensions unit of measurement
ReweighOverToleranceWeightFloatNoWeight above tolerance in reweighings
ReweighUnderToleranceWeightFloatNoWeight below tolerance in reweighings
ReweighOverTolerancePercentageFloatNoPercentage above tolerance in reweighings
ReweighUnderTolerancePercentageFloatNoPercentage below tolerance in reweighings
IsStandardVariationBooleanNoFlag indicating if this variation is the standard package variation
IsFinalVariationBooleanNoFlag indicating if this variation is the final variation in variation change maintenance
Note
  • If ReweighOverToleranceWeight is provided, it is also necessary to provide ReweighUnderToleranceWeight, and vice versa.
  • If ReweighOverTolerancePercentage is provided, it is also necessary to provide ReweighUnderTolerancePercentage, and vice versa.

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
PackageCodeIntegerYesInternal Package code generated in the MIMS system

Request Example

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddPackage"' \
--header 'Content-Type: application/json' \
--data '{
"PackageNo": "PKG-001-2025",
"PackageName": "Embalagem Padrão",
"ShortName": "Caixa P",
"UnitMeasurement": "UN",
"PackageTypeNo": "TIPOEMBA1",
"PackageClassification": "pcBasePackaging",
"Tare": 2.5,
"TareUnitMeasurement": "KG",
"PackageLength": 30.0,
"PackageHeight": 20.0,
"PackageWidth": 15.0,
"DimensionUnitMeasurement": "UN",
"IsActive": true,
"PackageMeasurementList": [
{
"BranchNo": "101",
"Tare": 2.5,
"PackageMeasurementValue": 100.0,
"PackageMeasurementNotes": "Medição padrão P",
"IsControlled": false
}
],
"PackageVariationList": [
{
"PackageVariationNo": "PKG-001-V1",
"VariationName": "Variação Standard",
"IdentificationCode": 1333,
"PackageVariationClassification": "pcBasePackaging",
"Tare": 3.5,
"TareUnitMeasurement": "KG",
"VariationLength": 31.0,
"VariationHeight": 21.0,
"VariationWidth": 16.0,
"DimensionUnitMeasurement": "UN",
"ReweighOverToleranceWeight": 0.10,
"ReweighUnderToleranceWeight": 0.05,
"ReweighOverTolerancePercentage": 2.0,
"ReweighUnderTolerancePercentage": 2.0,
"IsStandardVariation": true,
"IsFinalVariation": false
}
],
"OverwriteIfExists": false
}'

Response Example

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"PackageCode": 26
}

🐞 Possible Errors

CodeMessage
APK‑001The informed package "PackageNo" already exists!
APK‑002There are package variations whose classification does not correspond to the informed classification ([value sent in request]) for the package!
APK‑003The informed classification for this package ([value sent in request]) differs from the existing variation classification!
APK‑004If the "ReweighOverToleranceWeight" parameter is provided, the "ReweighUnderToleranceWeight" parameter must also be provided, and vice versa!
APK‑005If the "ReweighOverTolerancePercentage" parameter is provided, the "ReweighUnderTolerancePercentage" parameter must also be provided, and vice versa!
APK‑006This package has already been used in palletization. It is not allowed to change the previously defined classification (pcPallet)!
APK‑007This package is linked to product ([product production code]), which is active. The package cannot be set as inactive!
APK‑008The identification code ([value sent in request]) provided in the IdentificationCode parameter at index [[index code]] is already associated with another package!