stockMovements
Requires at least one of the permissions inventory:stock_adjustment:read, inventory:stock_movement:list, inventory:stock_movement:read or inventory:stock_transfer:read.
Lists stock movements across warehouses, filtered, sorted and paged. Use stockMovementsCount for the total. Needs the stock movement read or list permission, or the stock adjustment or stock transfer read permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query StockMovements {
stockMovements {
totalCount
items {
id
batchNumber
movementNumber
serialNumber
status
type
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query StockMovements {\n stockMovements {\n totalCount\n items {\n id\n batchNumber\n movementNumber\n serialNumber\n status\n type\n }\n }\n}"
}
EOF
Response:
{
"data": {
"stockMovements": {
"totalCount": 0,
"items": [
{
"id": "id",
"batchNumber": "string",
"movementNumber": "string",
"serialNumber": "string",
"status": "CANCELLED",
"type": "ADJUSTMENT"
}
]
}
}
}
stockMovements(
filter: StockMovementFilterInput
orderBy: StockMovementOrderByInput
skip: Int = 0
take: Int = 50
): PaginatedStockMovements!
Arguments
stockMovements.filter ● StockMovementFilterInput input
Optional filters: type, status, warehouse, product, variant, search text, batch, serial number, reference, and created or performed date ranges.
stockMovements.orderBy ● StockMovementOrderByInput input
The field to sort by: creation time, performed time, movement number or quantity.
stockMovements.skip ● Int scalar
How many movements to skip. Defaults to 0.
stockMovements.take ● Int scalar
How many movements to return. Defaults to 50 and is capped at 50,000.
Type
PaginatedStockMovements object
A page of stock movements.