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

Danh Sách Sản Phẩm

Lấy danh sách sản phẩm.

GET/api/v6.1/products

Tham số truy vấn​

Tham sốKiểuBắt buộcMô tả
fieldsstringCóDanh sách các trường dữ liệu cần lấy
limitintegerKhôngSố lượng bản ghi cần lấy
offsetintegerKhôngSố lượng bản ghi cần bỏ qua
sortstringKhôngTrường sắp xếp (id, created_at, updated_at) và hướng (asc, desc)

Ví dụ request​

curl --location 'https://example.getflycrm.com/api/v6.1/products?fields=id%2Cproduct_name%2Cproduct_code%2Cprice_online%2Ccreated_at&limit=1' \
--header 'X-API-KEY: <your_api_key>'

Kết quả trả về​

200 OK

{
"data": [
{
"id": 2531,
"category_id": 2,
"category_name": "Giả dược",
"origin_id": 1,
"origin_name": "Nhật",
"unit_id": 18,
"unit_name": "Bánh",
"manufacturer_id": 1,
"manufacturer_name": "T.c áo đen",
"services": 0,
"saleoff_price": 10,
"created_at": "2025-03-13 14:58:11",
"updated_at": "2025-03-13 14:58:11",
"featured_image": "https://example.getflycrm.com/uploads/...",
"product_name": "Sản phẩm Demo API",
"product_code": "SP.00192",
"last_active": "2025-03-13 14:58:11",
"description": "<p>Mô tả dài</p>",
"cover_price": 19000,
"price_wholesale": 25000,
"discount": 5,
"short_description": "Mô tả ngắn",
"discount_wholesale": 5,
"price_online": 21000,
"discount_online": 5,
"price_average_in": 15000,
"discount_in": 10,
"product_vat": 10,
"weight": 16,
"detail_custom_fields": {
"ngay_nhap": "1741798800",
"truong_so": "12",
"gia_si": "111111"
},
"variant_attribute_values": [
{ "value_id": 12, "attribute_id": 6, "attribute_name": "Loại nhân", "value_name": "Trứng thịt" },
{ "value_id": 31, "attribute_id": 6, "attribute_name": "Loại nhân", "value_name": "Thập cẩm" },
{ "value_id": 15, "attribute_id": 7, "attribute_name": "Vỏ bánh", "value_name": "Nướng giòn" },
{ "value_id": 16, "attribute_id": 7, "attribute_name": "Vỏ bánh", "value_name": "Mềm" }
],
"variant_attributes": [
{ "attribute_id": 6, "attribute_name": "Loại nhân" },
{ "attribute_id": 7, "attribute_name": "Vỏ bánh" }
],
"images": [
{
"id": 5,
"file_name": "fixed_sleepy_coder.png",
"thumbnail_file": "https://example.getflycrm.com/uploads/...",
"created_at": 1741852691,
"product_id": 2531
}
]
}
],
"has_more": true,
"offset": 0,
"limited": 1,
"sorted": {
"id": "DESC"
}
}
TrườngKiểuMô tả
dataArrayDanh sách sản phẩm
idIntegerID sản phẩm
category_idIntegerID danh mục sản phẩm
category_nameStringTên danh mục sản phẩm
origin_idIntegerID nguồn gốc sản phẩm
origin_nameStringTên nguồn gốc sản phẩm
unit_idIntegerID đơn vị tính
unit_nameStringTên đơn vị tính
manufacturer_idIntegerID nhà sản xuất
manufacturer_nameStringTên nhà sản xuất
servicesBooleanLà sản phẩm dịch vụ hay không
saleoff_priceFloatGiá khuyến mãi
created_atTimestampNgày tạo sản phẩm
updated_atTimestampNgày cập nhật sản phẩm
featured_imageStringURL ảnh đại diện
product_nameStringTên sản phẩm
product_codeStringMã sản phẩm
last_activeTimestampThời gian hoạt động cuối
descriptionStringMô tả sản phẩm
cover_priceFloatGiá gốc
price_wholesaleFloatGiá bán sỉ
discountFloatMức giảm giá (%) cho giá bán lẻ
short_descriptionStringMô tả ngắn
discount_wholesaleFloatMức giảm giá (%) cho giá bán sỉ
price_onlineFloatGiá bán online
discount_onlineFloatMức giảm giá (%) cho giá bán online
price_average_inFloatGiá trung bình nhập vào
discount_inFloatMức giảm giá nhập vào
product_vatFloatThuế VAT (%)
weightFloatTrọng lượng sản phẩm
variant_attribute_valuesArrayDanh sách giá trị biến thể sản phẩm
variant_attributesArrayDanh sách thuộc tính biến thể sản phẩm
detail_custom_fieldsObjectCác trường tùy chỉnh chi tiết của sản phẩm
imagesArrayDanh sách hình ảnh của sản phẩm
has_moreBooleanCòn dữ liệu hay không
offsetIntegerGiá trị offset hiện tại
limitedIntegerSố lượng bản ghi lấy
sortedObjectTiêu chí sắp xếp