Menu
Feedback
Start here

Known issues

Known issues
Inventory divergence in UI x API due to warehouse id being case sensitive
Logistics
•
ID: 346163
Backlog
Published on6/27/2022
•
Last updated on11/25/2022
2 min read

Summary

As actually the same API creates and updates the warehouse (Create/update warehouse: POST https://{accountName}.{environment}.com.br/api/logistics/pvt/configuration/warehouses), Logistics identifies by the id what action should be taken, and as the id is case sensitive, if the intention would be to update de id "TEST" but id "test" is entered, a new warehouse is created, but the inventory is replicated for both because the inventory is case insensitive.

Simulation

Create an inventory with capital id, either by UI or API, for example:

POST https://{accountName}.{environment}.com.br/api/logistics/pvt/configuration/warehouses{ "id": "TEST", "name": "TEST", "warehouseDocks": [{ "dockId": "dock-test", "time": "05:00:00", "cost": 0.99 }]}

Update the inventory of a SKU for this new warehouse (id "TEST"), either by UI or API, for example:

PUT https://{accountName}.{environment}.com.br/api/logistics/pvt/inventory/skus/{skuId}/warehouses/{warehouseId}{ "quantity": 122}

Update the loading dock time and cost by API with lowercase id "test", for example:

POST https://{accountName}.{environment}.com.br/api/logistics/pvt/configuration/warehouses{ "id": "test", "name": "TEST", "warehouseDocks": [{ "dockId": "dock-test", "time": "08:00:00", "cost": 0.00 }]}

Although the id is the same, being case sensitive will cause another warehouse to be created:

{"base64":"  ","img":{"width":518,"height":119,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":11550,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_1.png"}}

However, for the inventory UI, the id is not case sensitive, so for both inventories the same information will be shown:

{"base64":"  ","img":{"width":1596,"height":213,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":31551,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_2.png"}}

But checking on the API, each inventory is separated, as expected:

{"base64":"  ","img":{"width":248,"height":427,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":28542,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_3.png"}}

And then, when deleting the first warehouse record (with capital letter "TEST"), the inventory information in the UI keeps showing that quantity available for the id "test" inventory (lowercase), where it is actually 0:

{"base64":"  ","img":{"width":1598,"height":153,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":24909,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_4.png"}}
{"base64":"  ","img":{"width":251,"height":304,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":17517,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_5.png"}}

And as a consequence of this, the SKU indexing gets 0 quantity, and it shows out of stock in the checkout:

{"base64":"  ","img":{"width":370,"height":124,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":10961,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_6.png"}}
{"base64":"  ","img":{"width":878,"height":491,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":56541,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Logistics/inventory-divergence-in-ui-x-api-due-to-warehouse-id-being-case-sensitive_7.png"}}

Workaround

As a workaround, you can update the inventory of the specific warehouse, and if possible, not have the same id with case insensitive ("TEST" x "test").

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
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 VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback