Import lô chứng từ bằng file excel
Ngày cập nhật: 18 tháng 08, 2026
Người cập nhật: VNPT eContract's team
Mục đích
Thực hiện tạo hàng loạt chứng từ bằng template mẫu chứng từ có sẵn thông qua import file excel.
- Request URL:
/api/batch-imports/create - HTTP method:
POST - HTTP content-type:
multipart/form-data - Authorize:
Bearer token - Parameter:
| Key | Type | Description |
|---|---|---|
file | file | [Bắt buộc] File excel dùng để import lô chứng từ |
name | string | [Bắt buộc] Tên lô chứng từ |
departmentId | int | [Bắt buộc] Id bộ phận |
documentTypeId | int | [Bắt buộc] Id loại chứng từ |
documentTemplateId | int | [Bắt buộc] Id mẫu chứng từ |
Mẫu response body
{
"data": {
"id": 1234,
"createdDate": "2022-12-13T10:21:51.712847+07:00",
"uploadedByUserId": 2341,
"numberOfRecords": 3,
"name": "Test import lô chứng từ bằng API",
"documents": [
{
"id": "e429b738-f30c-44e6-f25b-08dadcb92ffb",
"createdDate": "2022-12-13T10:21:54.618228+07:00",
"lastModifiedDate": "2022-12-13T10:21:54.6181865+07:00",
"expiryDate": "2022-12-15T00:00:00",
"no": "WV38",
"subject": "HĐLĐ_01",
"hasVerified": false,
"hasSeal": false,
"requireVerifiedUserSigning": false,
"status": {
"value": 1,
"description": "New document"
},
"description": "Hợp đồng lao động 01",
"department": {
"id": 33,
"name": "VNPT eContract",
"code": "DHB",
"users": []
},
"createdByUserId": 2341,
"processRecipientCount": 3,
"processInOrder": true,
"isWaitToSignDraw": false,
"isWaitToSignDigital": false,
"isWaitToApprove": false,
"isWaitToFillData": false,
"isWaitToCoordinate": false,
"isWaitToESign": false,
"isWaitToEkyc": false,
"isFillable": false,
"type": {
"id": 47,
"code": "TOTRINH",
"name": "Tờ trình",
"description": "Tờ trình nội bộ",
"documentCount": 3
},
"documentTemplate": {
"id": 130,
"name": "Mẫu hợp đồng không thời hạn",
"createdDate": "2022-10-31T13:43:38.9327148",
"fileName": "Mau_hop_hong.docx",
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl": "{HOST}/Api/Download?token=",
"isDisabled": false,
"isLaborContractTemplate": true,
"childrenTemplates": []
},
"processes": [
{
"id": "39e86913-d55a-4bd8-d61f-08dadcb93017",
"createdDate": "2022-12-13T10:21:54.6172923+07:00",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"displayType": {
"value": 0,
"description": "0"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 2328,
"documentId": "e429b738-f30c-44e6-f25b-08dadcb92ffb"
}
],
"file": {
"name": "Import_lo_1.pdf",
"size": 164711
},
"downloadUrl": "{HOST}/Api/Download?token=...",
"fixedPosition": false,
"isLaborContractDocument": false
}
]
},
"success": true,
"code": 0,
"messages": [
"Import batch document success"
]
}
Response Parameter
| Key | Type | Description |
|---|---|---|
data | object | Đối tượng chứa thông tin chi tiết lô chứng từ vừa tạo (xem bên dưới) |
success | boolean | Trạng thái xử lý của yêu cầu (true: Thành công, false: Thất bại) |
code | int | Mã trạng thái phản hồi từ hệ thống |
messages | Array[string] | Danh sách thông báo phản hồi từ hệ thống |
Chi tiết đối tượng data:
| Key | Type | Description |
|---|---|---|
id | int | ID của lô chứng từ import |
createdDate | string | Thời gian tạo lô chứng từ (định dạng ISO 8601) |
uploadedByUserId | int | ID người dùng thực hiện upload |
numberOfRecords | int | Tổng số lượng chứng từ được tạo trong lô |
name | string | Tên lô chứng từ |
documents | Array[object] | Danh sách các chứng từ được tạo trong lô (xem chi tiết chứng từ) |