Import advanced batch of documents
Updated date: November 26, 2026
Updated by: VNPT eContract's team
Purpose
This API creates multiple documents in a single request using a document template (documentTemplateId) prepared in advance. Each item in documents creates one document; its parameters values are inserted into the corresponding fields in the template. The processing workflow is configured separately for each document.
- Request URL:
/v3/batch-imports/create-advanced - HTTP method:
POST - HTTP content-type:
application/json - Authorize:
Bearer token
Request parameters
| Key | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the document batch |
departmentId | int | Yes | Department ID |
documentTypeId | int | Yes | Document type ID |
documentTemplateId | int | Yes | ID of the template used to create documents |
documents | array | Yes | Documents to create; each item represents one document |
documents[].fileName | string | Yes | Document file name; use "[AUTO]" to let the system generate it |
documents[].no | string | Yes | Document number; use "[AUTO]" to let the system generate it |
documents[].subject | string | Yes | Document subject; use "[AUTO]" to let the system generate it |
documents[].expiryDate | string | No | Document processing expiry date |
documents[].cusCode | string | No | Customer code |
documents[].cusName | string | No | Customer name |
documents[].contractValue | string | No | Contract value |
documents[].validFrom | string | No | Contract effective start date |
documents[].validTo | string | No | Contract effective end date |
documents[].refDocs | string | No | Related document numbers; separate multiple values with ; |
documents[].description | string | No | Document description |
documents[].attachment | string | No | Attachment |
documents[].workflow | object | Yes | Processing workflow for the document |
documents[].parameters | object | Template-dependent | Field-code/value pairs to populate the document template; field codes must not include {{ }} |
Workflow details
| Key | Type | Required | Description |
|---|---|---|---|
processInOrder | boolean | Yes | Whether processing is sequential (true) or parallel (false) |
templateId | int | No | Workflow template ID |
recipients | array | No | Processing recipients; array order determines step order |
recipients[].code | string | Yes | Code of the user assigned to process the step |
recipients[].accessPermission | string | Yes | Processing permission code, e.g. "D" (digital signature), "DR" (sign draw); see the permission list below |
recipients[].requireAllToComplete | boolean | No | For a group step, whether all members must complete; defaults to true |
recipients[].signGroups | array | No | List of parallel processing recipients in this step |
recipients[].signGroups[].code | string | Yes | User code of a group member |
recipients[].signGroups[].accessPermission | string | Yes | Processing permission code for the group member |
When signGroups contains items, the system creates a group step and ignores code and accessPermission at the recipients[] level. Group members work on the same step; requireAllToComplete defaults to true.
accessPermissionCode values for document processing permissions:
- V — view only
- D — digital signature
- E — e-sign
- EKYC — eKYC sign
- DR — sign draw
- A — approve
- F — fill data
- C — coordinate
- Do not add
{{ }}around keys indocuments[].parameters. nois required and must not duplicate an existing document number.- Date values such as
expiryDate,validFrom, andvalidTomust be valid and use thedd/MM/yyyyformat, e.g.22/12/2028. - In a sequential workflow,
"F"(fill data) is always placed before"D","E","EKYC", and"DR". - Each item in
documentscan have its ownworkflowandparameters.
Sample request
The following example creates one document with two individual processing steps followed by a parallel group of two users.
{
"departmentId": 4424,
"documentTemplateId": 7991,
"documentTypeId": 8967,
"name": "Import lô chứng từ có nhóm xử lý",
"documents": [
{
"fileName": "[AUTO]",
"no": "[AUTO]",
"subject": "[AUTO]",
"expiryDate": "",
"cusCode": "",
"cusName": "",
"contractValue": "",
"validFrom": "",
"validTo": "",
"refDocs": "",
"description": "",
"attachment": "",
"workflow": {
"processInOrder": true,
"templateId": null,
"recipients": [
{
"code": "user01",
"accessPermission": "DR"
},
{
"code": "user02",
"accessPermission": "D"
},
{
"requireAllToComplete": true,
"signGroups": [
{
"code": "user03",
"accessPermission": "D"
},
{
"code": "user04",
"accessPermission": "D"
}
]
}
]
},
"parameters": {
"DIACHILV": "Tầng 10 tòa nhà VNPT, Hà Nội",
"BOPHAN": "Nhân Sự",
"GIOLAMVIEC": "08:00-17:00 từ Thứ 2 đến Thứ 6",
"DVTIEN": "VND",
"NGAYCAP_CCCD": "2019-08-20",
"NOICAP_CCCD": "Công an TP Hà Nội",
"HKTT": "123 Phố Huế, Hai Bà Trưng, Hà Nội"
}
}
]
}
In this example, the sequential workflow contains step 1 — sign draw (DR), step 2 — digital signature (D), and step 3 — a parallel group of two users who both sign digitally (D). There are four processing participants in total.
Sample response body
{
"data": {
"id": 23110,
"createdDate": "2026-11-25T10:32:47.3032188+07:00",
"uploadedByUserId": 70528,
"numberOfRecords": 1,
"name": "Import lô chứng từ có nhóm xử lý",
"status": {
"value": 1,
"description": "Processing"
},
"documents": [
{
"id": "a0b7464a-2cb9-49cc-4763-08df4aa4c681",
"createdDate": "2026-11-25T10:32:47.3862005+07:00",
"lastModifiedDate": "2026-11-25T10:32:47.3861741+07:00",
"no": "26.GROUP.VNPT-IT2-GP1.6733",
"subject": "Document 26.GROUP.VNPT-IT2-GP1.6733",
"status": {
"value": 1,
"description": "New"
},
"contractStatus": {
"value": 0,
"description": "Undefined"
},
"description": "",
"createdByUserId": 70528,
"processRecipientCount": 4,
"waitingProcesses": [],
"processInOrder": true,
"batchImportId": 23110,
"processes": [
{
"id": "41f32442-0899-4599-fc9a-08df4aa4c6b0",
"createdDate": "2026-11-25T10:32:47.3822797+07:00",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"displayType": {
"value": 2,
"description": "Text and image"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 70529,
"documentId": "a0b7464a-2cb9-49cc-4763-08df4aa4c681",
"fillingItems": [],
"attachments": []
},
{
"id": "cee68327-3bca-4bdc-fc9b-08df4aa4c6b0",
"createdDate": "2026-11-25T10:32:47.3834712+07:00",
"comId": 164,
"isOrder": true,
"orderNo": 2,
"displayType": {
"value": 2,
"description": "Text and image"
},
"accessPermission": {
"value": 4,
"description": "Sign digital"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 70530,
"documentId": "a0b7464a-2cb9-49cc-4763-08df4aa4c681",
"fillingItems": [],
"attachments": []
},
{
"orderNo": 3,
"requireAllToComplete": true,
"signGroups": [
{
"id": "2da6a4c3-7d59-4e46-fc9c-08df4aa4c6b0",
"createdDate": "2026-11-25T10:32:47.3844248+07:00",
"comId": 164,
"isOrder": true,
"orderNo": 3,
"displayType": {
"value": 2,
"description": "Text and image"
},
"accessPermission": {
"value": 4,
"description": "Sign digital"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 70531,
"documentId": "a0b7464a-2cb9-49cc-4763-08df4aa4c681",
"fillingItems": [],
"attachments": [],
"groupId": "068cf5f1-27e9-4e9c-f34f-08df4aa4c6c3"
},
{
"id": "86fd944f-75ab-4ce0-fc9d-08df4aa4c6b0",
"createdDate": "2026-11-25T10:32:47.3849808+07:00",
"comId": 164,
"isOrder": true,
"orderNo": 3,
"displayType": {
"value": 2,
"description": "Text and image"
},
"accessPermission": {
"value": 4,
"description": "Sign digital"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 70532,
"documentId": "a0b7464a-2cb9-49cc-4763-08df4aa4c681",
"fillingItems": [],
"attachments": [],
"groupId": "068cf5f1-27e9-4e9c-f34f-08df4aa4c6c3"
}
]
}
],
"accessibleViewProcesses": [],
"histories": [],
"attachments": [],
"relatedDocuments": [],
"linkedDocuments": [],
"messages": [],
"downloadUrl": "{HOST}/Api/Download?token=...",
"downloadOriginalUrl": "{HOST}/Api/Download?token=...",
"downloadWatermarkMetadataUrl": "{HOST}/Api/Download?token=...",
"fillingItems": [
{
"key": "{{DIACHILV}}",
"value": "Tầng 10 tòa nhà VNPT, Hà Nội",
"displayName": "{{DIACHILV}}",
"positions": []
}
],
"sharedUsers": [],
"isMarkStar": false,
"downloadFileUrls": [],
"requiresSealSendConfirmation": false,
"fixedPosition": false,
"isLaborContractDocument": false
}
]
},
"success": true,
"code": 0,
"messages": [
"Import batch document success"
]
}
Response body description
| Key | Type | Description |
|---|---|---|
success | boolean | Request status (true: success, false: failure) |
code | int | Response code from the system |
messages | array | List of messages or errors returned by the system |
data | object | Batch import information and the documents created |
Details of data
| Key | Type | Description |
|---|---|---|
id | int | Batch import ID |
createdDate | datetime | Time the batch was created |
uploadedByUserId | int | ID of the user who created the batch |
numberOfRecords | int | Number of documents in the batch |
name | string | Batch name from the request |
status | object | Batch status with value and description (e.g. 1 — Processing) |
documents | array | List of documents created |
Details of data.documents[]
| Key | Type | Description |
|---|---|---|
id | GUID | Document ID generated by the system |
createdDate, lastModifiedDate | datetime | Document creation and last update times |
no | string | Document number |
subject | string | Document subject |
customerCode, customerInformation | string | Customer code and information |
description | string | Document description |
status | object | Document status |
contractStatus | object | Contract validity status |
createdByUserId | int | ID of the user who created the document |
batchImportId | int | ID of the batch containing the document |
processInOrder | boolean | Whether processing is sequential (true) or parallel (false), from workflow.processInOrder |
processRecipientCount | int | Total number of processing participants |
processes | array | Processing steps created from workflow.recipients |
fillingItems | array | Values populated in the template; each item includes key, value, displayName, and positions |
histories | array | Document activity history |
downloadUrl, downloadOriginalUrl, downloadWatermarkMetadataUrl | string | Document download links |
downloadFileUrls | array | List of component files |
Details of data.documents[].processes[]
Regular processing steps return id, createdDate, comId, isOrder, orderNo, displayType, accessPermission, status, processedByUserId, documentId, fillingItems, and attachments.
For a group step, the response also includes requireAllToComplete and signGroups. Each item in signGroups has the same structure as a regular processing step, shares the group's orderNo, and includes a groupId. Members of the same group have the same groupId.