Inventory_subtract Product not found

I’m trying to remove inventory with the inventory_subract mutation and I get the following error even though I know the product exists and the SKU is correct. Can someone give me a clue on what is wrong?
{
“errors”: [
{
“message”: “Product not found”,
“operation”: “inventory_subtract”,
“field”: “inventory_subtract”,
“request_id”: “60a3f102be329d1e2a0a233a”,
“code”: 5
}
],
“data”: {
“inventory_subtract”: null
}
}

Hi BrownMFG!
I checked the information for the mutation that you sent. Thank you for the request _id. In the mutation, you need to have the id of the warehouse that the sku is located in. Replace warehouse_id: “V2FyZWhvdXNlOjgwNzU=” in your query with warehouse_id: “4106”. That is the id of the warehouse where the sku is located.

You can also use warehouse_id: “V2FyZWhvdXNlOjQxMDY=”

@Theresa Thanks for the quick response. I just tried both and I got the same response from both. “request_id”: “60a422ace8b7bc4c7d520615” from “4016” and “request_id”: “60a422c61564f8aed3cf612e” from “V2FyZWhvdXNlOjQxMDY=”. Am I missing something else?

Can you send the exact error that your getting?

for “V2FyZWhvdXNlOjQxMDY=”
{
“errors”: [
{
“message”: “Product not found”,
“operation”: “inventory_subtract”,
“field”: “inventory_subtract”,
“request_id”: “60a422c61564f8aed3cf612e”,
“code”: 5
}
],
“data”: {
“inventory_subtract”: null
}
}
for “4016”
{
“errors”: [
{
“message”: “Product not found”,
“operation”: “inventory_subtract”,
“field”: “inventory_subtract”,
“request_id”: “60a422ace8b7bc4c7d520615”,
“code”: 5
}
],
“data”: {
“inventory_subtract”: null
}
}

Ah! Sorry I did not notice this before. Because your a 3PL acting on behalf of your client account you need to add the customer_account_id to the data as well.
image

Thanks @Theresa for the help. I assume I can find this customer account id with a query on the account for customers like:
query {
account {
data {
customers {
edges {
node {
id
}
}
}
}
}
}

How do I know which customer ID to use since there are multiple?

Hi again @BrownMFG!
Glad that I can assist. The customer account id can be found under the 3PL menu in the ShipHero UI at https://app.shiphero.com/3pl, and also in the warehouses section in the data of the customers node.
UI:

query:

query {
  account {
    data {
      customers {
        edges {
          node {
            id
            legacy_id
            email
            username
            warehouses {
              account_id
              company_alias
            }
          }
        }
      }
    }
  }
}

The name of the customer is under → Account >customers>warehouses>company_alias

Thank you very much @Theresa. Do I have to do each product individually or can I do more than one at a time? I couldn’t seem to find any examples of multiple items.

You can edit the inventory of multiple products using the inventory_sync mutation which uses a csv file. There is some information and samples here : Inventory-Sync – Developer Resources | ShipHero