# Objects / Stocktake

# Stocktake

**Object**
## ExternalStocktake

### Implements
*List of interfaces this object implements*

- [InventoryLogEventInterface](/documentation/Interfaces/Inventory-Log-Event-Interface#InventoryLogEventInterface)

| Fields | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID for the external stocktake |
| outlet | [Outlet!](/documentation/Objects/Outlets#Outlet) | The Outlet that the stocktake was performed at |
| user | [User!](/documentation/Objects/User#User) | The user that created the stocktake |
| zeroStock | *Boolean!* | Whether all stock was set to zero before the stocktake was applied |
| overrideStock | *Boolean!* | If true, the stock in the stocktake overrides the stock on file, otherwise it adds to the stock on file |
| status | [ExternalStocktakeStatusEnum!](/documentation/Enums/External-Stocktake-Status-Enum#ExternalStocktakeStatusEnum) | The current status of the stocktake |
| timestamp | [DateTime!](/documentation/Types/Date-Time#DateTime) | The time the stocktake was imported into the system |
| completed | [Stocktake](/documentation/Objects/Stocktake#Stocktake) | This is the stocktake that this completed external stocktake is converted into |
| products | [ExternalStocktakeProductConnection](#ExternalStocktakeProductConnection) | The products imported into this stocktake |

## ExternalStocktakeProductConnection
#### Object  —  [ConnectionType](/documentation/General/Connections) of [Product](/documentation/Objects/Products#Product)

### Sortable Fields
*Fields from [Product](/documentation/Objects/Products#Product) that can be used to sort the connection items*

- name
- createdAt
- updatedAt

| Arguments | Type | Description |
| --- | --- | --- |
| search | *String* | If supplied, searches for products that contain the search string in their name or barcode |

| Edge Fields | Type | Description |
| --- | --- | --- |
| barcode | *String!* | The barcode imported |
| name | *String* | The imported name of the product |
| cost | *Float* | The imported unit cost |
| quantity | *Float!* | The quantity of products to import |
| barcodeQuantity | *Float!* | The quantity of the barcode for the product |
| tempProduct | *Boolean!* | Whether the product was imported as a temporary product |



**Object**
## StocktakeApply

| Fields | Type | Description |
| --- | --- | --- |
| stocktake | [Stocktake](/documentation/Objects/Stocktake#Stocktake) | The stocktake that this apply event refers to |
| user | [User](/documentation/Objects/User#User) | The user that applied the stocktake |
| stocktakeOnly | *Boolean* | Whether the stocktake only ignored products not in the stocktake or zeroed them |
| processTime | [DateTime](/documentation/Types/Date-Time#DateTime) | When the stocktake was applied |



**Object**
## StocktakeEvent

| Fields | Type | Description |
| --- | --- | --- |
| product | [Product](/documentation/Objects/Products#Product) | The product that the event applies to |
| type | [StocktakeEventEnum](/documentation/Enums/Stocktake-Event-Enum#StocktakeEventEnum) | The type of the event |
| count | *Float* | The current status for the stocktake |
| user | [User](/documentation/Objects/User#User) | The user that created the event |
| timestamp | [DateTime](/documentation/Types/Date-Time#DateTime) | When the event occurred |



**Object**
## StocktakeProduct

| Fields | Type | Description |
| --- | --- | --- |
| product | [Product](/documentation/Objects/Products#Product) | The product data belongs too |
| cost | *Float* | The cost of the product at the time of the stocktake |
| caseQuantity | *Float* | The case quantity of the product at the time of the stocktake |
| scanned | *Boolean* | Whether the product was scanned in the stocktake |
| expectedCount | *Float* | The expected count of the product at the time of the stocktake |
| expectedValue | *Float* | The expected cost value of the product |
| actualCount | *Float* | The actual count of the product in the stocktake |
| actualValue | *Float* | The actual cost value of the counted product |



**Object**
## StocktakeStatistics

| Fields | Type | Description |
| --- | --- | --- |
| scans | *Float* | The count of all scan events in the stocktake |
| products | *Float* | The count of all the unique products in the stocktake, will return zero if the stocktake hasn't been completed |
| sales | *Float* | The count of all the sales that affected the stocktake |
| firstEventTime | [DateTime](/documentation/Types/Date-Time#DateTime) | The timestamp of the first stocktake event, returns null if the stocktake hasn't received any events |
| users | [[StocktakeUserStatistics]](/documentation/Objects/Stocktake#StocktakeUserStatistics) | The Statistics of the users in the stocktake |



**Object**
## StocktakeTotal

| Fields | Type | Description |
| --- | --- | --- |
| scannedExpectedCount | *Float* | The total expected count of the scanned products at the time of the stocktakes completion |
| scannedExpectedValue | *Float* | The total expected cost value of the scanned products at the time of the stocktakes completion |
| scannedActualCount | *Float* | The total actual count of the scanned products at the time of the stocktakes completion |
| scannedActualValue | *Float* | The total actual cost value of the scanned products at the time of the stocktakes completion |
| notScannedExpectedCount | *Float* | The total expected count of the not scanned products at the time of the stocktakes completion |
| notScannedExpectedValue | *Float* | The total expected cost value of the not scanned products at the time of the stocktakes completion |
| notScannedActualCount | *Float* | The total actual count of the not scanned products at the time of the stocktakes completion |
| notScannedActualValue | *Float* | The total actual cost value of the not counted products at the time of the stocktakes completion |
| allExpectedCount | *Float* | The total expected count of the all products at the time of the stocktakes completion |
| allExpectedValue | *Float* | The total expected cost value of the all products at the time of the stocktakes completion |
| allActualCount | *Float* | The total actual count of the all products at the time of the stocktakes completion |
| allActualValue | *Float* | The total actual cost value of the all products at the time of the stocktakes completion |



**Object**
## Stocktake

### Implements
*List of interfaces this object implements*

- [InventoryLogEventInterface](/documentation/Interfaces/Inventory-Log-Event-Interface#InventoryLogEventInterface)

| Fields | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the stocktake |
| name | *String!* | The name of the stocktake |
| type | [StocktakeTypeEnum](/documentation/Enums/Stocktake-Type-Enum#StocktakeTypeEnum) | The type of the stocktake, Determines what happens when the stocktake is applied. This will be defined when the stocktake is completed |
| source | [ExternalStocktake](/documentation/Objects/Stocktake#ExternalStocktake) | The external stocktake that this stocktake is created from |
| outlet | [Outlet!](/documentation/Objects/Outlets#Outlet) | The Outlet the stocktake is for |
| status | [StocktakeStatusEnum!](/documentation/Enums/Stocktake-Status-Enum#StocktakeStatusEnum) | The current status for the stocktake |
| displayExpected | *Boolean!* | Whether the expected quantity for products should be displayed (in the UI) |
| applied | *Boolean!* | Whether the stocktake has been applied to the inventory yet |
| events | [StocktakeStocktakeEventConnection](#StocktakeStocktakeEventConnection) | The events that occurred in the stocktake |
| products | [StocktakeStocktakeProductConnection](#StocktakeStocktakeProductConnection) | The products at the end of the stocktake |
| statistics | [StocktakeStatistics](/documentation/Objects/Stocktake#StocktakeStatistics) | The statistics of a completed stocktake |
| users | [[User]](/documentation/Objects/User#User) | The users that have scanned anything in a "COMPLETED" stocktake |
| categories | [[Category]](/documentation/Objects/Classifications#Category) | The categories for the partial stocktake |
| totals | [StocktakeTotal](/documentation/Objects/Stocktake#StocktakeTotal) | The totals for the completed stocktake |
| completedBy | [User](/documentation/Objects/User#User) | The user that completed the stocktake |
| createdAt | [DateTime!](/documentation/Types/Date-Time#DateTime) | The date and time that the stocktake was created |
| completedAt | [DateTime](/documentation/Types/Date-Time#DateTime) | The date and time that the stocktake was completed |
| applications | [[StocktakeApply]](/documentation/Objects/Stocktake#StocktakeApply) | A list of all the times the stocktake has been applied to the store's stock file |
| lastApplication | [StocktakeApply](/documentation/Objects/Stocktake#StocktakeApply) | The last time this stocktake was applied |
| potentialVariances | [[StocktakeProduct!]!](/documentation/Objects/Stocktake#StocktakeProduct) | Any products that could have a potential variance that we're not able to automatically resolve |

## StocktakeStocktakeEventConnection
#### Object  —  [ConnectionType](/documentation/General/Connections) of [StocktakeEvent](/documentation/Objects/Stocktake#StocktakeEvent)

### Sortable Fields
*Fields from [StocktakeEvent](/documentation/Objects/Stocktake#StocktakeEvent) that can be used to sort the connection items*

- timestamp

| Arguments | Type | Description |
| --- | --- | --- |
| eventsAfter | [DateTime](/documentation/Types/Date-Time#DateTime) | This argument is used for preventing data duplication via pagination caused by the dynamic nature of this data |
| product | [ID](/documentation/Types/UUID#UUID) | The id of the product to get the events for, this will filter the data |
| user | [ID](/documentation/Types/UUID#UUID) | The id of the user to get the events for, this will filter the data |

## StocktakeStocktakeProductConnection
#### Object  —  [ConnectionType](/documentation/General/Connections) of [StocktakeProduct](/documentation/Objects/Stocktake#StocktakeProduct)

### Sortable Fields
*Fields from [StocktakeProduct](/documentation/Objects/Stocktake#StocktakeProduct) that can be used to sort the connection items*

- product
- expected
- actual
- difference

| Arguments | Type | Description |
| --- | --- | --- |
| scanned | [StocktakeScannedEnum](/documentation/Enums/Stocktake-Scanned-Enum#StocktakeScannedEnum) |  |
| search | *String* | The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. |



**Object**
## StocktakeUserStatistics

| Fields | Type | Description |
| --- | --- | --- |
| user | [User!](/documentation/Objects/User#User) | The user the statistics applies to |
| scans | *Float* | The count of all the unique products in the stocktake |
| products | *Float* | The count of all the sales that affected the stocktake |