API Reference

Available queries

StockAdjustment - Returns a single stock adjustment based on the id provided

query {
  StockAdjustment (id: 100012) {
    id
    label
  }
}

StockAdjustments - Returns a list of stock adjustments based on the filter define

query {
  StockAdjustments {
    data {
    	id
    	label
    }
  }
}


Available fields

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 (enum values : active, cancelled, completed, unpublished).
dated_at - Date
Date of the stock adjustment
to_location - Location - Subquery
Destination location if products are moved from a location to an other
line_items - Array of LineItem - Subquery
List of the line items of the order.
has_batch_numbers - Boolean
Define if the stock adjustment has batch numbers
tracking_completed - Boolean
If the stock adjustment has batch numbers, are they all allocated


Filters

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} }

Sorting

You can sort data based on following fields : id, label, notes, total_units, status, dated_at, created_at, to_location_id

Example of a query

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
        }
      }
    }
  }
}
{
  "orderBy": [
    {
      "column": "DATED_AT",
      "order": "DESC"
    },
    {
      "column": "CREATED_AT",
      "order": "DESC"
    }
  ],
  "first": 50,
  "page": 1,
}