# `Teya.Receipt`
[🔗](https://github.com/sgerrand/ex_teya/blob/v0.4.0/lib/teya/receipt.ex#L1)

Digital receipts for completed transactions.

Required OAuth scope: `transactions/id/receipts/create`.

# `create`

```elixir
@spec create(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Teya.Error.t()}
```

Creates a digital receipt for a transaction.

`transaction_id` is the UUID of the completed transaction. The API returns HTTP 202
(accepted for processing) on success — receipt delivery is asynchronous.

## Options

- `idempotency_key` — override the auto-generated idempotency key

## Examples

    {:ok, _} = Teya.Receipt.create(transaction_id, %{"email" => "customer@example.com"})

---

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