Does anyone know why the field `totalQuantityOnHan...
# suitetalkapi
a
Does anyone know why the field
totalQuantityOnHand
would not be included on the response when querying an item via the REST API? According to the docs that field should be there: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2020.2/index.html#/definitions/inventoryItem
w
Looks like the API name is QuantityOnHand
a
I'm not getting any quantity fields...
Actually I wonder if there is another permission related to inventory/location management I missed which is causing these fields to be excluded
w
I suspect it may be some permission
agreed
I'm not getting failure on Select QuantityOnHand FROM Item, but i'm not getting it in the response ~ likely a permission
Permissions are sooo hard to diagnose and identify - lmk if you find their documentation on this, interested as well
a
I know! I have seen so many different types of behavior due to permissions
w
seriously. can't get amountpaid on invoice through api currently
Especially strange is that I can query something through the rest API, but it won't appear for the same login token in the soap api
even though it appears in the soap api documentation
a
@tdietrich Any thoughts on this one?
I'm just randomly adding permissions hoping to hit the right one. Is there a more systematic way to approach this?
t
@Aaron Lozier "TotalQuantityOnHand" is only available if the account has Multi-Location Inventory enabled. Could that be what you're running into?
a
I do... I also just found out that I can see the field with a sql query, e.g.
SELECT Item.id, Item.totalquantityonhand FROM Item WHERE id = xxx
But I don't get it from the resource api call, e.g.
record/v1/inventoryItem/xxx?expandSubResources=true
. I also don't see the
locations
reference field which is supposed to be in the response.... Since I can see the field in the SQL query I suppose it is not permissions after all, but I don't know what else it could be
t
I avoid SuiteTalk REST as much as I can.
Are you only using it to get data? Or are you adding, updating, etc?
a
In this instance, just getting data. That's a bummer - the REST API has been great to me up to this point
But I am sure I can switch over to the SQL queries since I can see the data I need there
w
@Aaron Lozier An old thread - but something that helped me, was, asking if any field that was no returning through the rest api might be a summary. Although summary fields do appear in the documentation, the rest api doesn't support many of them. For example, amount paid, discounttotal on invoice, can't be retrieved directly from invoice, but must be re-calculated using payment and invoice item child records.
👍 1