Update Product Unit
Update an existing product unit's properties. All fields are optional in update requests - only provided fields will be modified.
π Request Structureβ
Updatable Fieldsβ
description
- Description of the product unitexternalId
- External identifier for the product unitproductVariantId
- ID of the product variantextraFields
- Additional fields as key-value pairsimages
- Array of image URLs for the product unitdisabled
- Whether the unit is disabledtags
- Tags associated with the unituserGroupId
- UUID of the user group
π Field Interpretationβ
- Omitted fields remain unchanged
- All fields are optional in update requests
- Arrays replace existing values
- Objects (extraFields) are merged with existing
- Images must be valid HTTPS URLs
- Tags must be valid title strings
π€ Request Formatβ
PUT /api/v1/units/UNIT-123
Content-Type: application/json
Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature
{
"description": "Updated demo unit for display",
"externalId": "EXT-UNIT-12345",
"productVariantId": "VARIANT-002",
"images": [
"https://example.com/unit1-updated.webp",
"https://example.com/unit2-updated.webp"
],
"disabled": false,
"tags": ["electronics", "updated"],
"extraFields": {
"location": "Store B",
"condition": "Excellent"
},
"userGroupId": "550e8400-e29b-41d4-a716-446655440000"
}
π₯ Response Formatβ
Success Responseβ
HTTP/1.1 200 OK
Content-Type: application/json
{
"externalId": "EXT-UNIT-12345",
"productId": "123e4567-e89b-12d3-a456-426614174000",
"productVariantId": "VARIANT-002",
"productExternalId": "PROD-EXT-123",
"description": "Updated demo unit for display",
"images": [
"https://example.com/unit1-updated.webp",
"https://example.com/unit2-updated.webp"
],
"organizationId": "123e4567-e89b-12d3-a456-426614174000",
"disabled": false,
"userGroupId": "550e8400-e29b-41d4-a716-446655440000",
"extraFields": {
"location": "Store B",
"condition": "Excellent"
}
}
Error Responsesβ
Invalid Request (400 Bad Request)β
{
"statusCode": 400,
"message": "Invalid update parameters",
"errors": [
{
"field": "externalId",
"message": "Must be a valid title string"
}
]
}
Unit Not Found (404 Not Found)β
{
"statusCode": 404,
"message": "Product unit not found"
}
Invalid User Group (422 Unprocessable Entity)β
{
"statusCode": 422,
"message": "Invalid user group ID",
"errors": [
{
"field": "userGroupId",
"message": "User group not found"
}
]
}
π Required Permissionsβ
units:update
units:manage
(for certain fields)
π‘ Tipsβ
- Only include fields that need updating
- Validate all URLs and UUIDs
- Keep descriptions concise
- Update tags thoughtfully
- Consider impact on related systems
- Document significant changes