Chi Tiết Sản Phẩm
1. Lấy Thông Tin Chi Tiết Sản Phẩm
Endpoint
GET /api/v6.1/product
Headers
{
"Content-Type": "application/json",
"X-API-KEY": "{your_api_key}"
}
Query Parameters
Tham số | Bắt buộc | Kiểu dữ liệu | Mô tả |
---|---|---|---|
fields | Có | string | Danh sách các trường dữ liệu cần lấy |
product_code | Có | string | Mã sản phẩm cần lấy thông tin |
Request Example
curl --location 'https://xxxx.getflycrm.com/api/v6.1/product?fields=id%2Cproduct_name%2Cproduct_code%2Cprice_online%2Ccreated_at&product_code=SP.00192' \
--header 'X-API-KEY: {your_api_key}'
2. Response Example & Description
Response Fields
Trường | Kiểu dữ liệu | Mô tả |
---|---|---|
id | Integer | ID sản phẩm |
category_id | Integer | ID danh mục sản phẩm |
category_name | String | Tên danh mục sản phẩm |
origin_id | Integer | ID nguồn gốc sản phẩm |
origin_name | String | Tên nguồn gốc sản phẩm |
unit_id | Integer | ID đơn vị tính |
unit_name | String | Tên đơn vị tính |
manufacturer_id | Integer | ID nhà sản xuất |
manufacturer_name | String | Tên nhà sản xuất |
services | Boolean | Là sản phẩm dịch vụ hay không |
saleoff_price | Float | Giá khuyến mãi |
created_at | Timestamp | Ngày tạo sản phẩm |
updated_at | Timestamp | Ngày cập nhật sản phẩm |
featured_image | String | URL ảnh đại diện |
product_name | String | Tên sản phẩm |
product_code | String | Mã sản phẩm |
last_active | Timestamp | Thời gian hoạt động cuối |
description | String | Mô tả sản phẩm |
cover_price | Float | Giá gốc |
price_wholesale | Float | Giá bán sỉ |
discount | Float | Mức giảm giá (%) cho giá bán lẻ |
short_description | String | Mô tả ngắn |
discount_wholesale | Float | Mức giảm giá (%) cho giá bán sỉ |
price_online | Float | Giá bán online |
discount_online | Float | Mức giảm giá (%) cho giá bán online |
price_average_in | Float | Giá trung bình nhập vào |
discount_in | Float | Mức giảm giá nhập vào |
product_vat | Float | Thuế VAT (%) |
weight | Float | Trọng lượng sản phẩm |
variant_attribute_values | Array | Danh sách giá trị biến thể sản phẩm |
variant_attributes | Array | Danh sách thuộc tính biến thể sản phẩm |
detail_custom_fields | Object | Các trường tùy chỉnh chi tiết của sản phẩm |
images | Array | Danh sách hình ảnh của sản phẩm |
Response Example
{
"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://linhpq.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://linhpq.getflycrm.com/uploads/...",
"created_at": 1741852691,
"product_id": 2531
}
]
}