Create Kits from the API

Hi everyone!

We need to create all of our products using the API, and that incudes creating kits. So I have two questions:

  1. I found a way to create kits from Shiphero App, but couldn’t make it using the API. How can I do that? which would be the necessary mutations and request bodies?

  2. I found something that is called “build kits”. Whats the difference between them and the “kits”? Is it possible to use them to create kits, instead of the actual kits?

Hey @marioreinike,

Thanks for reaching out!
I’ll look into this and get back to you shortly.

Best,
RayanP

Hey @marioreinike,

Thanks for hanging in there.
You can use the kit_build mutation to create kits via the API. An example request would look something like this:

mutation {
  kit_build(
    data: {
      sku: "string"
      kit_build:true
      components: [
        { sku: "string", quantity: 0 }
        { sku: "string", quantity: 0 }
      ]
    }
  ) {
    request_id
    complexity
    product {
      id
      legacy_id
      account_id
      name
      sku
    }
  }
}

A build kit is a kit where the components can be broken apart and shipped separately; while a regular kit cannot be broken apart and all components must be shipped together. The “Kit Terms” section in this article provides a little more context.

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

Best,
RayanP

Thanks @sh-agent !! That’s exactly what I needed.