OVIRO LogoOVIRO
Quản lý nhóm sản phẩmĐơn vị tính

Cập nhật đơn vị tính SP

Cập nhật cấu hình đơn vị tính cho sản phẩm

Endpoint

PUT /v1/productuoms/:id

Request Body

TrườngKiểuBắt buộcMô tả
company_idintID công ty
creator_idintID người thao tác
allow_saleintKhôngCho phép bán (1/0)
allow_purchaseintKhôngCho phép nhập (1/0)
allow_stockintKhôngCho phép tồn kho (1/0)
factorintKhôngTỷ lệ quy đổi
weightintKhôngTrọng lượng riêng
is_defaultintKhôngLà đơn vị mặc định (1/0)
display_orderfloatKhôngThứ tự hiển thị
icon_svgstringKhôngIcon SVG tùy chỉnh
file_id_listarrayKhôngDanh sách ID ảnh minh họa

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

Ví dụ JSON

{
    "company_id": 1,
    "creator_id": 10,
    "allow_sale": 1,
    "allow_purchase": 1,
    "allow_stock": 1,
    "factor": 24,
    "weight": 0,
    "is_default": 0,
    "display_order": 2,
    "icon_svg": "",
    "file_id_list": []
}

Response Schema

HTTP 200 - OK

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

Error Codes

Lỗi dữ liệu đầu vào. Trả về mảng các mã lỗi:

Mã lỗiMô tả
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