Inventory Device Operation
Update inventory device operation records with new data and status information.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Endpoints
PUT /inventory_device_operation/{id}/
Update an existing inventory device operation record. This endpoint allows you to modify operation details, status, and associated metadata for a specific device operation.
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | Unique identifier of the inventory device operation |
| data | string | body | Yes | JSON data containing the operation details to update |
Example Request:
PUT /api/v1/inventory_device_operation/123/
Content-Type: application/json
Authorization: Bearer <your-api-token>
{
"operation_type": "maintenance",
"status": "completed",
"device_id": "DEV-001",
"operator_id": "OP-456",
"description": "Routine maintenance check performed",
"started_at": "2024-01-15T10:00:00Z",
"completed_at": "2024-01-15T11:30:00Z",
"notes": "All systems functioning normally",
"location": "Warehouse A - Section 3"
}
Example Response:
{
"id": 123,
"operation_type": "maintenance",
"status": "completed",
"device_id": "DEV-001",
"operator_id": "OP-456",
"description": "Routine maintenance check performed",
"started_at": "2024-01-15T10:00:00Z",
"completed_at": "2024-01-15T11:30:00Z",
"notes": "All systems functioning normally",
"location": "Warehouse A - Section 3",
"created_at": "2024-01-15T09:45:00Z",
"updated_at": "2024-01-15T11:30:15Z"
}
| Status | Description |
|---|---|
| 200 | Operation updated successfully |
| 400 | Invalid request data or malformed JSON |
| 401 | Unauthorized - invalid or missing token |
| 404 | Operation not found |
| 422 | Validation error - check required fields |
Best Practices
- Always validate operation status transitions before updating (e.g., don't change from "completed" back to "in_progress" without proper justification)
- Include timestamps for operation lifecycle events to maintain accurate audit trails
- Use descriptive operation types and standardized status values for consistency
- Ensure device_id references exist in your inventory system before creating operations
- Consider implementing optimistic locking for concurrent operation updates
- Store detailed notes for maintenance operations to support compliance and troubleshooting
- Use proper error handling to catch validation errors and provide meaningful feedback to users