Trying to understand 2 of the inventory apis (CHANGE: /v2/inventory/changes/batch-retrieve, and COUNT: /v2/inventory/counts/batch-retrieve)
In a simple test, I have a single item where I did a Stock Receive of 2 back in February (in the square web site). There have been no actions on this item since it was received. Apis return the following dates for that 1 item…
/v2/inventory/counts/batch-retrieve
“calculated_at”: “2023-02-24T16:04:07.999Z”
/v2/inventory/changes/batch-retrieve
“occurred_at”: “2023-02-24T16:04:07.867Z”,
“created_at”: “2023-02-24T16:04:07.998Z”,
Today on the square web site, I went into Inventory Management → History and updated that record from Feb and changed the quantity from 2 to 3. (I understand that this is not ideal, but Square allows it and as a developer who wants to sync changes, I should be able to catch it).
After doing this, the counts api updated the calculated_at date to today’s date. …
/v2/inventory/counts/batch-retrieve
“calculated_at”: “2023-05-05T02:53:59.338Z”
There were no changes to the change api dates…
/v2/inventory/changes/batch-retrieve
“occurred_at”: “2023-02-24T16:04:07.867Z”,
“created_at”: “2023-02-24T16:04:07.998Z”,
The change api (/v2/inventory/changes/batch-retrieve) for the updated_after filter says “The filter to return results with their calculated_at
value after the given time”. When I run that api for the above object and and include an updated after filter with a time earlier than today (2023-05-01T16:04:07.998Z), it gives no results. I believe the documentation is incorrect is saying it is filtering based on the ‘calculate_at’ value. More importantly, I don’t see how I can accurately sync from this api if I can’t depend on changes like this being reported.
Thoughts?
How do I go about reporting what I believe to be incorrect documentation to square?