Chuyển tới nội dung chính

Tạo Sản Phẩm

Tạo mới sản phẩm.

POST/api/v6.1/product

Dữ liệu gửi lên​

Tham sốKiểuBắt buộcMô tả
product_nameStringCóTên sản phẩm
product_codeStringCóMã sản phẩm (SKU)
unit_nameStringCóĐơn vị tính
category_nameStringCóDanh mục sản phẩm
origin_nameStringCóNguồn gốc sản phẩm
manufacturer_nameStringCóNhà sản xuất
short_descriptionStringKhôngMô tả ngắn
descriptionStringKhôngMô tả chi tiết
cover_priceFloatCóGiá niêm yết
price_wholesaleFloatKhôngGiá bán sỉ
discountFloatKhôngMức giảm giá (%)
discount_wholesaleFloatKhôngMức giảm giá bán sỉ (%)
price_onlineFloatKhôngGiá bán trực tuyến
discount_onlineFloatKhôngMức giảm giá trực tuyến (%)
price_average_inFloatKhôngGiá nhập trung bình
discount_inFloatKhôngMức giảm giá nhập vào (%)
saleoff_priceFloatKhôngGiá khuyến mãi
product_vatFloatKhôngThuế VAT (%)
barcodeStringKhôngMã vạch sản phẩm
weightFloatKhôngTrọng lượng
custom_fieldsObjectKhôngCác trường tùy chỉnh
variant_attribute_valuesArrayKhôngDanh sách thuộc tính biến thể

Ví dụ request​

curl --location --request POST 'https://example.getflycrm.com/api/v6.1/product' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <your_api_key>' \
--data-raw '{
"product_name": "Sản phẩm API Test",
"product_code": "SP.TEST.001",
"unit_name": "Hộp",
"category_name": "Thiết bị",
"origin_name": "Việt Nam",
"manufacturer_name": "Công ty ABC",
"short_description": "Sản phẩm dùng thử",
"description": "<p>Mô tả chi tiết sản phẩm</p>",
"cover_price": 20000,
"price_wholesale": 18000,
"discount": 10,
"discount_wholesale": 15,
"price_online": 19000,
"discount_online": 5,
"price_average_in": 15000,
"discount_in": 8,
"saleoff_price": 12,
"product_vat": 5,
"barcode": "BAR123456",
"weight": 500,
"custom_fields": {
"ngay_nhap": 1742317200,
"so_luong": 100,
"gia_ban": "20000"
},
"variant_attribute_values": [
{
"attribute_name": "Màu sắc",
"value_name": "Đỏ",
"additional_price": 2000
},
{
"attribute_name": "Kích thước",
"value_name": "Lớn",
"additional_price": 5000
}
]
}'

Kết quả trả về​

200 OK

{
"message": "Thêm mới thành công",
"data": {
"product_id": 1001,
"product_code": "SP.TEST.001"
}
}
TrườngKiểuMô tả
messageStringThông báo kết quả
dataObjectThông tin sản phẩm vừa tạo
product_idIntegerID sản phẩm mới
product_codeStringMã sản phẩm vừa tạo