Stock adjustments are the documents recording corrections to inventory quantities and the reason of the change.
GraphQL
query {
StockAdjustment (id: 100012) {
id
label
}
}
GraphQL
query {
StockAdjustments {
data {
id
label
}
}
}
id – Int Unique identifier of the stock adjustment
label – String Title of the stock adjustment
notes – String Notes attached to the stock adjustment
total_units – Float Total units of the stock adjustment
status – Enum Status of the stock adjustment (active, cancelled, completed, unpublished)
dated_at – Date Date of the stock adjustment
to_location – Location – Subquery Destination location if products are moved from one location to another
line_items – Array of LineItem – Subquery List of the line items of the order
has_batch_numbers – Boolean Defines if the stock adjustment has batch numbers
tracking_completed – Boolean Indicates if all batch numbers are allocated when applicable
You can create filters based on following fields
label Example:{ "column" : "LABEL", "operator" : "LIKE", "value" : "%011%" }
status Example: { column": "STATUS", "operator": "EQ", "value": {"id": "completed"}
total_units Example:{ "column": "TOTAL_UNITS", "operator": "GT", "value": 50 }
dated_at Example: { "column": "DATED_AT", "operator": "EQ", "value": "2024-01-11" }
to_location_id Example: { "column": "TO_LOCATION_ID", "operator": "EQ", "value": 100002 }
location_id Example: { "column": "LOCATION_ID", "operator": "EQ", "value": 100002 }
variant_id Stock adjustment containing this variant Example: { "column": "VARIANT_ID", "operator": "EQ", "value": 100076 }
variant_label Example: { "column": "VARIANT_LABEL", "operator": "EQ", "value": "NICE SHOES" }
variant_sku Example: { "column": "VARIANT_SKU", "operator": "EQ", "value": "10ABC45" }
batch_number_id Example: { "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": "100024" }
tracking_completed Example: { "column": "TRACKING_COMPLETED", "operator": "EQ", "value": {"id": true} }
has_batch_numbers Example :{ column": "HAS_BATCH_NUMBERS", "operator": "EQ", "value": {"id": true} }
You can sort data based on following fields : id, label, notes, total_units, status, dated_at, created_at, to_location_id
GraphQL
query StockAdjustments(
$orderBy: [QueryStockAdjustmentsOrderByOrderByClause!],
$where: QueryStockAdjustmentsWhereWhereConditions,
$first: Int = 50,
$page: Int
) {
StockAdjustments(
orderBy: $orderBy
where: $where
first: $first
page: $page
) {
paginatorInfo {
total
count
currentPage
perPage
}
data {
id
label
to_location {
id
label
}
dated_at
total_units
status
line_items {
id
cost
location {
id
label
}
}
}
}
}
JSON
{
"orderBy": [
{
"column": "DATED_AT",
"order": "DESC"
},
{
"column": "CREATED_AT",
"order": "DESC"
}
],
"first": 50,
"page": 1,
}
# Enums
## StockAdjustmentStatus enum
| Value | Description |
| :--- | :--- |
| `active` | The stock adjustment is active |
| `cancelled` | The stock adjustment is cancelled |
| `completed` | The stock adjustment is completed |
| `unpublished` | The stock adjustment is not yet published |