Skip to main content
Version: 2.3.0

Webhook

Updated date: 06/11/2024
Updated by: VNPT eContract's team


Purpose

The partner has developed a RESTful API with the following parameters to receive and process data from the webhook:

  • URL endpoint (provided by the partner), example: https://domain-partner.com/api/document/status
  • HTTP method: POST
  • HTTP content-type: application/json
  • Authorization: Bearer token (optional if security is needed)
  • Payload: Data will be sent by the VNPT eContract system in JSON format with the following structure:

Sample Payload (the partner's system will receive)

{
"DocumentNo": "HD.001",
"DocumentId": "fa07d61e-0fff-41a3-e618-08dad69d1b1b",
"DocumentStatus": {
"Value": -1,
"Description": "Rejected"
},
"Reason": "Document no is incorrect format",
"DatetimeNow": "2024/11/06 14:56:50"
}

Data description

KeyTypeDescription
DocumentIdstringId of document
DocumentNostringCode of document
DocumentStatusobjectStatus of document, reference Get list of documents
ReasonstringReason cancel document
BatchProcessIdstringDocument batch processing Id (in case of an event processing multiple workflows)
BatchImportIdintDocument import batch Id (in case of an event completing batch creation of documents)
DocumentIdInBatchImportArray[int]List of document Id within the batch (in case of an event completing batch creation of documents)
DatetimeNowDatetimeExecute time

Sample response (reponse to the VNPT eContract system)

{
"success": true,
"messages": "Document status updated successfully."
}