Hello, I’m new to Shiphero GraphQL API. I have one issues how to get all warehouses with id and names, because I don’t found in the documentation?
Hi @LancyBark!
You could use the account query to be able to see all the information about your warehouses.
Something like this:
query {
account {
request_id
complexity
data {
warehouses {
id
legacy_id
address {
name
address1
address2
city
state
country
zip
phone
}
account_id
identifier
dynamic_slotting
invoice_email
phone_number
profile
}
}
}
}
You can also see the rest of the available fields for this and any other query by navigating through the Schema & Docs
Please let me know if there is anything else I could help you with,
Thanks!
Tom
I’m using on PHP Laravel, I get null.
public function getAllWarehouses()
{
$response = $this->send('query {
account {
request_id
complexity
data {
warehouses {
id
legacy_id
address {
name
address1
address2
city
state
country
zip
phone
}
account_id
identifier
dynamic_slotting
invoice_email
phone_number
profile
}
}
}
}
');
return Arr::get($response, 'data.account.data.warehouses');
}
My Controller
public function index()
{
$warehouses = (new ShipheroWrapperGraphQL())->getAllWarehouses();
return view('home.index', compact('warehouses'));
}
Hi @LancyBark!
Is there any chance you could share the request_id
you get in the response?
I’m not familiarized with PHP but I can check that the query is returning the data correctly according to the account settings.
Thanks again!
Tom
I get null on request_id or empty array on functions such as get all locations.
Thanks for clarifying that @LancyBark!
We have a post from some time ago from brett that explained how he made the request in case it helps, it is an excellent explanation:
Let me know if that still doesn’t help!
Thanks again
Tom
I get all warehouses when I pass some object with access token. Is it possible to return warehouses with all locations?
Hi @LancyBark!
Would the locations Query work for you? It something like this:
query{
locations(warehouse_id: "V2FyZWhvdXNlOjExNzkw"){
request_id
complexity
data(first: 100) {
edges {
node {
id
legacy_id
name
}
}
}
}
}
And you can paginate through all the locations available in your warehouse
I trying in tyhis
public function getAllWarehouses()
{
$response = $this->send('query {
account {
request_id
complexity
data {
warehouses {
id
legacy_id
address {
name
address1
address2
city
state
country
zip
phone
}
locations {
complexity
data{
edges {
cursor
node {
id
name
warehouse_id
pickable
}
}
}
}
account_id
identifier
dynamic_slotting
invoice_email
phone_number
profile
}
}
}
}
');
return Arr::get($response, 'data.account.data.warehouses');
}
That field doesn’t exist inside that query @LancyBark. That is why you would need to use the other query.
You can also see the rest of the available fields for this and any other query by navigating through the Schema & Docs .
You can use any of our recommended IDEs to navigate the Docs and see the fields available, but let me know if you need help with that.
I use Altair which allows me to save the queries, but the three of them work perfectly