Delete Product Unit
Delete a product unit from the system. This operation is permanent and cannot be undone. Consider disabling units instead of deleting them if historical tracking is required.
⚠️ Pre-deletion Checks
The system performs these checks before deletion:
- Unit disabled status
- User group associations
- Related dependencies
- Historical data requirements
📤 Request Format
DELETE /api/v1/units/UNIT-123
Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature
📥 Response Format
Success Response
HTTP/1.1 204 No Content
Error Responses
Unit Not Found (404 Not Found)
{
"statusCode": 404,
"message": "Product unit not found"
}
Unit Still Active (422 Unprocessable Entity)
{
"statusCode": 422,
"message": "Cannot delete an active unit",
"errors": [
{
"field": "disabled",
"message": "Unit must be disabled before deletion"
}
]
}
Deletion Restricted (403 Forbidden)
{
"statusCode": 403,
"message": "Unit deletion is restricted",
"errors": [
{
"reason": "historical_data_required",
"message": "Unit has historical data that must be preserved"
}
]
}
🔒 Required Permissions
units:delete
units:manage
(for force deletion)
💡 Tips and Best Practices
Before Deletion
- Check unit disabled status
- Review user group associations
- Consider historical data needs
- Document deletion reason
- Backup relevant data
Alternative Actions
- Disable the unit (
disabled: true
) - Remove user group association
- Archive unit data
- Update metadata
Common Use Cases
- Removing test units
- Cleaning up inactive units
- Removing duplicate entries
- Managing development instances
⚠️ Important Notes
-
Permanent Action
- Deletion cannot be undone
- Historical data is lost
- Related records may be affected
-
Alternative Options
- Consider disabling instead
- Remove associations
- Archive if needed
-
Impact Assessment
- Check dependencies
- Review associations
- Validate data requirements
-
Compliance
- Follow data retention policies
- Document deletion reasons
- Maintain audit trails