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

# Update Picking Order Item

updatePickingOrderItem Mutation

Updates an existing picking order item with new data. This allows modification of item details such as quantity, SKU, and custom data.

## Arguments

| Name    | Type                           | Description                                     |
| ------- | ------------------------------ | ----------------------------------------------- |
| `id`    | `ID!`                          | Required ID of the picking order item to update |
| `input` | `UpdatePickingOrderItemInput!` | Input data for updating the picking order item  |

## Return Type

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

## Input Fields

`UpdatePickingOrderItemInput`:

| Field               | Type      | Description                                   |
| ------------------- | --------- | --------------------------------------------- |
| `dataTypeID`        | `UUID`    | Optional data type ID for custom validation   |
| `clearDataTypeID`   | `Boolean` | Clear the current data type ID                |
| `dataTypeSlug`      | `String`  | Optional data type slug for custom validation |
| `clearDataTypeSlug` | `Boolean` | Clear the current data type slug              |
| `data`              | `Map`     | Custom data associated with the order item    |
| `clearData`         | `Boolean` | Clear all custom data                         |
| `sku`               | `String`  | Stock keeping unit (SKU) of the item          |
| `quantity`          | `Int`     | Quantity of the item to pick                  |
| `orderID`           | `ID`      | ID of the picking order this item belongs to  |

## Usage Example

```graphql
mutation {
  updatePickingOrderItem(
    id: "item-550e8400-e29b-41d4-a716-446655440000",
    input: {
      sku: "WIDGET-456-UPDATED",
      quantity: 15,
      data: {
        "priority": "urgent",
        "location_hint": "Aisle 3, Shelf A",
        "special_handling": "temperature_controlled",
        "notes": "Updated quantity due to inventory adjustment"
      }
    }
  ) {
    pickingOrderItem {
      id
      sku
      quantity
      data
      updatedAt
      order {
        id
        customerID
      }
    }
    workflows {
      id
      type
      id
      runID
      status
    }
  }
}
```

## JavaScript Example

```javascript
const updatePickingOrderItemMutation = `
  mutation UpdatePickingOrderItem($id: ID!, $input: UpdatePickingOrderItemInput!) {
    updatePickingOrderItem(id: $id, input: $input) {
      pickingOrderItem {
        id
        sku
        quantity
        data
        updatedAt
        order {
          id
          customerID
        }
      }
      workflows {
        id
        type
        id
        runID
        status
      }
    }
  }
`;

const variables = {
  id: "item-550e8400-e29b-41d4-a716-446655440000",
  input: {
    sku: "WIDGET-456-UPDATED",
    quantity: 15,
    data: {
      priority: "urgent",
      location_hint: "Aisle 3, Shelf A",
      special_handling: "temperature_controlled",
      notes: "Updated quantity due to inventory adjustment"
    }
  }
};

// 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: updatePickingOrderItemMutation,
    variables: variables
  })
});

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

## Clearing Data Example

You can also clear specific fields using the clear flags:

```graphql
mutation {
  updatePickingOrderItem(
    id: "item-550e8400-e29b-41d4-a716-446655440000",
    input: {
      clearData: true,
      clearDataTypeID: true,
      quantity: 20
    }
  ) {
    pickingOrderItem {
      id
      sku
      quantity
      data
      dataTypeID
    }
  }
}
```

## Changing Order Association

You can also move an item to a different picking order:

```graphql
mutation {
  updatePickingOrderItem(
    id: "item-550e8400-e29b-41d4-a716-446655440000",
    input: {
      orderID: "new-order-123e4567-e89b-12d3-a456-426614174000"
    }
  ) {
    pickingOrderItem {
      id
      order {
        id
        customerID
      }
    }
  }
}
```

## Notes

* The picking order item must exist and be accessible to the current user
* Updates may trigger associated workflows depending on system configuration
* Use clear flags (e.g., `clearData`, `clearDataTypeID`) to explicitly remove data
* The `quantity` must be a positive integer if provided
* The `sku` should correspond to a valid inventory item if provided
* Changing the `orderID` moves the item to a different picking order
* Some fields may not be editable if the item's picking order is in certain workflow states
* Custom `data` can include any JSON-serializable information relevant to the item


---

# 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/updatepickingorderitem.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.
