# CreateWebhookSubscription

Create a subscription to events

`POST /webhooks/subscriptions`

**API:** Avalara E-Invoicing API
**Tag:** Subscriptions
**API Version:** 1.5
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Authentication:** Bearer token

Source: https://developer.avalara.com/products/e-invoicing/api/v1.5/methods/Subscriptions/CreateWebhookSubscription/

## Description

Create a new webhook subscription and return the created subscription details.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

## Request Body

**Content-Type:** `application/json`
**Schema:** `SubscriptionRegistration`

## Responses

| Status | Description | Schema |
|---|---|---|
| 201 | Subscription created successfully. Returns the created SubscriptionDetail object. | `SuccessResponse` |
| 400 | Bad request. The request payload is invalid or contains missing required fields. | `WebhooksErrorResponse` |
| 401 | Unauthorized. | `WebhooksErrorResponse` |
| 403 | Forbidden. | `WebhooksErrorResponse` |

### 201 Response: `SuccessResponse`

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | string | No | Unique identifier for the new or updated entity. Example: `78f6caaa-6988-4862-bd11-e52906b31b72`. |
| `message` | string | No | Success message Example: `Webhook subscription created successfully`. |

## Example Request

```bash
curl -X POST "https://api.sbx.avalara.com/einvoicing/webhooks/subscriptions" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json" \
  -d '{
  "description": "Basic webhook configuration without signature",
  "notificationUrl": "https://webhook.example.com/notifications",
  "signature": {
    "type": "none"
  },
  "events": [
    {
      "eventName": "document.complete"
    }
  ]
}'
```