Filter products by status
Retrieve products filtered by one or more statuses.
Query
query FilterByStatus($statuses: [ProductStatus!]) {
products(input: {
statuses: $statuses
}) {
itemsFound
items {
... on Product {
productId
sku
status
orderable
}
}
}
}
Variables
{
"statuses": ["A", "N", "P"]
}
Response
{
"data": {
"products": {
"itemsFound": 477,
"items": [
{ "productId": 25, "sku": "BOSCH-GBH-2-26", "status": "A", "orderable": "Y" },
{ "productId": 117, "sku": "MKT-BROCHURE-A4", "status": "N", "orderable": "Y" }
]
}
}
}
How it works
Without statuses, the query only returns products with status A (Available). To include all statuses, pass ["A", "N", "P", "S", "R", "T"]. The status and orderable fields are independent and can conflict — a product can have status N but orderable: Y. Your application should check both fields.
Status codes: A = Available, N = Not Available, P = Phase Out, S = Presale, R = Restricted, T = Out of Stock.