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

# Update Inventory Item Movement

Update Inventory Item Movement Mutation

Updates an existing ItemMovement object in the system with new data.

## Arguments

| Name    | Type                       | Description                                          |
| ------- | -------------------------- | ---------------------------------------------------- |
| `id`    | `ID!`                      | The unique identifier of the item movement to update |
| `input` | `UpdateItemMovementInput!` | Input data for updating the item movement            |

## Return Type

`InventoryItemMovementOutput` - Contains the updated item movement and any related workflows.

## Input Fields

`UpdateItemMovementInput`:

| Field               | Type                    | Description                                          |
| ------------------- | ----------------------- | ---------------------------------------------------- |
| `dataTypeID`        | `UUID`                  | Optional data type ID to associate with the movement |
| `clearDataTypeID`   | `Boolean`               | Clear the existing data type ID                      |
| `dataTypeSlug`      | `String`                | Optional data type slug                              |
| `clearDataTypeSlug` | `Boolean`               | Clear the existing data type slug                    |
| `data`              | `Map`                   | Custom data associated with the movement             |
| `clearData`         | `Boolean`               | Clear the existing custom data                       |
| `handler`           | `String`                | Handler responsible for processing the movement      |
| `blockedBy`         | `ItemMovementBlockedBy` | Reason why the movement is blocked (if applicable)   |
| `clearBlockedBy`    | `Boolean`               | Clear the blocked status                             |

## ItemMovementBlockedBy Options

Possible reasons why an item movement might be blocked:

* `INSUFFICIENT_STOCK` - Not enough stock in the source repository
* `REPOSITORY_LOCKED` - Source or destination repository is locked
* `ITEM_RESERVED` - Item is reserved for another operation
* `AUTHORIZATION_REQUIRED` - Movement requires additional authorization
* `QUALITY_HOLD` - Item is on quality hold
* `SYSTEM_MAINTENANCE` - System is under maintenance
* `WORKFLOW_DEPENDENCY` - Waiting for dependent workflow to complete

## Return Fields

`InventoryItemMovementOutput`:

| Field                   | Type                 | Description                                    |
| ----------------------- | -------------------- | ---------------------------------------------- |
| `inventoryItemMovement` | `ItemMovement`       | The updated item movement                      |
| `workflows`             | `[TemporalWorkflow]` | Related workflow instances that were triggered |

## Usage Example

```graphql
mutation {
  updateInventoryItemMovement(
    id: "movement_123"
    input: {
      handler: "warehouse_operator_456",
      data: {
        "priority": "high",
        "scheduled_time": "2024-12-01T10:00:00Z",
        "special_instructions": "Handle with care - fragile electronics",
        "equipment_required": ["forklift", "protective_padding"],
        "estimated_duration_minutes": 15,
        "quality_check_required": true
      },
      dataTypeSlug: "priority_movement",
      clearBlockedBy: true
    }
  ) {
    inventoryItemMovement {
      id
      quantity
      executed
      handler
      blockedBy
      data
      dataTypeSlug
      fromRepository {
        id
        name
      }
      toRepository {
        id
        name
      }
      item {
        id
        sku
      }
      updatedAt
      updatedBy
    }
    workflows {
      id
      type
      status
      runID
    }
  }
}
```

## JavaScript Example

```javascript
const UPDATE_INVENTORY_ITEM_MOVEMENT = gql`
  mutation UpdateInventoryItemMovement($id: ID!, $input: UpdateItemMovementInput!) {
    updateInventoryItemMovement(id: $id, input: $input) {
      inventoryItemMovement {
        id
        quantity
        executed
        handler
        blockedBy
        data
        dataTypeSlug
        fromRepository {
          id
          name
        }
        toRepository {
          id
          name
        }
        item {
          id
          sku
        }
        updatedAt
        updatedBy
      }
      workflows {
        id
        type
        status
        runID
      }
    }
  }
`;

const { data } = await client.mutate({
  mutation: UPDATE_INVENTORY_ITEM_MOVEMENT,
  variables: {
    id: "movement_123",
    input: {
      handler: "warehouse_operator_456",
      data: {
        priority: "high",
        scheduled_time: "2024-12-01T10:00:00Z",
        special_instructions: "Handle with care - fragile electronics",
        equipment_required: ["forklift", "protective_padding"],
        estimated_duration_minutes: 15,
        quality_check_required: true
      },
      dataTypeSlug: "priority_movement",
      clearBlockedBy: true
    }
  }
});
```

## Important Notes

* **Movement State**: Only non-executed movements can be updated
* **Handler Assignment**: Updating the handler reassigns responsibility for the movement
* **Blocked Status**: Use `clearBlockedBy: true` to unblock a movement
* **Workflow Impact**: Updates may trigger workflows for scheduling, resource allocation, or notifications
* **Data Validation**: The system validates that movement parameters are consistent with business rules
* **Audit Tracking**: All updates to movements are logged for audit purposes

## Common Update Scenarios

1. **Reassign Handler**: Change who is responsible for executing the movement
2. **Update Priority**: Mark a movement as high priority for expedited processing
3. **Add Instructions**: Include special handling or safety instructions
4. **Unblock Movement**: Clear blocking conditions when resolved
5. **Schedule Timing**: Set or update when the movement should occur


---

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