Creating SKU with OnHand Qty isn't working

Hi,
Could you pls look into this urgently? The below request used to work correctly, but since past some time the SKU gets created with Qty 0 instead.

{"query":"mutation {   product_create(   data: {     sku: \"InDock_0365\"     name: \"InDock_0365\"          price: \"0.00\"     customer_account_id: \"XXX==\"     barcode: \"InDock_0365\"     product_note: \"\"     warehouse_products: {    warehouse_id: \"XXX\"    on_hand: 1    inventory_bin: \"InDock_0365\"    reserve_inventory: 0    replenishment_level: 1    reorder_level: 1    reorder_amount: 1    custom: false     }   })   {   request_id   complexity   product {     id     legacy_id     sku     name     price     account_id     barcode     warehouse_products {    warehouse_id    legacy_id    on_hand    inventory_bin     }   }    }}"}

Here’s the response I received (notice request had on_hand = 1, while here it is 0)

{
	"data": {
		"product_create": {
			"request_id": "66c4daa9cbfd9e903738b63d",
			"complexity": 10,
			"product": {
				"id": "UHJvZHVjdEluZm86MzIyNDczODI2",
				"legacy_id": 322473826,
				"sku": "InDock_0365",
				"name": "InDock_0365",
				"price": null,
				"account_id": "XXX==",
				"barcode": "InDock_0365",
				"warehouse_products": [{
						"warehouse_id": "XXX",
						"legacy_id": 452733355,
						"on_hand": 0,
						"inventory_bin": " "
					}
				]
			}
		}
	},
	"extensions": {
		"throttling": {
			"estimated_complexity": 10,
			"cost": 10,
			"cost_detail": {
				"product_create": {
					"items_count": 0,
					"cost": 10,
					"total_cost": 10,
					"fields": {}
				}
			},
			"user_quota": {
				"credits_remaining": 1992,
				"max_available": 2002,
				"increment_rate": 30
			}
		}
	}
}

Thank you,
Raj

Hey @Raj

I started investigating this issue. I will let you know my findings.

Have a nice day!

Hey @tomasfd - Thank you for looking into it.
Eager to know what you find.

Hey @raj! Thanks for hanging in there. If you use an account with dynamic slotting (which can have many bins for an SKU), the field won’t have an effect. Once created, the stock will recalculate based on the quantity in bins.
Have a nice day!

Hi @tomasfd, I’m sorry I don’t fully understand - AFAIK our account type hasn’t changed and I can confirm this same code used to work till 1-2 weeks back. Has there been a recent change on SH side that broke this?
How can I fix it?

Hi @tomasfd - sorry to bug you, but I need help with this on priority pls…

Hey @Raj, I’m unaware of any change that could affect this in the las 2 weeks or so. Can you share a request and response that has worked in the past?

Hi @tomasfd , sorry I don’t have data saved from that time, but the request I gave you is exactly what I used to send and it added qty as expected.
Now that this isn’t working anymore, what’s the way to add qty? Is there a change I can make to above request? Or do I need to make a separate request after this one?

Pls guide me through this, thank you.

Can I PLEASE get some help here? This is urgent and broken.

I even tried using the inventory_add mutation after doing a product_create, but it doesn’t seem to accept inventory_bin …?

I need to create the product with qty at a given location eg. “Line 1”

@tomasfd

Here’s a screenshot from official GraphQL that shows this should work:


(And it has been working well for past over an year)

Here’s a request I just made:

{"query":"mutation {   product_create(   data: {     sku: \"InDock_0367\"     name: \"InDock_0367\"          price: \"0.00\"     customer_account_id: \"xxx\"     barcode: \"InDock_0367\"     product_note: \"\"     warehouse_products: {    warehouse_id: \"yyy\"    on_hand: 1    inventory_bin: \"InDock_0367\"    reserve_inventory: 0    replenishment_level: 1    reorder_level: 1    reorder_amount: 1    custom: false     }   })   {   request_id   complexity   product {     id     legacy_id     sku     name     price     account_id     barcode     warehouse_products {    warehouse_id    legacy_id    on_hand    inventory_bin     }   }    }}"}

It again came back with "on_hand":0,"inventory_bin":" "

Here’s the request ID:
“request_id”:“66cf7ff23b414f5980136006”

Hello @Raj

I created an internal ticket for our engineers to investigate.

The fact that the fields exist does not imply they are 100% compatible with your account config. For example, the customer_account_id field does nothing for accounts that are not 3PLs, but they can still see it.

Have a nice day

But the code I gave above has been working perfectly for a long time (more than an year, at least), and just stopped in last few weeks with no change from our side.

Any update here pls?

Hi Raj,

Thanks for hanging in there.

I just left a meeting with our EN team. They are working on it as we speak. I do not have a resolution ETA at the moment.

Have a great day!

1 Like

Hi @tomasfd , is there any update on the case?

Hi @Raj,

The ability to update on_hand directly as a Dynamic Slotting account was not intended, as it leads to inventory discrepancies. We won’t be reverting to how that field behaved in the past. Dynamic Slotting accounts should explicitly add inventory using the available mutations. I’m sorry for not communicating this beforehand. We’ll make an announcement briefly.