Thêm mới báo giá
1. Thông Tin API
- Endpoint:
/api/v6.1/quote - Method:
POST - Authentication: Yêu cầu
X-API-KEY - Header:
Content-Type: application/jsonX-API-KEY: <your_api_key>
2. Request Body
{
"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>",
"opp_code": "CH2055057",
"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
}
],
"variants": [
{
"variant_attributes": [
{
"attribute_id": 1,
"attribute_value_id": 4
},
{
"attribute_id": 2,
"attribute_value_id": 8
}
]
}
]
}
]
}
3. Mô Tả Các Trường
3.1. Thông tin báo giá
| Trường | Loại | Bắt buộc | Mô tả |
|---|---|---|---|
quote_code | string | 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á |
end_date | timestamp | Ngày kết thúc | |
assigned_user | integer | Id người thực hiện | |
quote_number | integer | Lần báo giá | |
description | string | Mô tả | |
project_name | string | Tên dự án | |
project_address | string | Địa chỉ dự án | |
note | string | Nội dung báo giá | |
opp_id | integer | ID cơ hội liên quan đến báo giá | |
opp_code | string | Mã cơ hội liên quan đến báo giá (thay thế cho opp_id) | |
custom_fields | object | Định nghĩa dữ liệu |
Lưu ý: Chỉ cần cung cấp một trong hai:
opp_idhoặcopp_codeđể liên kết báo giá với cơ hội.
3.2. Thông tin tài chính
| Trường | Loại | Bắt buộc | Mô tả |
|---|---|---|---|
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 ($) |