Skip to main content
Version: 2.3.0

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​

KeyTypeRequiredDescription
namestringYesName of the document batch
departmentIdintYesDepartment ID
documentTypeIdintYesDocument type ID
documentTemplateIdintYesID of the template used to create documents
documentsarrayYesDocuments to create; each item represents one document
documents[].fileNamestringYesDocument file name; use "[AUTO]" to let the system generate it
documents[].nostringYesDocument number; use "[AUTO]" to let the system generate it
documents[].subjectstringYesDocument subject; use "[AUTO]" to let the system generate it
documents[].expiryDatestringNoDocument processing expiry date
documents[].cusCodestringNoCustomer code
documents[].cusNamestringNoCustomer name
documents[].contractValuestringNoContract value
documents[].validFromstringNoContract effective start date
documents[].validTostringNoContract effective end date
documents[].refDocsstringNoRelated document numbers; separate multiple values with ;
documents[].descriptionstringNoDocument description
documents[].attachmentstringNoAttachment
documents[].workflowobjectYesProcessing workflow for the document
documents[].parametersobjectTemplate-dependentField-code/value pairs to populate the document template; field codes must not include {{ }}

Workflow details​

KeyTypeRequiredDescription
processInOrderbooleanYesWhether processing is sequential (true) or parallel (false)
templateIdintNoWorkflow template ID
recipientsarrayNoProcessing recipients; array order determines step order
recipients[].codestringYesCode of the user assigned to process the step
recipients[].accessPermissionstringYesProcessing permission code, e.g. "D" (digital signature), "DR" (sign draw); see the permission list below
recipients[].requireAllToCompletebooleanNoFor a group step, whether all members must complete; defaults to true
recipients[].signGroupsarrayNoList of parallel processing recipients in this step
recipients[].signGroups[].codestringYesUser code of a group member
recipients[].signGroups[].accessPermissionstringYesProcessing permission code for the group member
Note

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.

tip

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
caution
  • Do not add {{ }} around keys in documents[].parameters.
  • no is required and must not duplicate an existing document number.
  • Date values such as expiryDate, validFrom, and validTo must be valid and use the dd/MM/yyyy format, e.g. 22/12/2028.
  • In a sequential workflow, "F" (fill data) is always placed before "D", "E", "EKYC", and "DR".
  • Each item in documents can have its own workflow and parameters.

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​

KeyTypeDescription
successbooleanRequest status (true: success, false: failure)
codeintResponse code from the system
messagesarrayList of messages or errors returned by the system
dataobjectBatch import information and the documents created

Details of data​

KeyTypeDescription
idintBatch import ID
createdDatedatetimeTime the batch was created
uploadedByUserIdintID of the user who created the batch
numberOfRecordsintNumber of documents in the batch
namestringBatch name from the request
statusobjectBatch status with value and description (e.g. 1 — Processing)
documentsarrayList of documents created

Details of data.documents[]​

KeyTypeDescription
idGUIDDocument ID generated by the system
createdDate, lastModifiedDatedatetimeDocument creation and last update times
nostringDocument number
subjectstringDocument subject
customerCode, customerInformationstringCustomer code and information
descriptionstringDocument description
statusobjectDocument status
contractStatusobjectContract validity status
createdByUserIdintID of the user who created the document
batchImportIdintID of the batch containing the document
processInOrderbooleanWhether processing is sequential (true) or parallel (false), from workflow.processInOrder
processRecipientCountintTotal number of processing participants
processesarrayProcessing steps created from workflow.recipients
fillingItemsarrayValues populated in the template; each item includes key, value, displayName, and positions
historiesarrayDocument activity history
downloadUrl, downloadOriginalUrl, downloadWatermarkMetadataUrlstringDocument download links
downloadFileUrlsarrayList 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.