# Create a webhook subscription

Source: https://developer.avalara.com/products/e-invoicing/integration-guides/elr/uok1485876465723/

Guide: E-Invoicing and Live Reporting

# Create a webhook subscription

**Endpoint**: `POST /einvoicing/webhooks/subscriptions`

Create a subscription to events exposed by registered systems.

For details, see [CreateWebhookSubscription](https://developer.avalara.com/api-reference/e-invoicing/v1.6/methods/Subscriptions/CreateWebhookSubscription/).

**Headers**

Name

Description

**avalara-version**

1.5

(Required) The version of the API to use, for example, "1.4."

**X-Avalara-Client**

Provided by Avalara. Used for client application identification.

**Content-Type**

application/json

**Accept**

application/json

**Body**

```
{
    "events": [
        {
            "eventName": "document.complete"
        },
        {
            "eventName": "document.pending"
        },
        {
            "eventName": "document.error"
        }
    ],
    "notificationUrl": "https://webhook.example.com/notifications",
    "signature": {
        "type": "hmac",
        "key": "mynotverysecret",
        "algorithm": "sha256"
    },
    "description": "Basic webhook configuration"
}
```

## Example request

```
curl --location '/einvoicing/webhooks/subscriptions' \
--header 'avalara-version: 1.5' \
--header 'X-Avalara-Client: ProvidedToYouByAvalara' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "events": [
        {
            "eventName": "document.complete"
        },
        {
            "eventName": "document.pending"
        },
        {
            "eventName": "document.error"
        }
    ],
    "notificationUrl": "https://webhook.example.com/notifications",
    "signature": {
        "type": "hmac",
        "key": "mynotverysecret",
        "algorithm": "sha256"
    },
    "description": "Basic webhook configuration"
}'
```