# Queries / Barcodes

# Barcodes

**Query**
## barcodes — Returns [ConnectionType](/documentation/General/Connections) of [ProductBarcode](/documentation/Objects/Products#ProductBarcode)

**Scopes required:** see_products

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

- createdAt
- lastStocktakedAt
- lastSoldAt
- code

| Arguments | Type | Description |
| --- | --- | --- |
| templates | *Boolean* | Whether to return the barcodes that have templates or not (defaults to `false`) |
| createdAtStart | [DateTime](/documentation/Types/Date-Time#DateTime) | Filter barcodes of products created after provided timestamp |
| createdAtEnd | [DateTime](/documentation/Types/Date-Time#DateTime) | Filter barcodes of products created before provided timestamp |
| lastStocktakedAtStart | [DateTime](/documentation/Types/Date-Time#DateTime) | Filter barcodes that have been used in a stocktake after a provided timestamp |
| lastStocktakedAtEnd | [DateTime](/documentation/Types/Date-Time#DateTime) | Filter barcodes that have been used in a stocktake before a provided timestamp |
| lastSoldAtStart | [DateTime](/documentation/Types/Date-Time#DateTime) | Filter barcodes that have been used in a sale after a provided timestamp |
| lastSoldAtEnd | [DateTime](/documentation/Types/Date-Time#DateTime) | Filter barcodes that have been used in a sale before a provided timestamp |
| inventoryLevel | [InventoryLevelFilterEnum](/documentation/Enums/Inventory-Level-Filter-Enum#InventoryLevelFilterEnum) | Filter barcodes of products that match the inventory level filter |
| showHostFileDeleted | *Boolean* | Whether to show the barcodes that have been deleted by a host file |
| onlyDuplicates | *Boolean* | Whether to only show barcodes that have been used multiple times |
| barcode | *String* | Filter for barcodes that exactly matches the provided barcode |

**Example Query**

```graphql
query GetBarcodes($createdAtStart: DateTime) {
    barcodes(createdAtStart: $createdAtStart) {
        edges {
            node {
                quantity,
                code,
                lastSoldAt,
                lastStocktakedAt,
                hostDeletedAt
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "createdAtStart": "<CREATED_AT_START>"
}
```