Product not found error with inventory_remove mutation

Hi!
we are trying to create the shipment for the order via Shiphero API, as we could see in the documentation we need to create shipment, then reduce inventory and change order status. The two mutations are working fine but with inventory_remove mutation we are getting the error with the message “Product not found”. I am sure that product is assigned to the warehouse. For the reference our request id is 650af8b9db4dac2346b873c0 and sample mutation is

mutation {
  inventory_remove(
    data: {
    sku: "SKU"
    warehouse_id: "WAREHOUSE_ID"
    quantity: 1
    reason: "Order shipped via Public API"
}
  ) {
    request_id
    complexity
  }
}

Appreciate any help.

Hey @saif_storage,

Thanks for reaching out!
Looking into this inquiry now. I’ll update you as soon as I can.

Please let me know if there’s anything I can do to assist in the meantime.

Best,
RayanP

Hey @saif_storage,

Thanks for hanging in there!

The warehouse_id that’s passed in the mutation points to WH 78209, which as far as I can tell has no products in it. I believe the correct warehouse id is V2FyZWhvdXNlOjk2Mzgx (96381).

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

Best,
RayanP

Hello @sh-agent
Thank you for look into it but this does not looks the case, because i am using the same warehouse ID in the requests to create order, create shipment and mark the order fulfilled. I will check once again.

1 Like

Hello @sh-agent
I am facing another issue while trying to create the shipment. I get the error with message “Invalid line item id” while i confirmed that item id is correct. Can you take a look please to see whats wrong. Request id is 650e92bde24ac6d8619e0b49 for your reference

Hey @saif_storage,

Thanks for hanging in there!

The line_item_id you’re looking for is 987028168. I believe the value that was input was the partner_line_item_id.

For reference, this is the query I used to inspect:

{
  order(id: "393986124") {
    request_id
    complexity
    data {
      id
      legacy_id
      order_number
      partner_order_id
      line_items(first:1) {
        edges {
          node {
            id
            legacy_id
            partner_line_item_id
          }
        }
      }
    }
  }
}

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

Best,
RayanP

Hello @sh-agent
What do we pass in the line item id? Should it be the legacy ID or something else.
Appreciate your support.
Thanks and regards

Hey @saif_storage,

Thanks for hanging in there!

The id returned under the line_items edge is the line_item_id. You can use that id or the legacy_id returned in your mutations.

For example the data returned from the previous query:

{
  "data": {
    "order": {
      "request_id": "6511754fc8059c8c7a3f0ce3",
      "complexity": 3,
      "data": {
        "id": "T3JkZXI6MzkzOTg2MTI0",
        "legacy_id": 393986124,
        "order_number": "83610731",
        "partner_order_id": "83610731",
        "line_items": {
          "edges": [
            {
              "node": {
                "id": "TGluZUl0ZW06OTg3MDI4MTY4",
                "legacy_id": 987028168,
                "partner_line_item_id": "1720703346"
              }
            }
          ]
        }
      }
    }
  }

TGluZUl0ZW06OTg3MDI4MTY4 or 987028168 is the line_item_id.

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

Best,
RayanP

still getting the same error. Using the warehouse id as you suggested. The request id is 651bd388f698e842ec41f5a4

Hey @saif_storage,

Thanks for hanging in there!

Is this the intended request_id?
The request_id you sent belongs to an order_update_fulfillment_status mutation that returned no errors.

Best,
RayanP

sorry my bad, i shared the wrong request ID. The correct request id is 651bd2e43635c118216baba4

@sh-agent looking forward to your response

Hey @saif_storage,

Thanks for hanging in there!

For this mutation, could you try passing the customer_account_id value ? In this case I believe the value is 8449.

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

Best,
RayanP