Mutation on warehouse products

rray
(
[data] => Array
(
[products] => Array
(
[request_id] =>
[complexity] => 11
[data] => Array
(
[edges] => Array
(
[0] => Array
(
[node] => Array
(
[id] =>
[sku] => test54321
[warehouse_products] => Array
(
[0] => Array
(
[warehouse_id] =>
[on_hand] => 296
[inventory_bin] =>
[inventory_overstock_bin] =>
)

                                                    )

                                            )

                                    )

                            )

                    )

            )

    )

I need mutation for update in on_hand and inventory_bin

I am trying with this code

$get_sku_available= <<<EOT
mutation {
product_update(
data: {
sku: “test54321”
warehouse_products
{
on_hand :“301”
}

}

) {
request_id
complexity
}
}
EOT;

Hey @anwaarmirza,

Thanks for reaching out and Welcome to our Developer Community!

To add inventory to a product I’d recommend using the inventory_add mutation:

mutation {
  inventory_add(
    data: {
      sku: "string"
      warehouse_id: "string"
      quantity: 1
      reason: "string"
      location_id: "string"
    }
  ) {
    request_id
    complexity
    warehouse_product {
      id
      legacy_id
      account_id
      sku
      warehouse_id
      warehouse_identifier
      price
      value
      value_currency
      on_hand
      inventory_bin
    }
  }
}

If needed you can find our entire Schema here.

Please let me know if you have any questions or concerns.

Best,
RayanP