OVIRO LogoOVIRO
Quản lý nhóm sản phẩmThuộc tính

Cập nhật thuộc tính

Cập nhật thông tin một thuộc tính

Endpoint

PUT /v1/attributes/:id

Quyền: product.manageattribute

Request Body

TrườngKiểuBắt buộcMô tả
company_idintID công ty
creator_idintID người thao tác
attribute_group_idintKhôngID nhóm thuộc tính (dùng để check trùng tên)
namestringTên thuộc tính (duy nhất trong nhóm)
typeintLoại dữ liệu (1:Text, 3:Number, 5:Boolean, 7:Date, 9:Single Select, 11:Multi Select)
statusint1 (Kích hoạt), 3 (Vô hiệu hóa)
descriptionstringKhôngMô tả
file_idintKhôngID file ảnh/icon
optionsarrayKhôngMảng các giá trị tùy chọn
allow_web_filterintKhôngCho phép lọc trên web (1: Có, 0: Không)
default_showintKhôngMặc định hiển thị (1: Có, 0: Không)
display_orderfloatKhôngThứ tự hiển thị

Lưu ý: attribute_group_id KHÔNG thể thay đổi khi edit (chỉ gán khi tạo).

Ví dụ JSON

{
    "company_id": 1,
    "creator_id": 10,
    "attribute_group_id": 10,
    "name": "Màu sắc cập nhật",
    "type": 9,
    "status": 1,
    "description": "Cập nhật mô tả",
    "file_id": 0,
    "options": ["Xanh", "Đỏ", "Vàng", "Trắng"],
    "allow_web_filter": 1,
    "default_show": 1,
    "display_order": 2
}

Response Schema

HTTP 200 - OK

Trả về Attribute Object sau khi cập nhật.

Error Codes

Mã lỗiMô tả
error_name_requiredTên thuộc tính không được để trống
error_name_existedTên thuộc tính đã tồn tại trong nhóm này
error_status_not_existTrạng thái không hợp lệ
error_file_id_not_validID file không hợp lệ
error_company_id_requiredID công ty không được để trống
error_company_id_notfoundID công ty không tìm thấy
error_user1_id_requiredID người tạo không được để trống
error_user_id_notfoundID người tạo không tìm thấy

On this page