SKU exists for client?

Hi, Is there a way to put a client_id filter for the product query?
I’m trying to determine if a given sku under a 3PL client account exists before sending a product_create mutation.
Pls feel free to suggest if there’s a better way to achieve the same.
Thank you!

Hey @Raj,

Thanks for reaching out!

You can attach the customer_account_id filter to your products query.
A small example query would look something like this:

{
  products(sku: "string", customer_account_id: "string") {
    request_id
    complexity
    data(first: 10) {
      edges {
        node {
          id
          legacy_id
          sku
          name
        }
      }
    }
  }
}

Let me know if this works for you!

Best,
RayanP

That’s perfect! Just one last bit - is the account_id the same as client_id that we see in the dashboard here: https://3pl.shiphero.com/threepl
Sorry there are just so many ids that it gets hard to keep track of.
Thank you!

Hey @Raj,
You’re welcome!

I believe those would be the same ID.
Let me know if there’s anything I can do to assist.

Best,
RayanP

Thank you @sh-agent for the quick responses - I tried multiple IDs but giving both the sku and id filters gives zero results to me each time. Here’s my last request id “6390fb0e9c7b82baa08f45fe”.

I also didn’t know you could put ‘sku’ filter in the products query, but I tried just putting the sku filter and it seems to ignore the filter and starts sending hundreds of products.

Hey @Raj,

No problem, looking into this now.
Will keep you updated.

Let me know if there’s anything I can do to assist in the meantime!

Best,
RayanP

1 Like

Hello @Raj

I checked that req ID; in that case, you sent the same value for SKU and customer_account_id.

I picked up several random SKUs for that customer ID from the UI and replaced them in the call, and I am getting successful responses.

If you have a request ID for a call that returned hundreds of products I could also look into that.

Have a great day!
TomasFD

1 Like

Oh crap… That’s right, I totally messed up - classic PEBKAC!
Thank you mate once again for your help… though I should’ve caught that one. Cheers!

1 Like