Cập nhật hợp đồng bán
1. Thông Tin API
- Endpoint:
/api/v6.1/sale_contract - Method:
PUT - Authentication: Yêu cầu
X-API-KEY - Header:
Content-Type: application/jsonX-API-KEY: <your_api_key>
2. Request Body
{
"current_contract_code": "HD14912",
"effective_date": 1734627600,
"expiration_date": 1734627600,
"contract_date": 1735525970,
"contract_terms": [
{
"id": 1491,
"term_name": "",
"term_des": "<p>Các điều khoản trong hợp đồng</p>"
}
],
"new_contract": 1,
"contract_used": 1,
"use_workflow": 0,
"discount": 0,
"discount_amount": 0,
"transport": 0,
"transport_amount": 0,
"installation_amount": 0,
"installation": 0,
"vat": 0,
"vat_amount": 0,
"contract_name": "HD14912",
"number_of_contract": "1",
"contract_code": "HD14912_NEW",
"vendor_account_id": 532,
"vendor_account_name": "Thành Nguyễn",
"vendor_account_address": "Địa chỉ",
"vendor_account_phone": "09871717231",
"vendor_account_fax": "Fax",
"vendor_contact_name": "Thành Nguyễn",
"vendor_contact_id": 686,
"vendor_positions": "Chức vụ",
"vendor_bank_address": "Ngân hàng",
"vendor_bank_account_number": "Tài khoản số",
"vendor_sic_code": "Mã số thuế",
"buyers_account_id": 1,
"buyers_account_name": "Getfly",
"buyers_account_address": "Tầng 7, Tòa nhà Hoa Cương, Số 18, Ngõ 11, Thái Hà, Đống Đa, Hà Nội",
"buyers_account_phone": "09730943891",
"buyers_account_fax": "faxx",
"buyers_contact_name": "",
"buyers_positions": "Chức vụ",
"buyers_bank_address": "Ngân hàng",
"buyers_bank_account_number": "Tài khoản số",
"buyers_sic_code": "Mã số thuế",
"service_charge_after_vat": 0,
"quote_id": 36,
"payment_methods": 1,
"start_actual_time": 1735491600,
"end_actual_time": 1735578000,
"actual_value": 1.2,
"project_name": "Dự án",
"project_address": "Địa điểm",
"performed": "Đã thực hiện",
"contract_parent_id": 1491,
"contract_details": [
{
"product_id": 216,
"product_code": "Mã Số 1",
"description": "",
"unit_id": 2,
"unit_name": "tấm",
"quantity": 1,
"price": 0,
"discount": 0,
"discount_amount": 0,
"vat": 0,
"amount": 0,
"variants": []
}
],
"payment_periods": [],
"custom_fields": {}
}
3. Mô Tả Các Trường
3.1. Trường định danh
| Trường | Loại | Bắt buộc | Mô tả |
|---|---|---|---|
current_contract_id | integer | yes | ID hợp đồng hiện tại cần cập nhật |
current_contract_code | string | yes | Mã hợp đồng hiện tại cần cập nhật |
Chỉ cần cung cấp một trong hai:
current_contract_idhoặccurrent_contract_code(không gửi đồng thời).