Serial numbers in inventory logs

SerialNumberInventoryLog — Returns a single serial number inventory log based on the IDs provided

query GetSerialNumberInventoryLog($inventory_log_id: ID, $serial_number_id: ID) {
  SerialNumberInventoryLog(inventory_log_id: $inventory_log_id, serial_number_id: $serial_number_id) {
    inventory_log_id
    serial_number_id
    status
    location_id
    batch_number_id
    serial_number {
      id
      label
      status
    }
    inventory_log {
      id
    }
    location {
      id
      label
    }
    batch_number {
      id
      label
    }
  }
}
{
  "data": {
    "SerialNumberInventoryLog": {
      "inventory_log_id": 200001,
      "serial_number_id": 50001,
      "status": "active",
      "location_id": 100245,
      "batch_number_id": 100010,
      "serial_number": {
        "id": 50001,
        "label": "SN-001",
        "status": "active"
      },
      "inventory_log": { "id": 200001 },
      "location": { "id": 100245, "label": "Warehouse A" },
      "batch_number": { "id": 100010, "label": "BATCH-A001" }
    }
  }
}

SerialNumberInventoryLogs — Returns a list of serial number inventory logs with grouping, filters, and ordering

query SerialNumberInventoryLogs(
  $where: QuerySerialNumberInventoryLogsWhereWhereConditions,
  $orderBy: [QuerySerialNumberInventoryLogsOrderByOrderByClause!]
) {
  SerialNumberInventoryLogs(
    where: $where
    orderBy: $orderBy
  ) {
    inventory_log_id
    serial_number_id
    status
    location_id
    batch_number_id
    serial_number {
      id
      label
    }
    inventory_log {
      id
    }
    location {
      id
      label
    }
    batch_number {
      id
      label
    }
  }
}
{
  "where": {
    "AND": [
      { "column": "SERIAL_NUMBER_ID", "operator": "EQ", "value": 50001 }
    ]
  },
  "orderBy": [
    { "column": "INVENTORY_LOG_ID", "order": "DESC" }
  ]
}

Available fields

FieldTypeDescription
inventory_log_idIntID of the linked inventory log.
serial_number_idIntID of the linked serial number.
statusStringStatus of the serial number in this log entry.
location_idIntID of the linked location.
batch_number_idIntID of the linked batch number.
serial_numberObjectAssociated serial number entity.
inventory_logObjectAssociated inventory log entity.
locationObjectAssociated location entity.
batch_numberObjectAssociated batch number entity.

Filters

FieldExample
inventory_log_id{ "column": "INVENTORY_LOG_ID", "operator": "EQ", "value": 200001 }
serial_number_id{ "column": "SERIAL_NUMBER_ID", "operator": "EQ", "value": 50001 }
status{ "column": "STATUS", "operator": "EQ", "value": "active" }
location_id{ "column": "LOCATION_ID", "operator": "EQ", "value": 100245 }
batch_number_id{ "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 100010 }
serial_number_label{ "column": "SERIAL_NUMBER_LABEL", "operator": "LIKE", "value": "%SN-%" }

Sorting

You can sort data based on following fields: inventory_log_id, serial_number_id, status, location_id, batch_number_id

query SortSerialNumberInventoryLogs {
  SerialNumberInventoryLogs(
    orderBy: [{ column: SERIAL_NUMBER_ID, order: ASC }]
  ) {
    inventory_log_id
    serial_number_id
    status
    location_id
    batch_number_id
    serial_number {
      id
      label
    }
  }
}

Example of data returned

{
  "data": {
    "SerialNumberInventoryLogs": [
      {
        "inventory_log_id": 200001,
        "serial_number_id": 50001,
        "status": "active",
        "location_id": 100245,
        "batch_number_id": 100010,
        "serial_number": { "id": 50001, "label": "SN-001", "status": "active" },
        "inventory_log": { "id": 200001 },
        "location": { "id": 100245, "label": "Warehouse A" },
        "batch_number": { "id": 100010, "label": "BATCH-A001" }
      },
      {
        "inventory_log_id": 200002,
        "serial_number_id": 50002,
        "status": "sold",
        "location_id": 100246,
        "batch_number_id": 100011,
        "serial_number": { "id": 50002, "label": "SN-002", "status": "sold" },
        "inventory_log": { "id": 200002 },
        "location": { "id": 100246, "label": "Warehouse B" },
        "batch_number": { "id": 100011, "label": "BATCH-A002" }
      }
    ]
  }
}