Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Fail to update 'inventory_quantity' using phpclassic/php-shopify library

Solved

Fail to update 'inventory_quantity' using phpclassic/php-shopify library

abn117
Tourist
4 1 0

Hi everybody,

 

I'm trying to update productVariant "inventory_quantity" via php-shopify but my request always fall

my code is the following:

$shopifySdk->InventoryItem(42110942281867)->get()

and the response i get is 

array:12 [
"id" => 42110942281867
"sku" => "304SWY0_903_L"
"created_at" => "2022-03-08T07:41:18-05:00"
"updated_at" => "2022-03-16T06:49:22-04:00"
"requires_shipping" => true
"cost" => "12946.00"
"country_code_of_origin" => null
"province_code_of_origin" => null
"harmonized_system_code" => null
"tracked" => true
"country_harmonized_system_codes" => []
"admin_graphql_api_id" => "gid://shopify/InventoryItem/42110942281867"
]

I don't seeying any field with quantity.

Please help.

 

Thank you

Accepted Solution (1)

abn117
Tourist
4 1 0

This is an accepted solution.

Hello everyone,

I found a solution to update the quantities of the variant products.

My first approach was not the right one because to update a variant product you have to retrieve a location, instance of inventory level or inventory  service and also can use a barcode.
That it's a lot of sub-requests with provided data i got but I'll see to optimize in a second time.

 

Solved 🙂 

View solution in original post

Reply 1 (1)

abn117
Tourist
4 1 0

This is an accepted solution.

Hello everyone,

I found a solution to update the quantities of the variant products.

My first approach was not the right one because to update a variant product you have to retrieve a location, instance of inventory level or inventory  service and also can use a barcode.
That it's a lot of sub-requests with provided data i got but I'll see to optimize in a second time.

 

Solved 🙂