Danh sách
Lấy danh sách đơn hàng
Danh sách đơn hàng bán
>HTTP Request
[GET] /api/v6/sale_orders
Query Parameters
Fields
| Fields | Type | Description |
|---|---|---|
| id | integer | Định danh |
| order_code | string | Mã đơn hàng |
| real_amount | numeric | Tổng tiền đơn hàng |
| f_amount | numeric | Tổng tiền đã thanh toán |
| discount | numeric | Giảm giá phần trăm |
| discount_amount | numeric | Giảm giá tiền mặt |
| vat_amount | numeric | VAT tiền mặt |
| account_id | integer | Định danh khách hàng |
| account_code | string | Mã khách hàng |
| account_email | string | Email khách hàng |
| account_phone | numeric | Số điện thoại khách hàng |
| account_address | string | Địa chỉ khách hàng |
| contact_name | string | Tên liên hệ |
| contact_phone | string | Số điện thoại liên hệ |
| contact_email | string | Email liên hệ |
| order_date | timestamp | Ngày đặt hàng |
| created_at | timestamp | Ngày tạo |
| updated_at | timestamp | Ngày sửa |
| status | integer | Trạng thái |
| status_label | string | Tên trạng thái |
| store_id | integer | Định danh kho |
| assigned_user | integer | Người thực hiện |
| assigned_user_name | string | Tên người thực hiện |
| payment_status | string | Trạng thái thanh toán (bắt buộc truyền thêm has_pay_off) |
| order_details | array | Thông tin sản phẩm trong đơn hàng |
| order_details.*.product_id | integer | Định danh sản phẩm |
| order_details.*.product_code | string | Mã sản phẩm |
| order_details.*.product_name | string | Tên sản phẩm |
| order_details.*.note | string | Mô tả sản phẩm |
| order_details.*.product_sale_off | numeric | Giảm giá sản phẩm |
| order_details.*.cash_discount | numeric | Giảm giá tiền mặt |
| order_details.*.price | numeric | Giá sản phẩm |
| order_details.*.quantity | numeric | Số lượng sản phẩm |
| order_details.*.vat | numeric | Vat sản phẩm (%) |
| order_details.*.vat_amount | numeric | Vat sản phẩm (cash) |
Filtering
| Fields | Support | Type | Description |
|---|---|---|---|
| id | eq,in | integer | Định danh |
| order_date | gte,lte,eq,between | timestamp | Ngày đặt hàng |
| created_at | eq,gte,lte | timestamp | Ngày tạo đơn |
| updated_at | eq,gte,lte | timestamp | Ngày sửa đơn |
Sort
| Sort (field) | Direction |
|---|---|
| id | asc,desc |
| order_date | asc,desc |
Limit & Offset
| Type | Description | |
|---|---|---|
| Limit | integer | Lấy bao nhiêu bản ghi |
| Offset | integer | Bỏ qua bao nhiêu bản ghi |
Example
HTTP Request
GET api/v6/sale_orders?fields=order_code&limit=1&offset=1&filtering[id]=4 HTTP/1.1
Host: example.getflycrm.com
Content-Type: application/json
Status
200 OK
Response
{
"data": [
{
"id": 5,
"order_code": "DH1588"
}
],
"has_more": false,
"offset": 1,
"limited": 1
}
Danh sách đơn hàng mua
HTTP Request
[GET] /api/v6/purchase_orders
Query Parameters
Fields
| Fields | Type | Description |
|---|---|---|
| id | integer | Định danh |
| order_code | string | Mã đơn hàng |
| real_amount | numeric | Tổng tiền đơn hàng |
| f_amount | numeric | Tổng tiền đã thanh toán |
| discount | numeric | Giảm giá phần trăm |
| discount_amount | numeric | Giảm giá tiền mặt |
| vat_amount | numeric | VAT tiền mặt |
| account_id | integer | Định danh khách hàng |
| account_code | string | Mã khách hàng |
| account_email | string | Email khách hàng |
| account_phone | numeric | Số điện thoại khách hàng |
| account_address | string | Địa chỉ khách hàng |
| contact_name | string | Tên liên hệ |
| contact_phone | string | Số điện thoại liên hệ |
| contact_email | string | Email liên hệ |
| order_date | timestamp | Ngày đặt hàng |
| created_at | timestamp | Ngày tạo |
| updated_at | timestamp | Ngày sửa |
| status | integer | Trạng thái |
| assigned_user | integer | Người thực hiện |
| assigned_user_name | string | Tên người thực hiện |
| payment_status | string | Trạng thái thanh toán (bắt buộc truyền thêm has_pay_off) |
| order_details | array | Thông tin sản phẩm trong đơn hàng |
| order_details.*.product_id | integer | Định danh sản phẩm |
| order_details.*.product_code | string | Mã sản phẩm |
| order_details.*.product_name | string | Tên sản phẩm |
| order_details.*.note | string | Mô tả sản phẩm |
| order_details.*.product_sale_off | numeric | Giảm giá sản phẩm |
| order_details.*.cash_discount | numeric | Giảm giá tiền mặt |
| order_details.*.price | numeric | Giá sản phẩm |
| order_details.*.quantity | numeric | Số lượng sản phẩm |
| order_details.*.vat | numeric | Vat sản phẩm (%) |
| order_details.*.vat_amount | numeric | Vat sản phẩm (cash) |
| custom_fields | object | Thông tin định nghĩa dữ liệu |
Filtering
| Fields | Support | Type | Description |
|---|---|---|---|
| id | eq,in | integer | Định danh |
| order_date | gte,lte,eq,between | timestamp | Ngày đặt hàng |
| created_at | eq,gte,lte | timestamp | Ngày tạo đơn |
| updated_at | eq,gte,lte | timestamp | Ngày sửa đơn |
Sort
| Sort (field) | Direction |
|---|---|
| id | asc,desc |
| order_date | asc,desc |
Limit & Offset
| Type | Description | |
|---|---|---|
| Limit | integer | Lấy bao nhiêu bản ghi |
| Offset | integer | Bỏ qua bao nhiêu bản ghi |
Example
HTTP Request
GET api/v6/purchase_orders?fields=order_code&limit=1&offset=1&filtering[id]=4 HTTP/1.1
Host: example.getflycrm.com
Content-Type: application/json
Status
200 OK
Response
{
"data": [
{
"id": 4,
"order_code": "DH1588"
}
],
"has_more": false,
"offset": 0,
"limited": 1
}