# Product\_delete not working as expected

**URL:** <https://community.shiphero.com/t/product-delete-not-working-as-expected/2111>\
**Category:** GraphQL API\
**Created:** [July 30, 2022, 11:18am UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111 "2022-07-30T11:18:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajitdsa](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ajitdsa](https://community.shiphero.com/u/ajitdsa)\
**Post date:** [July 30, 2022, 11:18am UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/1 "2022-07-30T11:18:34Z")

</div>

We think this query should result in a deleted product:

```auto
mutation {
  product_delete(
		data: {
      sku: "Par_F-TRV-0086"
      customer_account_id: "QWNjb3VudDo2ODA1MA=="
    }
  ) {
    request_id
    complexity
  }
}

```

But instead we get an error

```auto
{
  "errors": [
    {
      "message": "Unexpected Error",
      "operation": "product_delete",
      "field": "product_delete",
      "request_id": "62e5130e7ca5720090ab140c",
      "code": 22
    }
  ],
  "data": {
    "product_delete": null
  }
}

```

Can you advise us pls?

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [August 1, 2022, 11:40am UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/2 "2022-08-01T11:40:39Z")

</div>

Hey @ajitdsa,

Thanks for reaching out!  
I’ll look into this and have an update for you shortly.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [August 1, 2022, 8:46pm UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/3 "2022-08-01T20:46:18Z")

</div>

Hey @ajitdsa,

Thank you for your patience!  
Wanted to let you know we’re still actively investigating this issue.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [August 4, 2022, 7:07pm UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/4 "2022-08-04T19:07:14Z")

</div>

Hey @ajitdsa,

Apologies for the delay. The issue with this SKU I believe is that it is part of a recursive kit. A recursive kit is a kit (kit a) where the component of the kit is a kit (kit b) itself, and that kit’s (kit b) component is the original kit (kit a). I’ve been looking into recursive kits and how to replicate them but haven’t been able to yet, which is the cause of this delay.

I’d recommend running a `kit_clear` mutation on this SKU and then try to use `product_delete`.

```auto
mutation {
  kit_clear(data: { sku: "Par_F-TRV-0086" customer_account_id:"QWNjb3VudDo2ODA1MA==" }) {
    request_id
    complexity
  }
}

```

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

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [November 23, 2022, 1:58pm UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/5 "2022-11-23T13:58:02Z")

</div>

Hi @sh-agent ,

Having the same issue. This is costing me a lot, we can’t delete these products and I believe it is something about this issue, because all of the products that I’m trying to delete are marked as kits.

This is related with the other issue that I posted recently: [Removing "is kit" from item? - #5 by marioreinike](https://community.shiphero.com/t/removing-is-kit-from-item/2248/5)

Please, this is urgent, we need to delete these products.

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [November 23, 2022, 2:03pm UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/6 "2022-11-23T14:03:12Z")

</div>

Hey @marioreinike,

Thanks for reaching out!

Would you mind sharing some example request id’s so I can take a better look at what’s going on?  
Let me know if there’s anything I can do to assist.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [November 23, 2022, 2:32pm UTC](https://community.shiphero.com/t/product-delete-not-working-as-expected/2111/7 "2022-11-23T14:32:43Z")

</div>

Hi @sh-agent !

For example, you can see request ID `637e266d0a611c72eb48ada6`. But hey, I found a way to delete them, I did it through the Shiphero Web App. First I deleted all the product locations associated to those products, and then I deleted all of the products.

I believe this issue has something related to the product that are kits and have been associated to locations. If you delete all the product locations, then the mutation to delete products works correctly.

But this doesn’t solve the main issue that we have (see link above), that one cannot deactivate a product as a kit. For this instance I could just delete them, because they were new products. But if for some error we activate it on another existing product, it would cause a giant problem because we could’t delete it.
