What exactly does "quantity" in inventory changes mean?

In the Inventory Changes response object, there is a field called quantity. For instance, the object could look like:
from_state=IN_STOCK
to_state=SOLD
quantity=1

or it could be a PHYSICAL_COUNT type, and look like this:
state=IN_STOCK
quantity=-9

Does quantity refer remaining number of items, or the CHANGE to the most recent inventory count (esp. ADJUSTMENT vs. PHYSICAL_COUNT)? If I’m trying to reconstruct a history of items, how should I know when to add or subtract?

I believe for Adjustments, quantity represents the number that changed in this specific adjustment. i.e if it was from IN_STOCK to SOLD and quantity=5, then that means this particular adjustment had 5 of these items that were sold (from in stock).

For Physical Counts, I believe quantity represents the literal physical count for the particular count.

does that mean PHYSICAL_COUNT “resets” the inventory to the number (AKA quantity is an absolute number), whereas adjustments are relative to the current count?

furthermore, whether an adjustment increments or decrements the inventory count would need to be inferred from the TO_STATE and FROM_STATE.

For instance, going from in stock -> sold is decrement, whereas going from none -> in stock is an increment.

Other states include:

  • RETURNED_BY_CUSTOMER
  • RESERVED_FOR_SALE
  • SOLD_ONLINE

Yep, PHYSICAL_COUNT will always reset the entire number (as you’re saying I counted this much in the inventory). ADJUSTMENT will increment or decrement to the existing total, and yes, inferred from the states.

Thank you! is there any documentation on how exactly inventory count is computed, based off these states (I couldn’t find it)? below are a few state changes, and my inference on whether they increment or decrement:

  [-] RESERVED_FOR_SALE-SOLD
  [-] SOLD-NONE
  [-] IN_STOCK-SOLD
  [+] SOLD-RETURNED_BY_CUSTOMER
  [+] RESERVED_FOR_SALE-IN_STOCK
  [-] RETURNED_BY_CUSTOMER-NONE

  [-] IN_STOCK-RESERVED_FOR_SALE
  [+] ORDERED_FROM_VENDOR-IN_STOCK
  [-] ORDERED_FROM_VENDOR-WASTE
  [+] SOLD-IN_STOCK
  [+] NONE-ORDERED_FROM_VENDOR
  [+] NONE-IN_STOCK
  [+] RETURNED_BY_CUSTOMER-IN_STOCK
  [-] ORDERED_FROM_VENDOR-NONE
  [-] IN_STOCK-WASTE
  [-] IN_STOCK-NONE

These docs actually explain this in detail:

The key thing to understand is that inventory adjustments are handled by moving quantities of item variations at a given location from one state to another rather than assigning and decrementing a single quantity.