statisicGroup data returned by dailyFinancials bug?

I'm having an issue with the data returned by the dailyFinancials endpoint, e.g. for this call:
The salesLines items normally include a 'categories' field that contains the Statistic Group classifications for the item in the transaction, e.g.
"categories": [{"category": "SomeStatisticGroupName1", "value": "SomeStatisticGroupValue"}, {"category": "SomeStatisticGroupName2", "value": "SomeOtherStatisticGroupValue"}, ...]
However, occasionally, the categories field is missing and instead the data appears in a "statisticGroup" field like this:
"statisticGroup": "[{\"category\":\"SomeStatisticGroupName\",\"value\":\"SomeOtherStatisticGroupValue\"}]
I have noticed that for the transactions in question, these are sales.type VOID and are associated with a infrequently occurring deviceName, in this case "BackOffice"
Is this behaviour expected? It creates difficulty parsing the JSON
7 comments
Hi @mhc,
Thank you for contacting us.
Can you provide me the businessLocationID?
Yes, one of our locations is 667583946686466
Hi, on 2021-12-06 you will only find this data issue on business location id 667583946686627, e.g. salesLine id S133548.316
Hi @mhc,
I see, this is weird. I need to check this with our devs. When I got something back I'll let you know.
Hi guys,
This is what I got back from our devs.
The categories array is returned only for transactions created on v3 and above devices. If a transaction is created in the Back Office, then my guess it's that it is not considered a "real" device and there is no version number for it, so the fallback response is to return the statisticGroup field instead.
I hope this helps.
Hi Lucien,
I appreciate that the categories array in the sales data is the item reference data as existed at the time of the transaction, but the format of item reference data shouldn't depend on the device used to get the transaction.
Perhaps this wouldn't be such a serious problem if the Items api returned the categories array. It seems to be impossible to get the current statistic group information for an item from the API.
Could you please create a request to fix this issue with the api?
Best regards,
Mike
Hi Mike,
I will discuss this internally and will create a report for it.