Invalid item id in Localinventory.Insert

321 views
Skip to first unread message

Gregory Mertens

unread,
Aug 12, 2021, 3:19:06 PM8/12/21
to Google Content API for Shopping
I'm trying to product data and inventory via the API.

I am able to successfully submit product data but when submitting inventory I
 get back errors like: 

Google.Apis.Requests.RequestError [item id] Invalid item id: 2010384 [400] Errors [ Message[[item id] Invalid item id: 2010384] Location[ - ] Reason[invalid] Domain[global] ]

my code:
gService.Localinventory.Insert(localInventory, (ulong) googleAccount.MerchantConfig.MerchantId, variantId.ToString()).Execute();

where localInventory is:
{ "availability": "in stock", "price": { "currency": "USD", "value": "8.98" }, "quantity": 999, "storeCode": "0006" }

I do have a product with id: 2010384
its Status:
  • Free local listings - Disapproved or invalid
I do have a store with code '0006' and it is verified.

Questions
  1. Is that error message saying that the item id I provided (2010384) is not a valid ID or is it just saying that the item which I submitted which has that id is not valid?
  2. Does the Free Local Listing have to be approved before Local Inventory will work?
  3. What might be causing this error?
Thank you


Shopping API Forum Advisor

unread,
Aug 13, 2021, 2:18:54 AM8/13/21
to gmer...@petsuppliesplus.com, google-content-...@googlegroups.com

Hello Gregory,

 

Thank you for reaching out to us. I’m James from the Content API Team.

 

Can you please provide us with the following information below so that we can proceed with our investigation?

  • Merchant account ID
  • Complete API request and response logs in JSON format when you encountered the invalid item error.
  • Screenshots of the issues.

 

Kindly send the said information via Reply privately to Author option, if that option is not available on your end, then please send the requested information through this email <shopping-a...@google.com> instead.

 

Regards,

Google Logo
James Howell Abarsoza
Content API for Shopping Team
 


ref:_00D1U1174p._5004Q2LmnQx:ref

Gregory Mertens

unread,
Aug 13, 2021, 3:02:46 PM8/13/21
to Google Content API for Shopping
I think I figured it out.
1. The product id has to have the form of 'local:en:US:2010387' instead of just ' 2010387'. This does not appear to be documented in the API section for Local Inventory but is mentioned when using the httpost method.
2. While my StoreCodes have leading 0's in MyBusiness, the code did not like having them and had to be removed. So '44' instead of '0044'.

Thanks.

Shopping API Forum Advisor

unread,
Aug 16, 2021, 2:54:10 AM8/16/21
to gmer...@petsuppliesplus.com, google-content-...@googlegroups.com
Hi Gregory,

Thanks for coming back. Harry here, I work along James on the Content API Team.

Glad your figured it all the issues out on your end. If I may add, it is documented that the localinventory.insert method requires the productId which is the REST ID of the product for which to update local inventory upon making the request. In addition, the same is described here when you encounter invalid error: [item id] Invalid item id: '<id>'.

Let us know if you need anything else specific to the API.

Thanks,
Google Logo
Harry Cliford Rivera
Content API for Shopping Team
 


ref:_00D1U1174p._5004Q2LmnQx:ref
Reply all
Reply to author
Forward
0 new messages