Find Kits for Component SKUs

Hello,
Is it possible to find which Kits a component sku belongs to using the API? I know that a kit sku has a component field, but does this work the other way?

Thanks,

I also would love to know about this.

What we have now
To be specific. If I have a product (sku: ''A"), that has a kit_component with a sku of “B”, I can easily find that out by providing the kit_components field in my query. Like so:

query {
  product(sku: "A") {
    data {
      id
      name
      sku
      kit_components {
        id
        sku
        quantity
      }

And this query will let me know that “B” is a `kit_component" of “A”. Great!

What I want
What I want is a feature that allows me to determine which products that product “B” is a kit_component of.

I imagine it would look something like this:

query {
  product(sku: "B") {
    data {
      id
      name
      sku
      in_kits {
        id
        sku
      }

Whereas in_kits will tell us the product that has product “B” as a kit_component.

REASON
The reason we want this is that we want to be able to delete products via the API, but sometimes the product cannot be deleted because it is part of another products’ kit_components. It would be helpful to find out what those other products were so that we could either remove the [deletable] product from their kit, OR delete the other product as well.

NOTE: this might even be useful if there was an error message on delete that told us what those products were. Unfortunately, the error message only tells us that there is an “Unexpected Error” .

Happy to provide more details as needed.

2 Likes