Cập nhật chứng từ
Ngày cập nhật: 10 tháng 8, 2026
Người cập nhật: VNPT eContract's team
Mục đích
Hàm thực hiện cập nhật các thông tin của chứng từ ở trạng thái mới khởi tạo.
- Request URL:
/api/documents/update - HTTP method:
POST - HTTP content-type:
multipart/form-data - Authorize:
Bearer token - Parameter:
| Key | Type | Description |
|---|---|---|
id | string | [Bắt buộc] Id chứng từ cần cập nhật |
no | string | Mã chứng từ |
subject | string | Tiêu đề chứng từ |
file | file | File chứng từ (định dạng PDF, docx) |
description | string | Mô tả |
typeId | int | Id loại chứng từ |
documentTemplateId | int | Id mẫu chứng từ |
departmentId | int | Id bộ phận |
customerCode | string | Mã khách hàng |
customerInformation | string | Thông tin khách hàng |
relatedDocumentIds | Array[string] | Mảng Id các chứng từ liên quan |
attachments | Array[file] | Mảng các file đính kèm |
Mẫu response body
{
"data": {
"id": "67f7f485-3c65-4e5a-a8fd-08dad7588424",
"createdDate": "2022-12-06T14:07:19.7166444+07:00",
"lastModifiedDate": "2022-12-06T14:07:19.7168438+07:00",
"no": "Test0.02656043684177667",
"subject": "Test0.02656043684177667",
"hasVerified": false,
"hasSeal": false,
"requireVerifiedUserSigning": false,
"status": {
"value": 1,
"description": "New document"
},
"contractStatus": {
"value": 0,
"description": "Undefined"
},
"description": "Test tạo mới chứng từ bằng API",
"createdByUserId": 2341,
"processRecipientCount": 0,
"processInOrder": false,
"isWaitToSignDraw": false,
"isWaitToSignDigital": false,
"isWaitToApprove": false,
"isWaitToFillData": false,
"isWaitToCoordinate": false,
"isWaitToESign": false,
"isWaitToEkyc": false,
"isFillable": false,
"type": {
"id": 46,
"code": "CKDS",
"name": "Chiết khấu doanh số",
"description": "Chứng từ chiết khấu doanh số",
"documentCount": 1
},
"processes": [],
"histories": [
{
"createdDate": "2022-12-06T14:07:20.0170103+07:00",
"requestType": {
"value": 0,
"description": "Web"
},
"ipAddress": "10.70.39.66",
"activity": {
"value": 1,
"description": "Create document"
}
}
],
"attachments": [],
"relatedDocuments": [],
"messages": [],
"file": {
"name": "Document.pdf",
"size": 1194181
},
"downloadUrl": "{HOST}/Api/Download?token=..."
},
"success": true,
"code": 0,
"messages": [
" Update document template success"
]
}
Mô tả Response Body
| Key | Type | Description |
|---|---|---|
success | boolean | Trạng thái phản hồi của yêu cầu (true: Thành công, false: Thất bại) |
code | int | Mã phản hồi từ hệ thống |
messages | array | Danh sách thông báo hoặc lỗi trả về từ hệ thống (Ví dụ: ["Update document success"]) |
data | object | Đối tượng chứa thông tin chi tiết của chứng từ vừa tạo thành công (xem chi tiết) |
Các lỗi thường gặp
| Message | Description |
|---|---|
Document type not found | Id loại chứng từ không tồn tại |
Invalid file format. Only PDF and DOCX formats are supported | Sai định dạng file (chỉ PDF hoặc DOCX) |
Existed document no | Mã chứng từ đã tồn tại |