OVIRO LogoOVIRO
Quản lý nhóm sản phẩmBộ sưu tập sản phẩm

Tạo bộ sưu tập

Tạo mới một bộ sưu tập sản phẩm

Endpoint

POST /v1/productcollections

Request Body

TrườngKiểuBắt buộcMô tả
company_idintID công ty
creator_idintID người tạo
namestringTên bộ sưu tập (duy nhất trong công ty)
typeintLoại (1: Auto, 3: Manual)
descriptionstringKhôngMô tả
external_idstringKhôngID tham chiếu ngoài
statusint1 (Active), 3 (Disabled)
avatar_file_id_listarrayKhôngDanh sách ID ảnh đại diện
product_id_listarrayKhôngDanh sách ID sản phẩm (nếu type = 3)
auto_ruleobjectKhôngCấu hình rule tự động (nếu type = 1). Xem Object Schema
seo_urlstringKhôngURL SEO (duy nhất)
seo_titlestringKhôngTitle SEO
seo_meta_descriptionstringKhôngMeta Description
seo_meta_keywordstringKhôngMeta Keyword
seo_graph_file_idintKhôngẢnh SEO Graph
seo_canonicalstringKhôngCanonical URL
seo_optionsobjectKhôngTùy chọn SEO

Ví dụ JSON (Manual)

{
    "company_id": 1,
    "creator_id": 10,
    "name": "Bộ sưu tập thủ công",
    "type": 3,
    "description": "Các sản phẩm hot tháng 12",
    "external_id": "",
    "status": 1,
    "avatar_file_id_list": [],
    "product_id_list": [101, 102, 105],
    "auto_rule": {},
    "seo_url": "bo-suu-tap-thu-cong",
    "seo_title": "Bộ sưu tập thủ công",
    "seo_meta_description": "",
    "seo_meta_keyword": "",
    "seo_graph_file_id": 0,
    "seo_canonical": "",
    "seo_options": {}
}

Ví dụ JSON (Auto)

{
    "company_id": 1,
    "creator_id": 10,
    "name": "Điện thoại Samsung dưới 10tr",
    "type": 1,
    "description": "",
    "external_id": "",
    "status": 1,
    "avatar_file_id_list": [],
    "product_id_list": [],
    "auto_rule": {
        "match_all": 1,
        "conditions": [
            {
                "field": "productname",
                "operand": "contain",
                "value": "Samsung"
            },
            {
                "field": "price",
                "operand": "lessthan",
                "value": "10000000"
            }
        ]
    },
    "seo_url": "",
    "seo_title": "",
    "seo_meta_description": "",
    "seo_meta_keyword": "",
    "seo_graph_file_id": 0,
    "seo_canonical": "",
    "seo_options": {}
}

Response Schema

HTTP 201 - Created

Trả về ProductCollection Object vừa tạo.

Error Codes

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

Mã lỗiMô tả
error_name_requireTên bộ sưu tập không được để trống
error_name_existedTên bộ sưu tập đã tồn tại
error_seo_url_existedSEO URL đã tồn tại
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