Nhảy tới nội dung
Phiên bản: 2.3.0

Tạo mới chứng từ

Ngày cập nhật: 18 tháng 08, 2026
Người cập nhật: VNPT eContract's team


Mục đích​

Hàm thực hiện tạo mới thông tin của chứng từ

  • Request URL: /api/documents/create
  • HTTP method: POST
  • HTTP content-type: multipart/form-data
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
nostring[Bắt buộc] Mã chứng từ
subjectstring[Bắt buộc] Tiêu đề chứng từ
filefile[Bắt buộc] File chứng từ (định dạng PDF, docx)
descriptionstringMô tả chứng từ
typeIdint[Bắt buộc] Id loại chứng từ
documentTemplateIdintId mẫu chứng từ
departmentIdint[Bắt buộc] Id Bộ phận
customerCodestringMã khách hàng
customerInformationstringThông tin khách hàng
relatedDocumentIdsArray[string]Mảng Id các chứng từ liên quan
attachmentsArray[file]Mảng các file đính kèm
expiryDatestringNgày hết hạn xử lý

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",
"expiryDate": "2022-12-08T12:00: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": 1,
"waitingProcesses": [],
"processInOrder": true,
"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": ,
"enableVnptSeal": false,
"requireVerifiedUserSigning": false
},
"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=...",
"fillingItems": [
{
"key": "{{name}}",
"displayName": "{{name}}",
"positions": []
},
{
"key": "{{gender}}",
"displayName": "{{gender}}",
"positions": []
}
],
"sharedUsers": [],
"isMarkStar": false,
"requiresSealSendConfirmation": false,
"fixedPosition": false,
"isLaborContractDocument": false
},
"success": true,
"code": 0,
"messages": [
"Create document success"
]
}

Mô tả Response Body​

KeyTypeDescription
successbooleanTrạng thái phản hồi của yêu cầu (true: Thành công, false: Thất bại)
codeintMã phản hồi từ hệ thống
messagesarrayDanh sách thông báo hoặc lỗi trả về từ hệ thống (Ví dụ: ["Create document success"])
dataobjectĐố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​

MessageDescription
Document type not foundId loại chứng từ không tồn tại
Invalid file format. Only PDF and DOCX formats are supportedSai định dạng file (chỉ PDF hoặc DOCX)
Existed document noMã chứng từ đã tồn tại