> 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/mutations/createpickingorderitem.md).

# Create Picking Order Item

createPickingOrderItem Mutation

Creates a new picking order item and associates it with an existing picking order. This allows adding individual items to a picking order after it has been created.

## Arguments

| Name    | Type                           | Description                                    |
| ------- | ------------------------------ | ---------------------------------------------- |
| `input` | `CreatePickingOrderItemInput!` | Input data for creating the picking order item |

## Return Type

`PickingOrderItemOutput` - Contains the created picking order item and any associated workflows.

## Input Fields

`CreatePickingOrderItemInput`:

| Field          | Type      | Description                                                  |
| -------------- | --------- | ------------------------------------------------------------ |
| `dataTypeID`   | `UUID`    | Optional data type ID for custom validation                  |
| `dataTypeSlug` | `String`  | Optional data type slug for custom validation                |
| `data`         | `Map`     | Custom data associated with the order item                   |
| `sku`          | `String!` | Required stock keeping unit (SKU) of the item                |
| `quantity`     | `Int!`    | Required quantity of the item to pick                        |
| `orderID`      | `ID!`     | Required ID of the picking order to associate this item with |

## Usage Example

```graphql
mutation {
  createPickingOrderItem(
    input: {
      sku: "WIDGET-123",
      quantity: 10,
      orderID: "550e8400-e29b-41d4-a716-446655440000",
      data: {
        "priority": "high",
        "location_hint": "Aisle 5, Shelf B",
        "special_handling": "fragile"
      }
    }
  ) {
    pickingOrderItem {
      id
      sku
      quantity
      data
      createdAt
      order {
        id
        customerID
      }
    }
    workflows {
      id
      type
      id
      runID
      status
    }
  }
}
```

## JavaScript Example

```javascript
const createPickingOrderItemMutation = `
  mutation CreatePickingOrderItem($input: CreatePickingOrderItemInput!) {
    createPickingOrderItem(input: $input) {
      pickingOrderItem {
        id
        sku
        quantity
        data
        createdAt
        order {
          id
          customerID
        }
      }
      workflows {
        id
        type
        id
        runID
        status
      }
    }
  }
`;

const variables = {
  input: {
    sku: "WIDGET-123",
    quantity: 10,
    orderID: "550e8400-e29b-41d4-a716-446655440000",
    data: {
      priority: "high",
      location_hint: "Aisle 5, Shelf B",
      special_handling: "fragile"
    }
  }
};

// Using fetch or your preferred GraphQL client
const response = await fetch('/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  body: JSON.stringify({
    query: createPickingOrderItemMutation,
    variables: variables
  })
});

const result = await response.json();
console.log('Created picking order item:', result.data.createPickingOrderItem);
```

## Notes

* The specified `orderID` must exist and be accessible to the current user
* The `sku` should correspond to an existing inventory item
* The `quantity` must be a positive integer
* Custom `data` can include any JSON-serializable information relevant to the item
* Associated workflows may be automatically triggered based on system configuration
* The operation may fail if the picking order is already in a non-editable state


---

# 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/mutations/createpickingorderitem.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.
