Inventory api Issue

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?

What’s your application ID and the catalog_object_id that your seeing this behavior with? :slightly_smiling_face:

application_id: sq0idp-4dEJyJu8EF6ynScarQ0r7Q
catalog_object_id : AHHQVTXFPZNNCKCTWDLL57MR

all on the production environment

Looks like there was actually no change made to the count. The count is still 2 for this item so no change happened which is why you don’t see a change event. :slightly_smiling_face:

Sorry for the delayed response. I misspoke when I said 2 to 3, it was 1 to 2. I have once again changed it from 2 to 3.

/v2/inventory/changes/batch-retrieve

Shows…

"quantity": "3",
        "occurred_at": "2023-02-24T16:04:07.867Z",
        "created_at": "2023-02-24T16:04:07.998Z",

If I run that same api with an updated_after date of “2023-05-01T00:00:00.000Z”, it returns nothing.

I would expect

  1. there to be a calculated_date in the returned results
  2. return that record when it was modified after the updated_after filter

If the above is not the intended result then change the description for the updated_after filter which current reads " The filter to return results with their calculated_at value after the given time as specified in an RFC 3339 timestamp."

Thanks

Any thoughts to my response? Is this a bug? Is there something I am missing?