# `CorvoNfse.Types.Webhook`
[🔗](https://github.com/corvo-technology/corvo-nfse-elixir/blob/main/lib/corvo_nfse/types/webhook.ex#L1)

Wire shapes of webhook configs, deliveries and delivery stats, plus the
canonical list of webhook events.

# `create_params`

```elixir
@type create_params() :: map()
```

Params for `CorvoNfse.Resources.Webhooks.create/2`: `%{url:, events:}`.

# `delivery`

```elixir
@type delivery() :: CorvoNfse.Types.Webhook.Delivery.t()
```

# `delivery_stats`

```elixir
@type delivery_stats() :: %{optional(String.t()) =&gt; term()}
```

Stats returned by `Deliveries.stats/2`: a plain JSON string-keyed map of
integers under the keys `total`, `sent`, `failed`, `pending`, `delayed`.

# `environment`

```elixir
@type environment() :: String.t()
```

Environment wire value: "test" | "live".

# `event`

```elixir
@type event() :: String.t()
```

Webhook event wire value - one of the canonical 9 events from `events/0`:
`nfse.invoice.authorized`, `nfse.invoice.rejected`, `nfse.invoice.failed`,
`nfse.invoice.reconciliation_required`, `nfse.invoice.manual_review`,
`nfse.invoice.documents_ready`, `nfse.invoice.email_sent`,
`nfse.invoice.email_failed`, `nfse.invoice.fiscal_discrepancy`. The
`webhook.test` event is only sent by `Webhooks.test/2` and cannot be
subscribed.

# `t`

```elixir
@type t() :: %CorvoNfse.Types.Webhook{
  active: boolean(),
  createdAt: String.t(),
  events: [String.t()],
  id: String.t(),
  updatedAt: String.t(),
  url: String.t()
}
```

# `with_secret`

```elixir
@type with_secret() :: map()
```

A webhook config including its signing secret - returned only by
`CorvoNfse.Resources.Webhooks.create/2`.

# `events`

```elixir
@spec events() :: [String.t()]
```

The canonical 9 webhook events.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
