Create new product 'Case'?

Hi,
I found that API supports querying a product’s case, but is it possible to create a new Case and generate a new case_barcode?
Thank you!

Hey @Raj,

Thanks for reaching out!

You can create a new case and case barcode for a product by running a product_update mutation:

mutation {
  product_update(
    data: { sku: "pc2", cases: [{ case_barcode: "test2", case_quantity: 3 }] }
  ) {
    request_id
    complexity
    product {
      id
      legacy_id
      account_id
      name
      cases {
        case_barcode
        case_quantity
      }
    }
  }
}

You can also pass this field in the product_create mutation:

mutation {
  product_create(
    data: {
      name: "pc1"
      sku: "pc1"
      cases: [{ case_barcode: "test", case_quantity: 3 }]
      warehouse_products: [{ warehouse_id: "70405", on_hand: 0 }]
    }
  ) {
    request_id
    complexity
    product {
      id
      legacy_id
      account_id
      name
      sku
      cases {
        case_barcode
        case_quantity
      }
    }
  }
}```

Let me know if you have any questions or concerns.

Best,
RayanP
1 Like

Ah… I see - I was looking for something like case_create, but it’s supposed to work only as a subset of product - got it! Thank you @Rayanp!

1 Like