Thêm mới
Thêm mới báo giá
HTTP Request
[POST] /api/v6/quotes
Body Parameters
Parameter | Type | Default | Nullable | Require | Description |
---|---|---|---|---|---|
quote_code | string | yes | Mã báo giá | ||
account_id | integer | yes | Định danh khách hàng | ||
contact_id | integer | yes | Id liên hệ khách hàng | ||
quote_date | timestamp | yes | Ngày tạo báo giá | ||
quote_date | timestamp | yes | Ngày kết thúc | ||
assigned_user | integer | yes | Id người thực hiện | ||
quote_number | integer | yes | Lần báo giá | ||
description | string | yes | Mô tả | ||
project_name | string | yes | Tên dự án | ||
project_address | string | yes | Địa chỉ dự án | ||
note | string | yes | Nội dung báo giá | ||
assigned_user | integer | yes | Id người thực hiện | ||
quote_details | array | yes | Danh sách sản phẩm | ||
quote_details.*.product_id | integer | yes | Định danh sản phẩm | ||
quote_details.*.description | string | yes | Mô tả sản phẩm | ||
quote_details.*.quantity | integer | yes | Số lượng sản phẩm | ||
quote_details.*.price | numeric | yes | Đơn giá sản phẩm | ||
quote_details.*.discount | numeric | yes | Chiết khấu sản phẩm (%) | ||
quote_details.*.discount_amount | numeric | yes | Chiết khấu sản phẩm ($) | ||
quote_details.*.vat | numeric | yes | VAT sản phẩm (%) | ||
quote_details.*.vat_amount | numeric | yes | VAT sản phẩm ($) | ||
quote_details.*.row_id | integer | yes | Định danh để nối với phụ kiện | ||
quote_details.*.items | array | yes | Danh sách phụ kiện đi kèm | ||
quote_details.*.items.*.alias | string | yes | Alias phụ kiện | ||
quote_details.*.items.*.title | string | yes | Tên phụ kiện | ||
quote_details.*.items.*.quantity | numeric | yes | Số lượng phụ kiện | ||
quote_details.*.items.*.price | numeric | yes | Đơn giá phụ kiện | ||
quote_details.*.items.*.discount | numeric | yes | Chiết khấu phụ kiện (%) | ||
quote_details.*.items.*.discount_amount | numeric | yes | Chiết khấu phụ kiện ($) | ||
quote_details.*.items.*.vat | numeric | yes | VAT phụ kiện (%) | ||
quote_details.*.items.*.row_id | integer | yes | Định danh để nối với phụ kiện con | ||
quote_details.*.items.*.parent_row_id | integer | yes | Định danh xác định phụ kiện cha | ||
quote_details.*.items.*.root_row_id | integer | yes | Định danh xác định sản phẩm | ||
quote_details.*.variants | array | Biến thể của sản phẩm (Bắt buộc nếu sản phẩm có biến thể) | |||
custom_fields | object | yes | Định nghĩa dữ liệu | ||
after_vat | enum (0,1) | yes | Chiết khấu trước/sau thuế | ||
discount | numeric | yes | Chiết khấu báo giá (%) | ||
discount_amount | numeric | yes | Chiết khấu báo giá ($) | ||
vat | numeric | yes | VAT báo giá (%) | ||
vat_amount | numeric | yes | VAT báo giá ($) | ||
service_charge_after_vat | enum (0,1) | yes | Phí dịch vụ trước/sau thuế | ||
transport | numeric | yes | Phí vận chuyển (%) | ||
transport_amount | numeric | yes | Phí vận chuyển ($) | ||
installation_charge_after_discount | enum (0,1) | yes | Phí lắp đặt trước/sau thuế | ||
installation | numeric | yes | Phí lắp đặt (%) | ||
installation_amount | numeric | yes | Phí lắp đặt ($) |
Example
HTTP Request
POST api/v6/quotes HTTP/1.1
Host: example.getflycrm.com
Content-Type: application/json
{
"account_id": 1595,
"contact_id": 1758,
"quote_date": 1752033851,
"assigned_user": 1551,
"quote_number": 1,
"description": "Mô tả",
"project_name": "Dự án 1",
"project_address": "Hà Nội",
"note": "<p>Nội dung báo giá</p>",
"service_charge_after_vat": 0,
"transport": 10,
"transport_amount": 3000,
"discount": 10,
"discount_amount": 3300,
"after_vat": 0,
"vat": 10,
"vat_amount": 2970,
"installation": 10,
"installation_amount": 3300,
"installation_charge_after_discount": 0,
"end_date": 1752080400,
"custom_fields": {
"b1": "1234",
"b2": "3353"
},
"quote_details": [
{
"product_id": 279,
"description": "",
"quantity": 2,
"price": 15000,
"discount": 10,
"discount_amount": 1000,
"vat": 10,
"row_id": 1,
"items": [
{
"alias": "1.1",
"quantity": 1,
"price": 20000,
"vat": 0,
"discount": 0,
"discount_amount": 0,
"title": "SP101 - 1",
"row_id": 2,
"parent_row_id": 1,
"root_row_id": 1
},
{
"alias": "1.2",
"quantity": 1,
"price": 10000,
"vat": 0,
"discount": 0,
"discount_amount": 0,
"title": "SP101 - 2",
"row_id": 3,
"parent_row_id": 1,
"root_row_id": 1
},
{
"alias": "-",
"quantity": 1,
"price": 10000,
"vat": 0,
"discount": 0,
"discount_amount": 0,
"title": "SP101 - 2 - 1",
"row_id": 4,
"parent_row_id": 3,
"root_row_id": 1
}
],
"variants": [
{
"variant_attributes": [
{
"attribute_id": 1,
"attribute_value_id": 4
},
{
"attribute_id": 2,
"attribute_value_id": 8
}
]
}
]
}
]
}
Status
200 OK
Response
{
"message": "Thêm mới thành công",
"id": 4
}