# Cannot create duplicated SKUs accross different 3PL clients

**URL:** <https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292>\
**Category:** GraphQL API\
**Created:** [January 13, 2020, 9:54am UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292 "2020-01-13T09:54:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://community.shiphero.com/u/Gary)\
**Post date:** [January 13, 2020, 9:54am UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/1 "2020-01-13T09:54:18Z")

</div>

Hi community,

As discussed with @yosef, the ShipHero system is supposed to be able to handle duplicated SKUs accross different 3PL clients. Unfortunately the GraphQL API returns a “`product already exists`” error when trying to do so.

Can you please tell me if there is anything I’m doing wrong with my requests ?

1st request:

```auto
mutation {
  product_create(
    data: {
      customer_account_id: "QWNjb3VudDo2MDEx"
      name: "wood chair"
      sku: "CHAIR00001"
      price: "150.00"
      warehouse_products: [{
        warehouse_id: "V2FyZWhvdXNlOjExMjg4"
        on_hand: 130
      }]
      value: "15.00"
      barcode: "2233443355chair"
      country_of_manufacture: "US"
      dimensions: { weight: "12", height: "25", width: "10", length: "25" }
      }
  )
  {
    request_id
    complexity
    product {
      id
      sku
    }
  }
}

```

1st response:

```auto
{
  "data": {
    "product_create": {
      "request_id": "5e1c3ca27dd7a08132079963",
      "complexity": 10,
      "product": {
        "id": "UHJvZHVjdEluZm86MjY5MTk5MjIx",
        "sku": "CHAIR00001"
      }
    }
  }
}

```

2nd request:

```auto
mutation {
  product_create(
    data: {
      customer_account_id: "QWNjb3VudDo1ODgy"
      name: "wood chair"
      sku: "CHAIR00001"
      price: "25.00"
      warehouse_products: {
        warehouse_id: "V2FyZWhvdXNlOjExMjg4"
        on_hand: 0
      }
      value: "15.00"
      barcode: "2233443356chair"
      dimensions: { weight: "12", height: "25", width: "10", length: "25" }
    }
  )
  {
    request_id
    complexity
    product {
      id
      sku
    }
  }
}

```

2nd response:

```auto
{
  "errors": [
    {
      "message": "A product with sku CHAIR00001 already exists",
      "operation": "product_create",
      "field": "product_create",
      "request_id": "5e1c3cbe699db1fbf47c7558",
      "code": 6
    }
  ],
  "data": {
    "product_create": null
  }
}

```

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [January 13, 2020, 3:18pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/2 "2020-01-13T15:18:52Z")

</div>

Hi @Gary  
Thanks for catching this!, I was able to reproduce with the info you provided and engaged the engineering team to work on a fix for this.  
I will let you know as soon as I get an update.  
Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://community.shiphero.com/u/Gary)\
**Post date:** [January 14, 2020, 1:57pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/3 "2020-01-14T13:57:26Z")

</div>

Hi @tomasw

Thank you for taking my request into account.

I also noticed that it is not possible to query a product for a given `sku` and a given `customer_account_id`.  
Indeed the `product` query only takes in the `id` and the `sku` of the product, and it seems to return the first product with a matching SKU.

Note: I managed to create two products with duplicated skus accross two clients through the `https://app.shiphero.com/dashboard`

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [January 14, 2020, 5:57pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/4 "2020-01-14T17:57:49Z")

</div>

Absolutely! A request for making this possible was just approved.  
So shortly an engineer will be working on this.  
I will let you know as soon as I have an ETA or an update.  
Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [February 26, 2020, 6:06pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/5 "2020-02-26T18:06:52Z")

</div>

Hi @Gary!  
A fix for this should was implemented recently and now you should be able to create duplicated SKUs across different 3PL clients.  
As for the other request is still being developed, so I will let you know as soon as I have an update.  
Thanks for the patience on this!  
Tom

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [February 27, 2020, 10:55am UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/6 "2020-02-27T10:55:23Z")

</div>

Hi @Gary  
Filters for the products query using `sku` + `customer_account_id` should also be available now  
Thanks again for the patience!  
Tom

---

<div class="post-metadata">

**Author:** ![adit\_reachdesk](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@adit\_reachdesk](https://community.shiphero.com/u/adit_reachdesk)\
**Post date:** [March 9, 2020, 3:12pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/7 "2020-03-09T15:12:19Z")

</div>

@tomasw Hello we happen to receive this error using almost the same query, I was not able to add the `customer_account_id` parameter in the product\_create mutation payload.

Could you kindly confirm if the status of the fix?

Please note we can create products with the same SKU across different warehouses using ShipHero’s website, the GraphQL API seems to be blocking the request.

Thank you.  
AS

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [March 10, 2020, 12:02pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/8 "2020-03-10T12:02:09Z")

</div>

Hi @adit_reachdesk !

Looks like your account type is not a 3PL account, this means you won’t need to include the customer\_account\_id

The reason we use customer\_account\_id is for 3PL accounts that need to make mutations/queries for their customer\_accounts.

As for creating the same SKU across different warehouses you will need to first create the SKU with the product\_create mutation and then you’ll have to add the product to the other warehouses by using the _ **product\_add\_to\_warehouse** _ mutation and specifying both _ **warehouse\_id** _ and _ **sku** _

Let me know if that doesn’t help or there’s anything else I can help you with.

Thanks!,

Tom

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://community.shiphero.com/u/Gary)\
**Post date:** [March 11, 2020, 1:44pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/9 "2020-03-11T13:44:51Z")

</div>

Hi @tomasw,

I confirm that the query `products` now seems to work as expected.

Thank you.

---

<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:** [October 19, 2021, 8:31pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/10 "2021-10-19T20:31:06Z")

</div>

Hi @tomasw,

Is it possible to add the customer\_account\_id filter to the product (not products) query?

When having the same SKU across two different 3PL accounts and querying , it returns the product created first. I tried the products query but it used way too many credits, so I had to switch to the product query.

Also, I can’t find the product\_id. Is it only retrievable via API? or is it possible to get it from the web? The id in [https://app.shiphero.com/dashboard/products/details/{id}](https://app.shiphero.com/dashboard/products/details/%7Bid%7D) doesn’t work with the GraphQL API.

Thanks

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [October 20, 2021, 8:08pm UTC](https://community.shiphero.com/t/cannot-create-duplicated-skus-accross-different-3pl-clients/292/11 "2021-10-20T20:08:18Z")

</div>

Hi Pedro,  
The id for a product can be found in the products query.

```auto
query{
  products(sku: "<enter SKU here>",customer_account_id: "<customer acct id here>"){
    request_id
    complexity
    data{
      edges{
        node{
          id
          name
        }
      }
    }
  }
}

```
