Querying kits, components and quantities

Hello!

I am trying to find a way to query out the quantity of components needed for a kit via the API. I can supply a kit to the following query to get the component SKUs, but I can’t find any fields that would tell me how many of each SKU is required for the kit. If I look at the product details screen in the app, I can see the quantity there, but I just can’t find it in the API.

query ($sku: String) {
    product (sku: $sku) {
        request_id
        complexity
        data {
          sku
          name
          kit
          kit_build
          components {
            sku
          }
        }
    }
}

In the event that it’s not available in the API, could I put in a request to add it, please?

Thanks,
Jeremy

Hi @jeremyw!
You are right, this isn’t currently available on the query.
I just submitted a Feature Request for this and will let you know as soon as I get an update.
Thanks!
Tom

1 Like

Hi @tomasw,

I just wanted to throw out there that if it’s easier to have a separate query specifically for the kits, components and quantities (like the picks_per_day query) that would be fine, too. For my purposes it doesn’t have to be worked into the product query.

Thanks,
Jeremy

1 Like

Hi @tomasw,

I was just curious on the progress of this request. Do you know if there’s any sort of timeline?

Thanks,
Jeremy

Hi @jeremyw
I apologize for the delay with this, but it should be available now
The field is available under components, something like this:

query {
  product(sku: "1001120989208") {
    request_id
    complexity
    data {
      id
      legacy_id
      kit_components {
        sku
        quantity
      }
    }
  }
} 

Again, thank you for the patience and let me know if there is anything else I could help you with about this.
Thanks!
Tom

1 Like

THANK YOU!! This is awesome! :trophy: :smiley: