<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Bug: PATCH /v1.0/warehouseItems/{id}: reservedQuantity ignored</title>
  <link rel="self" href="https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123559573" />
  <subtitle>Bug: PATCH /v1.0/warehouseItems/{id}: reservedQuantity ignored</subtitle>
  <id>https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123559573</id>
  <updated>2026-04-17T21:37:24Z</updated>
  <dc:date>2026-04-17T21:37:24Z</dc:date>
  <entry>
    <title>RE: Bug: PATCH /v1.0/warehouseItems/{id}: reservedQuantity ignored</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123580598" />
    <author>
      <name>Marco Nguitragool</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123580598</id>
    <updated>2025-09-01T00:44:37Z</updated>
    <published>2025-08-29T10:40:09Z</published>
    <summary type="html">&lt;p&gt;Related bug: Quantity (and reserved quantity) in RESTful API does not
  support decimal values.&lt;/p&gt;
&lt;p&gt;Go to the &amp;quot;Commerce&amp;quot;-admin and create an entry under
  &amp;quot;Inventory&amp;quot; having a quantity of 5.255 and a reserved
  quantity of 1.128. Then go to
  https://HOST/liferay/o/api?endpoint=https://dragonkingchocolate.com:1443/liferay/o/headless-commerce-admin-inventory/v1.0/openapi.json
  and perform GET&lt;br&gt; /v1.0/warehouses/{id}/warehouseItems -- the
  decimal values are gone.&lt;/p&gt;
&lt;p&gt;The same btw. when you edit the previously stored inventory-item in
  &amp;quot;Commerce&amp;quot; &amp;gt; &amp;quot;Inventory&amp;quot; again: I
  saved quantity = 5.255 and reserved quantity = 1.128, but when editing
  it again, it shows only 5 and 1 (instead of 5.255 and 1.128). This
  sucks. I want to track many items in kg, but often have 0.5 kg or 0.25
  kg going in or out of the inventory. I don't want to track it in g,
  because we have over 1000 kg in stock. In the DB it is clearly a
  BigDecimal, but Liferay sometimes rounds/truncates the values.&lt;/p&gt;</summary>
    <dc:creator>Marco Nguitragool</dc:creator>
    <dc:date>2025-08-29T10:40:09Z</dc:date>
  </entry>
  <entry>
    <title>Bug: PATCH /v1.0/warehouseItems/{id}: reservedQuantity ignored</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123559572" />
    <author>
      <name>Marco Nguitragool</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123559572</id>
    <updated>2025-08-25T16:45:11Z</updated>
    <published>2025-08-24T12:21:33Z</published>
    <summary type="html">&lt;p&gt;Hello *,&lt;/p&gt;
&lt;p&gt;here's how to reproduce the bug:&lt;/p&gt;
&lt;p&gt;1. Go to your liferay-instance and log in.&lt;/p&gt;
&lt;p&gt;2. Open the &amp;quot;Liferay Commerce Admin Inventory API&amp;quot;, i.e. https://HOST/liferay/o/api?endpoint=https://HOST/liferay/o/headless-commerce-admin-inventory/v1.0/openapi.json&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;{
    &amp;quot;externalReferenceCode&amp;quot;: &amp;quot;52435fdc-f94a-ec13-765e-3933eb3630c0&amp;quot;,
    &amp;quot;id&amp;quot;: 40958,
    &amp;quot;quantity&amp;quot;: 94,
    &amp;quot;reservedQuantity&amp;quot;: 10,
    &amp;quot;sku&amp;quot;: &amp;quot;CABUT310&amp;quot;,
    &amp;quot;unitOfMeasureKey&amp;quot;: &amp;quot;&amp;quot;,
    &amp;quot;warehouseExternalReferenceCode&amp;quot;: &amp;quot;e1409d48-3439-89f6-31ee-89ca317d85c7&amp;quot;,
    &amp;quot;warehouseId&amp;quot;: 34549
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;4. Copy+paste this JSON into the request-body of &amp;quot;PATCH
  /v1.0/warehouseItems/{id}&amp;quot; and then change the quantity as well
  as the reservedQuantity, e.g. like this:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;{
    &amp;quot;externalReferenceCode&amp;quot;: &amp;quot;52435fdc-f94a-ec13-765e-3933eb3630c0&amp;quot;,
    &amp;quot;id&amp;quot;: 40958,
    &amp;quot;quantity&amp;quot;: 92,
    &amp;quot;reservedQuantity&amp;quot;: 12,
    &amp;quot;sku&amp;quot;: &amp;quot;CABUT310&amp;quot;,
    &amp;quot;unitOfMeasureKey&amp;quot;: &amp;quot;&amp;quot;,
    &amp;quot;warehouseExternalReferenceCode&amp;quot;: &amp;quot;e1409d48-3439-89f6-31ee-89ca317d85c7&amp;quot;,
    &amp;quot;warehouseId&amp;quot;: 34549
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, I changed the quantity from 94 to 92 and the reservedQuantity
  from 10 to 12.&lt;/p&gt;
&lt;p&gt;5. Click &amp;quot;Execute&amp;quot;. You should receive a success (HTTP 200).&lt;/p&gt;
&lt;p&gt;6. Query the warehouse-item again. &lt;strong&gt;FAIL:&lt;/strong&gt; The
  quantity was updated correctly, but the
  &lt;strong&gt;reservedQuantity&lt;/strong&gt; was &lt;strong&gt;not updated!&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Please fix this bug as soon as possible. It seems it's currently not
  possible at all to change the reservedQuantity via RESTful API.&lt;/p&gt;
&lt;p&gt;In case you have questions, please don't hesitate to ask here or
  contact me via e-mail.&lt;/p&gt;
&lt;p&gt;Best regards, Marco :-)&lt;/p&gt;</summary>
    <dc:creator>Marco Nguitragool</dc:creator>
    <dc:date>2025-08-24T12:21:33Z</dc:date>
  </entry>
</feed>
