Inventory Level Update - Webhook

HitPay
Shopify Partner
23 0 1
Hi there!

We are building an inventory sync app for a third party POS app.

The sample response below for the inventory level update does not include product or variant id.

inventory_levels/connect, inventory_levels/update, inventory_levels/disconnect
Hide response
{
"inventory_item_id": 271878346596884015,
"location_id": 48752903,
"available": null,
"updated_at": "2019-08-08T16:17:43-04:00",
"admin_graphql_api_id": "gid:\/\/shopify\/InventoryLevel\/48752903?inventory_item_id=271878346596884015"
}

The webhook above does not allow us to accurately update the product or variant inventory level.

Would someone from the Shopify team kindly advise which webhooks we need to listen to in order to accurately update the product or variant inventory level?
Replies 16 (16)

HitPay
Shopify Partner
23 0 1
Hi Shopify Team,

Please let us know if anyone can help us.

Best,
Aditya from HitPay

Ryan
Shopify Staff
499 42 120

Hi @HitPay,

 

Using the REST API, the inventory_item_id doesn't have a mapping back to product or variant.  The suggested approach would be to keep a local database of product and variant id mappings to inventory items if you want to identify your levels based on products instead. 

 

Alternatively GraphQL has the ability to access both the product IDs and inventory IDs in the same call.

 

The webhooks you listed in your post are the ones that you would use to keep inventory numbers, specifically inventory_levels/update will fire any time the level changes on that item.

 

I encourage you to check our guide on updating inventory, and exploring GraphQL solutions as well.

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

HitPay
Shopify Partner
23 0 1
Hi Ryan,

Thanks very much for getting back. Let us explore the solution that you have highlighted and get back to you if everything is working as expected.

Cheers
Aditya
HitPay
Shopify Partner
23 0 1

Hi Ryan,

 

We have submitted our app. I was wondering if we can get in touch with the app review team to potentially expedite the app review as a lot of Shopify merchants in Singapore have requested this app from us.

 

Best,

Team HitPay

 

 

Ryan
Shopify Staff
499 42 120

Unfortunately I don't have the ability to expedite app reviews.  I'll mention it to the APAC team but no promises.

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

HitPay
Shopify Partner
23 0 1

Hi Ryan,

 

Thank you very much for your help. Greatly appreciated 🙂

 

Best,

Aditya

HitPay
Shopify Partner
23 0 1

Hi Ryan,

 

Our app got rejected a couple of times due to errors in our submission ( Its our first time!). I was wondering if it would be possible to nudge the APAC review team again?

 

Best 

Aditya

Team HitPay 

Ryan
Shopify Staff
499 42 120

Hi Aditya,

 

Make sure you address the concerns that failed you, and reply to the reviewer via the email!

 

Cheers,

Ryan

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

HitPay
Shopify Partner
23 0 1

Hi Ryan,

 

Our review reference is 12897.

 

We have been been given some feedback points which we are working on, however we would like to clarify with the reviewer on one of the points that he/she has raised. How can we go about doing this?

 

Also the reviewer has added a 2FA authentication to the test account details that we have provided and as a result, we are unable to login to our own test account.

 

Appreciate your help!

 

Best,

Aditya

Ryan
Shopify Staff
499 42 120

I believe you can respond to the email to contact the reviewer!

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

HitPay
Shopify Partner
23 0 1

Hi Ryan!

 

Thank you for patiently answering our questions. The app is now available on Shopify!

 

I'll be sure to reach out if I have any questions.

 

Best,

Aditya

HitPay
Shopify Partner
23 0 1

Hi Ryan,

 
We have a query and I was hoping you could help us with this.
 
We have noticed that the limit to call an API every second is two times. Is there a solution available to call more than 2 times per second or is this a blanket rule set by Shopify?
 
Thanks very much !
 
Best,
Aditya
HitPay
Shopify Partner
23 0 1
Hi Ryan,

Apologies, the other issue we have been facing is the below. Essentially the app is getting installed on some stores and not in some other stores.

In our public app, some of the user access tokens work and some of them don't. For those invalid, we will get the below result. All the token issuing process are using the same code, using offline access mode, and requesting the same scopes. Furthermore, all these token were nearly issued at the same time.

We have no idea why some of them work and some of them don't.

Example:
https://domain/admin/shop.json resulted in a 401 Unauthorized response.
```
{
"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"
}

Any help would be much appreciated!

Best,
Ryan
Shopify Staff
499 42 120

Yes that is the static API call limit for all apps platform wide, plus stores get it doubled.  As for the access token, my guess is that those shops are uninstalling the app, if it fails - check that you are still installed.

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

HitPay
Shopify Partner
23 0 1

Hi Ryan, 

 

We have run into an issue while performing a product and inventory sync from a Shopify Store.

 

The Shopify store has 1004 products, however, we are seeing only 930 products synced to our platform. The code that we are using is below:

 


$keepGoing = true;
$sinceId = null;
$config['limit'] = 250;

do {
if (!is_null($sinceId)) {
$config['since_id'] = $sinceId;
}

// 'https://{myshopify-domain}/admin/api/2020-01/products.json'
$response = $shopify->products($config);

if (count($response['products']) < $config['limit']) {
$keepGoing = false;
}

foreach ($response['products'] as $product) {
$sinceId = $product['id'];

$products->add($product);
}
} while ($keepGoing);

 

 

The below api is giving us the correct number of products which is 1004

 

// 'https://{myshopify-domain}/admin/api/2020-01/products/count.json'

 

I was hoping you could assist us with this.

 

Best,

Aditya

HitPay
Shopify Partner
23 0 1

Wondering if anyone can help here?