# `Insider.Sentinel.DraftCreation.Receipt`
[🔗](https://github.com/hiivemarkets/insider/blob/v0.1.0/tools/insider_lab/lib/insider/sentinel/draft_creation/receipt.ex#L1)

A canonical local record of one draft-provider attempt.

Created and existing outcomes are provider-reported, not independently
verified remote state. An unknown outcome is retained after a deadline because
terminating the local callback cannot prove that an external effect did not
occur. Exactly-once behavior therefore depends on provider-native idempotency.
Standalone validation proves only structure and content identity; callers
trust a receipt only after `validate_with/2` recomputes it from the request.

# `t`

```elixir
@type t() :: %Insider.Sentinel.DraftCreation.Receipt{
  controls: term(),
  disclosure: term(),
  draft: term(),
  id: term(),
  integrity: term(),
  outcome: term(),
  provider: term(),
  request: term(),
  schema: term(),
  trust: term()
}
```

# `canonical_binary`

```elixir
@spec canonical_binary(term()) ::
  {:ok, binary()} | {:error, Insider.Protocol.Error.t()}
```

# `decode`

```elixir
@spec decode(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `decode_map`

```elixir
@spec decode_map(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `new`

```elixir
@spec new(term(), binary(), binary() | nil) ::
  {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `to_wire_map`

```elixir
@spec to_wire_map(t()) :: map()
```

# `validate`

```elixir
@spec validate(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `validate_with`

```elixir
@spec validate_with(term(), term()) ::
  {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

Recomputes the receipt from the exact request and recorded provider outcome.

---

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