> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/queries/receivinginbounditems.md).

# Receiving Inbound Items

receivingInboundItems Query

Audience: Programmers

Returns a paginated list of ReceivingInboundItem objects, with optional filtering and ordering. This query retrieves individual items that are part of receiving inbound shipments.

## Arguments

| Name      | Type                             | Description                                                              |
| --------- | -------------------------------- | ------------------------------------------------------------------------ |
| `after`   | `Cursor`                         | Returns the elements in the list that come after the specified cursor    |
| `first`   | `Int`                            | Returns the first *n* elements from the list                             |
| `before`  | `Cursor`                         | Returns the elements in the list that come before the specified cursor   |
| `last`    | `Int`                            | Returns the last *n* elements from the list                              |
| `orderBy` | `ReceivingInboundItemOrder`      | Ordering options for ReceivingInboundItems returned from the connection  |
| `where`   | `ReceivingInboundItemWhereInput` | Filtering options for ReceivingInboundItems returned from the connection |

## Return Type

`ReceivingInboundItemConnection!` - A connection to a list of [ReceivingInboundItem](/graphql-api/types/receivinginbounditem.md) objects with pagination information.

## Notes

* The `data` field contains custom inbound item attributes as JSON
* Use `Data`, `DataHasKey`, `DataIn`, and `DataContains` filters to query based on JSON content
* Items are linked to their parent inbound shipment via `inboundID`
* Each item tracks its SKU and expected quantity
* Soft delete is supported through `deletedAt` and `deletedBy` fields

## Usage Examples

### Basic Query

```graphql
query {
  receivingInboundItems(
    first: 10,
    orderBy: { direction: DESC, field: CREATED_AT }
  ) {
    edges {
      node {
        id
        sku
        quantity
        inboundID
        dataTypeSlug
        data
        createdAt
      }
      cursor
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}
```

### Query Items by Inbound Shipment

```graphql
query {
  receivingInboundItems(
    where: {
      inboundID: "550e8400-e29b-41d4-a716-446655440000"
    }
  ) {
    edges {
      node {
        id
        sku
        quantity
        data
        inbound {
          id
          orderID
          supplierID
        }
      }
    }
    totalCount
  }
}
```

### Query Items by SKU

```graphql
query {
  receivingInboundItems(
    where: {
      skuContains: "PROD"
    },
    orderBy: { direction: ASC, field: SKU }
  ) {
    edges {
      node {
        id
        sku
        quantity
        inboundID
        dataTypeSlug
        createdAt
      }
    }
  }
}
```

### Query with Data Field Filtering

```graphql
query {
  receivingInboundItems(
    where: {
      DataHasKey: "lot_number",
      dataTypeSlug: "inbound_item"
    }
  ) {
    edges {
      node {
        id
        sku
        quantity
        data
        inbound {
          id
          supplierID
        }
      }
    }
  }
}
```

### JavaScript/TypeScript Example

```typescript
import { GraphQLClient } from 'graphql-request';

const client = new GraphQLClient('https://api.pyck.app/graphql', {
  headers: {
    authorization: `Bearer ${accessToken}`,
  },
});

const query = `
  query GetReceivingInboundItems($inboundID: ID!, $first: Int) {
    receivingInboundItems(
      where: { inboundID: $inboundID },
      first: $first,
      orderBy: { direction: ASC, field: SKU }
    ) {
      edges {
        node {
          id
          sku
          quantity
          dataTypeSlug
          data
          createdAt
          createdBy
        }
      }
      totalCount
    }
  }
`;

const variables = {
  inboundID: "550e8400-e29b-41d4-a716-446655440000",
  first: 20
};

const response = await client.request(query, variables);
console.log(`Found ${response.receivingInboundItems.totalCount} items`);
response.receivingInboundItems.edges.forEach(edge => {
  const item = edge.node;
  console.log(`SKU: ${item.sku}, Quantity: ${item.quantity}`);
  if (item.data) {
    console.log('Item data:', JSON.stringify(item.data, null, 2));
  }
});
```

## Ordering Options

The `ReceivingInboundItemOrderField` enum supports the following fields:

* `TENANT_ID`: Order by tenant identifier
* `CREATED_AT`: Order by creation timestamp
* `CREATED_BY`: Order by creator user ID
* `UPDATED_AT`: Order by last update timestamp
* `UPDATED_BY`: Order by last updater user ID
* `DELETED_AT`: Order by deletion timestamp
* `DELETED_BY`: Order by deleter user ID
* `SKU`: Order by stock keeping unit
* `INBOUND_ID`: Order by parent inbound shipment ID
* `QUANTITY`: Order by expected quantity

## Filtering Options

The `ReceivingInboundItemWhereInput` supports filtering by:

* All standard field predicates (equality, inequality, contains, etc.)
* `hasInbound`: Filter items that have an associated inbound
* `hasInboundWith`: Filter items based on properties of the parent inbound
* JSON data field queries using `Data`, `DataHasKey`, `DataIn`, and `DataContains`

## Related Types

* [ReceivingInboundItem](/graphql-api/types/receivinginbounditem.md) - The item type returned by this query
* [ReceivingInbound](/graphql-api/types/receivinginbound.md) - The parent inbound shipment type
* [PageInfo](/graphql-api/types/pageinfo.md) - Pagination information

## Service

This query is provided by the **Receiving** service, which manages all inbound shipment operations including item receiving, quality control, and put-away processes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/queries/receivinginbounditems.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
