# Create new product 'Case'?

**URL:** <https://community.shiphero.com/t/create-new-product-case/2287>\
**Category:** GraphQL API\
**Created:** [December 28, 2022, 3:27pm UTC](https://community.shiphero.com/t/create-new-product-case/2287 "2022-12-28T15:27:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Raj](https://community.shiphero.com/u/Raj)\
**Post date:** [December 28, 2022, 3:27pm UTC](https://community.shiphero.com/t/create-new-product-case/2287/1 "2022-12-28T15:27:47Z")

</div>

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!

---

<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:** [December 28, 2022, 6:29pm UTC](https://community.shiphero.com/t/create-new-product-case/2287/2 "2022-12-28T18:29:29Z")

</div>

Hey @Raj,

Thanks for reaching out!

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

```auto
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:

````auto
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
````

---

<div class="post-metadata">

**Author:** ![Raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Raj](https://community.shiphero.com/u/Raj)\
**Post date:** [December 28, 2022, 6:42pm UTC](https://community.shiphero.com/t/create-new-product-case/2287/3 "2022-12-28T18:42:50Z")

</div>

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 @sh-agent!

---

<div class="post-metadata">

**Author:** ![cmora](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cmora](https://community.shiphero.com/u/cmora)\
**Post date:** [February 22, 2023, 3:17pm UTC](https://community.shiphero.com/t/create-new-product-case/2287/4 "2023-02-22T15:17:26Z")

</div>

> [@sh-agent](#):
>
> ```auto
> mutation {
> product_update(
> data: { sku: "pc2", cases: [{ case_barcode: "test2", case_quantity: 3 }] }
> )
> 
> ```

Hello @sh-agent !

I hope you’re doing well.  
I’ll add a comment to this post due to an issue that I’m having while trying to create new cases using the product\_update mutation.

When trying to update a product and create a case for it, this is the query I’m sending:

```auto
mutation($customer_account_id: String, $sku: String!, $case_barcode: String!, $case_quantity: Int!) {
  product_update(data: { 
    customer_account_id: $customer_account_id
    sku: $sku
    cases: [
      {
      case_barcode: $case_barcode
      case_quantity: $case_quantity
      }
    ]
  }) {
    request_id
    complexity
    product {
      id
      legacy_id
      account_id
      name
      sku
    }
  }
}

```

And this is the response:

```auto
{
  "errors": [
    {
      "message": "Cannot access the requested resource. Permission denied",
      "operation": "product_update",
      "field": "product_update",
      "request_id": "63f630709d26ef03a3bb0225",
      "code": 9
    }
  ],
  "data": {
    "product_update": null
  },
  "extensions": {
    "throttling": {
      "estimated_complexity": 10,
      "cost": 10,
      "cost_detail": {
        "product_update": {
          "items_count": 0,
          "cost": 10,
          "total_cost": 10,
          "fields": {}
        }
      },
      "user_quota": {
        "credits_remaining": 1988,
        "max_available": 2002,
        "increment_rate": 30
      }
    }
  }
}

```

It only happens when trying to update anything related to cases (my account has admin permissions). If I update any other attribute of the product, I can update them without any further issue if I don’t include anything related to cases.

Is there anything that I may be missing?  
Thanks  
Cristóbal

---

<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:** [February 23, 2023, 12:18pm UTC](https://community.shiphero.com/t/create-new-product-case/2287/5 "2023-02-23T12:18:52Z")

</div>

Hey @cmora!

Thanks for hanging in there!

Would you mind sending the full request for this call to me privately? I’d like to take a closer look at the headers, and variables on your end if possible.

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

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![pedro](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pedro](https://community.shiphero.com/u/pedro)\
**Post date:** [March 27, 2025, 6:13pm UTC](https://community.shiphero.com/t/create-new-product-case/2287/6 "2025-03-27T18:13:51Z")

</div>

Hi!

We are getting the same error. If I remove the cases attribute the mutation works fine, but if I add them then it throws the permission denied error.

Thanks
