Delete Inventory Item Movement
Delete Inventory Item Movement Mutation
Deletes an existing ItemMovement object from the system, removing a planned or pending movement of inventory items between repositories.
The unique identifier of the item movement to delete
InventoryItemMovementDeletePayload! - Contains information about the deleted movement and related workflows.
InventoryItemMovementDeletePayload:
The ID of the deleted item movement
Workflow instances that were triggered by the deletion
mutation {
deleteInventoryItemMovement(id: "movement_123") {
deletedID
workflows {
id
type
status
runID
}
}
}
JavaScript Example
Important Notes
Movement State: Only non-executed movements can be deleted. Executed movements become part of the audit trail and cannot be removed
Workflow Triggers: The deletion may trigger cleanup workflows or notification workflows
Authorization: Ensure you have proper permissions before deleting item movements
Data Integrity: The system will prevent deletion if the movement is part of an active collection or order
Stock Impact: Deleting a movement does not affect current stock levels, as the movement was never executed
Audit Trail: Deletion events are logged for compliance and audit purposes
Recovery: Once deleted, the item movement cannot be recovered through the API
After deleting an item movement, you may need to:
Update related collection movements if this was part of a batch
Reassign responsibilities to other handlers
Notify stakeholders about the canceled movement
Create replacement movements if the transfer is still needed
Common Deletion Scenarios
Cancel Planned Movement: Remove a movement that is no longer needed
Correct Errors: Delete movements created with incorrect parameters
Workflow Cleanup: Remove movements that were part of a canceled workflow
Resource Optimization: Delete redundant or duplicate movements
Order Cancellation: Remove movements associated with canceled orders
Common scenarios that may prevent deletion:
Executed Movement: Cannot delete a movement that has already been executed. The system will return the error: "cannot delete an executed movement"
Reason: Executed movements have already transferred physical stock and are part of the permanent audit trail
Solution: Only pending (non-executed) movements can be deleted. For executed movements, consider creating a reverse movement instead
Insufficient Permissions: User lacks permission to delete the movement
Active References: The movement is referenced in active workflows or collections
System Constraints: Business rules prevent deletion due to operational requirements
When attempting to delete an executed movement, handle the error appropriately: