Cannot create duplicated SKUs accross different 3PL clients

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:

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:

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

2nd request:

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:

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

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

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.

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

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

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

@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

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

Hi @tomasw,

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

Thank you.

1 Like

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} doesn’t work with the GraphQL API.

Thanks

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

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