> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/sign/digital-signature/poa-sign-inline-api/api-reference/webhook-notification.md).

# Webhook Notification

## Setting Up Webhook

To set up Webhooks, please liaise with VIDA Solution Architect team and request for it to be enabled.&#x20;

#### Authorization

VIDA supports OAuth2-based "client credentials" and "Basic Auth" methods for authentication. The partner must share their preferred method of authentication along with the necessary credentials and URL to receive the webhook notifications.

## Notification

After making a digital signing request, the client will receive an `id` . This ID will be available in the Webhook Notification as `eventId` as the key identifier of the transaction from VIDA. The rest of the notification body remains the same with Digital Signature Transaction Status asynchronous API.

### Response Body

```json
{
	"partnerTrxId": "2aad04a7-fded-4dbd-8fe4",
	"code": 2,
	"lastUpdateAt": "2021-09-22T18:05:31",
	"signedDocs": [{
			"pdfTemplateId": "xxxxx-01",
			"documentUrl": "https://vida-cloudstore.s3.ap-southeast-1.amazonaws.com/ ...",
			"code": 0,
			"errMsg": ""
		},
		{
			"pdfTemplateId": "xxxxx-01",
			"documentUrl": "https://vida-cloudstore.s3.ap - southeast - 1. amazonaws.com / ...",
			"code": 0,
			"errMsg": ""
		}
	], 
	"eventId": "f77b59f2-7ce1-40b1-bbbe-dcb7fb4dc6c4"
}
```

Returns the status of the specified request.&#x20;

`0` - Created \
`1` - Certificate Generated \
`2` - Signing Task complete \
`3` - Request Failed&#x20;

When there is failure, there will be a `failureReason` included in the response&#x20;

Code - Under SignedDocs indicates the status of specific template-id

`0` - Signing success \
`1` - Signing failed (generic error)

errMsg - Will include the failure reason in Text

#### Error Handling

Non-success status code responses will have a body with error details

```json
{
		"partnerTrxId": "eb3d046a-5f61-41cc-af4c-d6868d398cac",
		"code": 3,
		"signedDocs": [],
		"lastUpdateAt": "2022-08-03T05:52:37Z",
		"errorCode": 31006,
		"failureReason": "Invalid CVV"
		"eventId": "f77b59f2-7ce1-40b1-bbbe-dcb7fb4dc6c4":
	
}
```

#### Error Codes

| Error Code | Error Code Description                                 |
| ---------- | ------------------------------------------------------ |
| 31001      | Failure to generate certificate                        |
| 31004      | keyID not found                                        |
| 31006      | CVV is not valid                                       |
| 31007      | Certificate already expired / revoked                  |
| 31008      | PDF file provided in the request body is not valid     |
| 21003      | The requested resource was not found                   |
| 1006       | The request is missing a required parameter            |
| 1000       | An unknown error occurred while processing the request |
