Products query maxes at 30, uses too many credits

We use the products query to get all of the products in the system a few times a day. This allows us to get the updated size/weight, the allocated qty, available qty, and backordered qty, and the kits and components of the kits.

With the original api, this was a single call and all of the data was there. With graph, I’m not able to request more than 30 products at a time or I get a credit error (even if this is the first call of the day).

Also after I do get the first batch, I have to wait anywhere from 2 - 20 seconds for more credits. We have thousands of products. What used to be a single few-second request is now going to take hours or longer.

Am I doing something wrong? If not, this makes Shiphero useless for us. Here’s my query. Notice I’m only requesting 30 at a time.

query {
products {
request_id
complexity
data(first:30) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
sku
dimensions {
height
width
length
weight
}
warehouse_products {
warehouse_id
on_hand
available
backorder
allocated
inventory_bin
inventory_overstock_bin
reserve_inventory
updated_at
}
kit
active
tags
kit_components {
sku
quantity
}
}

  }
}

}
}

Hi @bubblynick!
Would using Inventory Snapshot: https://developer.shiphero.com/inventory-snapshot/
and complementing with the products query, filtering by updated_from & updated_to
Sounds like an alternative for your flow?
Thanks in advance!
Tom

Also, if not extremely necessary I would suggest avoiding the available field, because the field itself has an extra complexity due to the number of calculations it makes.

Hey Tom,

Thanks for the very fast help with this. The available field was a huge tip. It reduced the complexity by more than 10x. I see now that was mentioned on the gotchas page, but didn’t realize it was associated with the products call.

That might be enough for us to make proper queries to the products now, since I can request 100 now when not including the available field, which is not needed for us. On Hand is good enough. Trying it now, but looking good so far.

Thanks again
Nick

1 Like