API Reference

Available queries

BatchNumber - Returns a single Batch number based on the id provided

query {
  BatchNumber (id: 100012) {
    id
    label
    barcode
    expiry_date
  }
}

BatchNumbers - Returns a list of batch numbers based on the filter define

query {
  BatchNumbers {
    data {
    	id
    	label
        barcode
    }
  }
}


Available fields

id - Int
Unique identifier of the Batch
label - String
Name of the batch
barcode - String
Barcode of the batch
expiry_date - DateTime
Date when the batch is expiring
variant_sku - String
Sku of the variant of the batch
variant_label - String
Label of the variant of the batch
variant_type - String
Type of the variant of the batch (normal, kit, ...)
variant - Variant
Variant of the batch
stock_levels - Array of StockLevel
Stock levels of the batch on the locations


Filters

You can create filters based on following fields

label
Example:{ "column" : "LABEL", "operator" : "LIKE", "value" : "%011%" }
barcode
Example: { "column" : "BARCODE", "operator" : "LIKE", "value" : "111212887%" }
variant_sku
Example: { "column" : "VARIANT_SKU", "operator" : "LIKE", "value" : "DE889%" }
Variant_id
Example:{ "column": "VARIANT_ID", "operator": "EQ", "value": 1000001 }
expiry_date
Example:{ "column": "EXPIRY_DATE", "operator": "GT", "value": "2023-12-01" }

Sorting

You can sort data based on following fields : id, label, barcode, expiry_date, variant_sku, variant_id

query BatchNumbers(
  $orderBy: [QueryBatchNumbersOrderByOrderByClause!], 
  $first: Int = 50, 
  $page: Int
) {
  BatchNumbers(
    orderBy: $orderBy
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      sku
      barcode
      label
      expiry_date
    }
  }
}
{
  "orderBy": [
    {
      "column": "EXPIRY_DATE",
      "order": "ASC"
    },
  ],
  "first": 50,
  "page": 1,
}