Menu
Feedback
Start here
Tutorials
Developer portal

Known Issues
Support Rules
Troubleshooting

Frequently Asked Questions
Announcements
Known issues
Kit Weight can be Overritten by API/Webservice
Kit Weight can be Overritten by API/Webservice
ID: 429993
No Fix
Published on 6/28/2022
Last update on 2/16/2024

Summary

Currently, it is set in our catalog business rules that a KIT SKU's freight weight should be defined by the sum of its components - https://help.vtex.com/en/tutorial/cadastrando-kit--tutorials_215

{"base64":"  ","img":{"width":590,"height":138,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":13841,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/known-issues/Catalog/kit-weight-can-be-overritten-by-apiwebservice_1.png"}}

However, it is currently possible to overwrite this weight calculation via API and or webservice where the value set is the one directly sent in the payload, not considering any component weightage.

Simulation

  1. Create an SKU KIT and components for it;

For example, the component's original weight can be 100g and the kit is composed of 6 items of this unique component. Consequently, its final weight should be 600g:

Even the input box is set as a readonly.

  1. However, if in the SKUKIT structure, that is, the form that composes the kit's information, I fetch this data via API or webservice, such as:

curl --location --request GET 'https://merch.vtexcommercestable.com.br/api/catalog/pvt/stockkeepingunit/310118469' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'VtexIdclientAutCookie: ' \ --header 'Cookie: janus_sid=361dacc3-e2b8-4ee1-8f5b-b2cf0529f39a' \ --data-raw ''

  1. And then directly update the related JSON property, sending it via PUT Method in the payload:

`curl --location --request PUT 'https://catalog.vtexcommercestable.com.br/api/catalog/pvt/stockkeepingunit/?an=' \`
`--header 'Content-Type: application/json' \`
`--header 'Accept: application/json' \`
`--header 'VtexIdclientAutCookie: ' \`
`--header 'Cookie: janus_sid=eee0b24c-f31b-4359-9bbd-5745b5b38d39' \`
`--data-raw '\{`
`    "Id": 310118469,`
`    "ProductId": 35,`
`    "IsActive": true,`
`    "ActivateIfPossible": true,`
`    "Name": "Kit com 6",`
`    "RefId": "000806",`
`    "PackagedHeight": 1.0000,`
`    "PackagedLength": 3.0000,`
`    "PackagedWidth": 2.0000,`
`    "PackagedWeightKg": 0.300,`
`    "Height": null,`
`    "Length": null,`
`    "Width": null,`
`    "WeightKg": null,`
`    "CubicWeight": 0.0013,`
`    "IsKit": true,`
`    "CreationDate": "2021-09-14T09:20:00",`
`    "RewardValue": null,`
`    "EstimatedDateArrival": null,`
`    "ManufacturerCode": "",`
`    "CommercialConditionId": 1,`
`    "MeasurementUnit": "un",`
`    "UnitMultiplier": 1.0000,`
`    "ModalType": null,`
`    "KitItensSellApart": false,`
`    "Videos": []`
`\}'`

The previous value that took into account the component's weight * amount is completely overwritten, consequently generating possible inconsistencies in the freight calculations.

Workaround

Updating the component weights only and letting the application calculate the final kit weight by itself.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback