Query to return 3PL Customer name

Hey all - I’ve just assembled a rather rudimentary query to get the legacy order ID attached to an order (to generate a url), and am wondering if it’s possible to get the 3PL Customer’s account name through a similar query? I’ve taken a cursory glance through the API documentation and don’t see anything that addresses it directly. The only one I’m aware of that returns the name by default is the 3pl billing.

If I need to pass the account ID through a separate query that’s totally doable, but I’m struggling to pull any documentation for it.

I can bypass the API completely and just use an external reference sheet to match the customer_account_ID up if necessary, but I’d prefer to do it all in one.

Super simple query to get the order ID below, so you know where I’m starting from:

query {
  order(id: "abc123") {
    request_id
    complexity
    data {
      id
      legacy_id
    }
  }
}

Thanks in advance!

Hey @Lee! We do not have a specific query that returns the company name by passing an ID. We do have, however, a query that returns all child accounts, where you can use the account_id from the order to find the customer and fetch the name from it.

query {
  account(analyze: false) {
    request_id
    data {
      legacy_id
      id   
      customers{
        edges{
          node{
            id
            legacy_id
            warehouses{
              company_alias
            }
          }
        }
      }
    }
  }
}

The company alias is inside the warehouse as you can set them like that in the 3PL management screen.

Have a great day!

Thanks Tomas, that should work for what I need!

1 Like