Hello Team ,
how could i get a list of products including inactive products as attached below
Hello Team, is there anyone can help me ?
Hello @ahmadMamdouh!
To pull all products, including inactive ones, you can use the products query: https://developer.shiphero.com/wp-content/uploads/spectaql/#query-products
Have a great day!
Hello @tomasfd ,
thanks for support , but is there a way to use the query of getting the products and including the lots details for each Product(SKU) , lots details as attached above in the Topic
Hello @ahmadMamdouh!
To get the lots in the products query you must query expiration_lots nested under warehouse_products → locations → expiration_lots.
Here is an example of that query
{
products(sku: "string") {
request_id
complexity
data(last: 1) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
account_id
name
sku
warehouse_products {
id
locations {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
expiration_lot {
id
name
sku
created_at
updated_at
expires_at
received_at
is_active
}
}
}
}
}
}
}
}
}
}
Please let me know if you have any other questions
Hello Austin_Harvey,
thanks for your support, it’s working now , but is there a way to get the quantity in each expiration lot ?
Yes!
Adding “Quantity”
Under the locations nest will get you the values for the quantities, and since you can only have 1 lot per location this will naturally get you the lot values.
{
products(sku: "string") {
request_id
complexity
data(last: 1) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
account_id
name
sku
warehouse_products {
id
locations {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
quantity
expiration_lot {
id
name
sku
created_at
updated_at
expires_at
received_at
is_active
}
}
}
}
}
}
}
}
}
}
Let me know if you have any further questions!