Skip to main content

Thêm mới

Thêm mới báo giá

HTTP Request

[POST] /api/v6/quotes

Body Parameters

ParameterTypeDefaultNullableRequireDescription
quote_codestringyesMã báo giá
account_idintegeryesĐịnh danh khách hàng
contact_idintegeryesId liên hệ khách hàng
quote_datetimestampyesNgày tạo báo giá
quote_datetimestampyesNgày kết thúc
assigned_userintegeryesId người thực hiện
quote_numberintegeryesLần báo giá
descriptionstringyesMô tả
project_namestringyesTên dự án
project_addressstringyesĐịa chỉ dự án
notestringyesNội dung báo giá
assigned_userintegeryesId người thực hiện
quote_detailsarrayyesDanh sách sản phẩm
quote_details.*.product_idintegeryesĐịnh danh sản phẩm
quote_details.*.descriptionstringyesMô tả sản phẩm
quote_details.*.quantityintegeryesSố lượng sản phẩm
quote_details.*.pricenumericyesĐơn giá sản phẩm
quote_details.*.discountnumericyesChiết khấu sản phẩm (%)
quote_details.*.discount_amountnumericyesChiết khấu sản phẩm ($)
quote_details.*.vatnumericyesVAT sản phẩm (%)
quote_details.*.vat_amountnumericyesVAT sản phẩm ($)
quote_details.*.row_idintegeryesĐịnh danh để nối với phụ kiện
quote_details.*.itemsarrayyesDanh sách phụ kiện đi kèm
quote_details.*.items.*.aliasstringyesAlias phụ kiện
quote_details.*.items.*.titlestringyesTên phụ kiện
quote_details.*.items.*.quantitynumericyesSố lượng phụ kiện
quote_details.*.items.*.pricenumericyesĐơn giá phụ kiện
quote_details.*.items.*.discountnumericyesChiết khấu phụ kiện (%)
quote_details.*.items.*.discount_amountnumericyesChiết khấu phụ kiện ($)
quote_details.*.items.*.vatnumericyesVAT phụ kiện (%)
quote_details.*.items.*.row_idintegeryesĐịnh danh để nối với phụ kiện con
quote_details.*.items.*.parent_row_idintegeryesĐịnh danh xác định phụ kiện cha
quote_details.*.items.*.root_row_idintegeryesĐịnh danh xác định sản phẩm
quote_details.*.variantsarrayBiến thể của sản phẩm (Bắt buộc nếu sản phẩm có biến thể)
custom_fieldsobjectyesĐịnh nghĩa dữ liệu
after_vatenum (0,1)yesChiết khấu trước/sau thuế
discountnumericyesChiết khấu báo giá (%)
discount_amountnumericyesChiết khấu báo giá ($)
vatnumericyesVAT báo giá (%)
vat_amountnumericyesVAT báo giá ($)
service_charge_after_vatenum (0,1)yesPhí dịch vụ trước/sau thuế
transportnumericyesPhí vận chuyển (%)
transport_amountnumericyesPhí vận chuyển ($)
installation_charge_after_discountenum (0,1)yesPhí lắp đặt trước/sau thuế
installationnumericyesPhí lắp đặt (%)
installation_amountnumericyesPhí 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
}