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 Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddPackage |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddPackage" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| PackageNo | String(25) | Yes | External code of the package |
| PackageName | String(40) | Yes | Package description |
| ShortName | String(15) | Yes | Short description of the package |
| UnitMeasurement | String(2) | Yes | Package unit of measurement |
| PackageTypeNo | String(25) | Yes | External code of the package type |
| PackageClassification | PackageClassification | Yes | Enumerator with possible values for Package Classification/Species: pcNotAssigned (Not Assigned), pcPackaging (Packaging), pcBag (Bag), pcBasePackaging (Base Packaging), pcPallet (Pallet) or pcCage (Cage) |
| Tare | Float | No | Package tare |
| TareUnitMeasurement | String(2) | Yes | Package tare unit of measurement |
| PackageLength | Float | No | Package length |
| PackageHeight | Float | No | Package height |
| PackageWidth | Float | No | Package width |
| DimensionUnitMeasurement | String(2) | Yes | Package dimensions unit of measurement |
| PackageMeasurementList | PackageMeasurementList | No | Object with Package Measurement information |
| PackageVariationList | PackageVariationList | No | Object with Package Variation information |
| IsActive | Boolean | No | Flag indicating if the package is active or not |
| OverwriteIfExists | Boolean | No | Flag to overwrite if the package already exists |
Note
- The
PackageTypeNoparameter, 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
Parameters Type Required Description BranchNo String(25) Yes External branch code Tare Float Yes Package tare PackageMeasurementValue Float No Package value PackageMeasurementNotes String(2000) No Notes regarding package measurements IsControlled Boolean No Flag indicating if the package is controlled or not
📝 PackageVariationList Object
The PackageVariationList object represents a list of Package Variation information.
Input Parameters
Parameter Type Required Description PackageVariationNo String(15) Yes External code of the variation VariationName String(40) Yes Package variation description IdentificationCode Integer Yes Identification code PackageVariationClassification PackageClassification No Enumerator with possible values for Package Classification/Species: pcNotAssigned(Not Assigned),pcPackaging(Packaging),pcBag(Bag),pcBasePackaging(Base Packaging),pcPallet(Pallet) orpcCage(Cage)Tare Float Yes Package variation tare TareUnitMeasurement String(2) Yes Package variation tare unit of measurement VariationLength Float Yes Package variation length VariationHeight Float Yes Package variation height VariationWidth Float Yes Package variation width DimensionUnitMeasurement String(2) Yes Package variation dimensions unit of measurement ReweighOverToleranceWeight Float No Weight above tolerance in reweighings ReweighUnderToleranceWeight Float No Weight below tolerance in reweighings ReweighOverTolerancePercentage Float No Percentage above tolerance in reweighings ReweighUnderTolerancePercentage Float No Percentage below tolerance in reweighings IsStandardVariation Boolean No Flag indicating if this variation is the standard package variation IsFinalVariation Boolean No Flag indicating if this variation is the final variation in variation change maintenance
Note
- If
ReweighOverToleranceWeightis provided, it is also necessary to provideReweighUnderToleranceWeight, and vice versa. - If
ReweighOverTolerancePercentageis provided, it is also necessary to provideReweighUnderTolerancePercentage, and vice versa.
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| PackageCode | Integer | Yes | Internal 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
| Code | Message |
|---|---|
| APK‑001 | The informed package "PackageNo" already exists! |
| APK‑002 | There are package variations whose classification does not correspond to the informed classification ([value sent in request]) for the package! |
| APK‑003 | The informed classification for this package ([value sent in request]) differs from the existing variation classification! |
| APK‑004 | If the "ReweighOverToleranceWeight" parameter is provided, the "ReweighUnderToleranceWeight" parameter must also be provided, and vice versa! |
| APK‑005 | If the "ReweighOverTolerancePercentage" parameter is provided, the "ReweighUnderTolerancePercentage" parameter must also be provided, and vice versa! |
| APK‑006 | This package has already been used in palletization. It is not allowed to change the previously defined classification (pcPallet)! |
| APK‑007 | This package is linked to product ([product production code]), which is active. The package cannot be set as inactive! |
| APK‑008 | The identification code ([value sent in request]) provided in the IdentificationCode parameter at index [[index code]] is already associated with another package! |