### Example Request to Get Product Details Source: https://developer.getfly.vn/docs/6.1/product/detail An example using curl to request product details, specifying the fields and product code, and including the necessary API key. ```Shell 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}' ``` -------------------------------- ### Get API Fields Example Source: https://developer.getfly.vn/docs/6.1/needed_info This example demonstrates how to specify fields to retrieve in a GET request. It shows a JSON object where the 'fields' key is used to list the desired information. ```JSON { "fields": "info1,info2" } ``` -------------------------------- ### Product Details Response Example Source: https://developer.getfly.vn/docs/6.1/product/detail Example JSON response containing comprehensive details of a product, including its ID, name, pricing, descriptions, attributes, and images. ```JSON { "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": "
Mô tả dài
", "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 } ] } ``` -------------------------------- ### Get API Limit Example Source: https://developer.getfly.vn/docs/6.1/needed_info This example shows how to limit the number of results returned in a GET request. The 'limit' key specifies the maximum number of records to retrieve. ```JSON { "limit": 5 } ``` -------------------------------- ### Get API Direction Example Source: https://developer.getfly.vn/docs/6.1/needed_info This example demonstrates how to set the sorting direction for a GET request. The 'direction' key can be set to 'asc' (ascending) or 'desc' (descending). ```JSON { "direction": "asc" } ``` -------------------------------- ### Sample Purchase Order Response Source: https://developer.getfly.vn/docs/6.1/purchase-order/list Example JSON response for the purchase orders API, showing a single order with details like ID, order code, amounts, dates, status, customer information, assigned user, and order details including products. ```JSON { "data": [ { "id": 123, "order_code": "PO001", "real_amount": 1000000, "f_amount": 1000000, "discount": 0, "discount_amount": 0, "vat_amount": 0, "account_id": null, "account_code": "", "account_email": "", "account_phone": "", "account_address": "", "order_date": "2025-05-12 00:00:00", "created_at": "2025-05-12 09:10:48", "updated_at": "2025-05-12 09:10:48", "status": 1, "assigned_user": 2, "assigned_user_name": "Assigned User", "contact_name": "", "contact_phone": "", "contact_email": "", "detail_custom_fields": { "ma_phu": "", "ghi_chu_rieng": "" }, "custom_fields": [], "order_details": [ { "id": 456, "product_id": 789, "product_name": "Product A Name", "product_code": "SP123", "quantity": 2, "price": 500000, "amount": 1000000, "unit_name": "Piece", "product_avatar": "https://example.com/image.png" } ] } ], "has_more": true, "offset": 1, "limited": 2, "sorted": { "order_date": "DESC" } } ``` -------------------------------- ### Create Product API Request Body Example Source: https://developer.getfly.vn/docs/6.1/product/create An example of a complete request body for creating a new product, including all optional and required fields. ```json { "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": "Mô tả chi tiết sản phẩm
", "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 } ] } ``` -------------------------------- ### Get API Offset Example Source: https://developer.getfly.vn/docs/6.1/needed_info This example illustrates how to set an offset for pagination in a GET request. The 'offset' key determines the number of records to skip from the beginning of the result set. ```JSON { "offset": 5 } ``` -------------------------------- ### Get API Sorting Example Source: https://developer.getfly.vn/docs/6.1/needed_info This example shows how to specify a field for sorting the results in a GET request. The 'sort' key indicates the field by which the data should be ordered. ```JSON { "sort": "info1" } ``` -------------------------------- ### API Request Example (cURL) Source: https://developer.getfly.vn/docs/6.1/product/list This example demonstrates how to make a request to the Getfly API v6.1 to fetch product data using cURL. It includes query parameters for specifying fields and limit, and sets the required API key and session cookie. ```Shell curl --location '/api/v6.1/products?fields=id%2Cproduct_name%2Cproduct_code%2Cprice_online%2Ccreated_at&limit=1' \ --header 'X-API-KEY: {your_api_key}' \ --header 'Cookie: v6_getflycrm_session={your_session_token}' ``` -------------------------------- ### Create Product API Success Response Example Source: https://developer.getfly.vn/docs/6.1/product/create An example of a successful response after creating a new product, including a success message and the new product's ID and code. ```json { "message": "Thêm mới thành công", "data": { "product_id": 1001, "product_code": "SP.TEST.001" } } ``` -------------------------------- ### Get Product Details Source: https://developer.getfly.vn/docs/6.1/product/detail Retrieves detailed information for a specific product using its code. Requires an API key for authentication. ```HTTP GET /api/v6.1/product Headers: { "Content-Type": "application/json", "X-API-KEY": "{your_api_key}" } Query Parameters: fields: string (optional) - List of data fields to retrieve. product_code: string (required) - The code of the product to retrieve information for. ``` -------------------------------- ### Get Tasks List with Parameters Source: https://developer.getfly.vn/docs/6.1/task/list Retrieves a list of tasks using the GetFly API v6.1. This example demonstrates how to specify fields, limit, offset, sort order, and includes the required API key in the request header. ```curl curl --location 'https://xxxx.getflycrm.com/api/v6.1/tasks?fields=id%2Ctask_code%2Ctask_name%2Ctask_start_date%2Ctask_end_date%2Ctask_status%2Ctask_receiver_display_name%2Cproject_name&limit=5&offset=0&sort_by=task_start_date&order=desc' \ --header 'X-API-KEY:Nội dung hỗ trợ
", "cate_name": "Danh mục", "account_email": "email@domain.com", "account_code": "ma-khach-hang", "contact_name": "Người liên hệ", "status_name": "Trạng thái", "expected_at": "2025-01-01", "custom_fields": { "truong_mo_rong": "giá trị" }, "emergency_phone": "0123456789" }' ``` -------------------------------- ### Get API Filtering Conditions Source: https://developer.getfly.vn/docs/6.1/needed_info This example illustrates various condition operations for filtering data in a GET request. It includes operations like 'eq' (equal to), 'in' (within an array), 'contains', and range comparisons. ```JSON { "filtering": { "info1:eq": 1, "info1:is": 1, "info1:in": [1,2,3], "info1:not_in": [1,2,3], "info1:contains": "info", "info1:between": [1,10], "info1:not_between": [1,10], "info1:gte": 1, "info1:gt": 1, "info1:lte": 1, "info1:lt": 1 } } ``` -------------------------------- ### Get Purchase Orders List Source: https://developer.getfly.vn/docs/6.1/purchase-order/list Retrieves a list of purchase orders using the GET method. Requires an API key and session cookie. Supports filtering by status, pagination, and sorting. ```HTTP GET /api/v6.1/purchase_orders Headers: X-API-KEY: