Bug: PATCH /v1.0/warehouseItems/{id}: reservedQuantity ignored

Marco Nguitragool, modified 4 Days ago.

Bug: PATCH /v1.0/warehouseItems/{id}: reservedQuantity ignored

New Member Posts: 6 Join Date: 9/13/24 Recent Posts

Hello *,

here's how to reproduce the bug:

1. Go to your liferay-instance and log in.

2. Open the "Liferay Commerce Admin Inventory API", i.e. https://HOST/liferay/o/api?endpoint=https://HOST/liferay/o/headless-commerce-admin-inventory/v1.0/openapi.json

3. Get a valid warehouse-item, e.g. by first querying your warehouses and then the items of one of these warehouses. For my example, I have this warehouse-item:

{
    "externalReferenceCode": "52435fdc-f94a-ec13-765e-3933eb3630c0",
    "id": 40958,
    "quantity": 94,
    "reservedQuantity": 10,
    "sku": "CABUT310",
    "unitOfMeasureKey": "",
    "warehouseExternalReferenceCode": "e1409d48-3439-89f6-31ee-89ca317d85c7",
    "warehouseId": 34549
}

4. Copy+paste this JSON into the request-body of "PATCH /v1.0/warehouseItems/{id}" and then change the quantity as well as the reservedQuantity, e.g. like this:

{
    "externalReferenceCode": "52435fdc-f94a-ec13-765e-3933eb3630c0",
    "id": 40958,
    "quantity": 92,
    "reservedQuantity": 12,
    "sku": "CABUT310",
    "unitOfMeasureKey": "",
    "warehouseExternalReferenceCode": "e1409d48-3439-89f6-31ee-89ca317d85c7",
    "warehouseId": 34549
}

Here, I changed the quantity from 94 to 92 and the reservedQuantity from 10 to 12.

5. Click "Execute". You should receive a success (HTTP 200).

6. Query the warehouse-item again. FAIL: The quantity was updated correctly, but the reservedQuantity was not updated!

Just for the record: I also tried to update only the reservedQuantity (leaving everything else unchanged) and I also tried reducing the JSON to only what I wanted to update and it all didn't work.

Please fix this bug as soon as possible. It seems it's currently not possible at all to change the reservedQuantity via RESTful API.

In case you have questions, please don't hesitate to ask here or contact me via e-mail.

Best regards, Marco :-)

Community
Company
Feedback