# `Tipalti.Invoices`
[🔗](https://github.com/iamkanishka/tipalti/blob/main/lib/tipalti/invoices.ex#L1)

Modern REST API — invoice/bill submission and management. See the caveat
in `Tipalti.Payees` about endpoint-shape assumptions; the same applies
here.

# `cancel`

```elixir
@spec cancel(Tipalti.Config.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}
```

Cancels a pending invoice.

# `cancel!`

```elixir
@spec cancel!(Tipalti.Config.t(), String.t()) :: map()
```

# `create`

```elixir
@spec create(Tipalti.Config.t(), map()) :: {:ok, map()} | {:error, Exception.t()}
```

Creates a new invoice/bill.

    Tipalti.Invoices.create(config, %{
      payee_id: "vendor-123",
      ref_code: "INV-2026-001",
      due_date: "2026-08-30",
      currency: "USD",
      line_items: [%{description: "Consulting", amount: "1500.00", quantity: 1}]
    })

# `create!`

```elixir
@spec create!(Tipalti.Config.t(), map()) :: map()
```

# `get`

```elixir
@spec get(Tipalti.Config.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}
```

Retrieves a single invoice by ID.

# `get!`

```elixir
@spec get!(Tipalti.Config.t(), String.t()) :: map()
```

# `list`

```elixir
@spec list(
  Tipalti.Config.t(),
  keyword()
) :: {:ok, map()} | {:error, Exception.t()}
```

Lists invoices. Returns a single page; see `stream/2` to walk every page.

# `list!`

```elixir
@spec list!(
  Tipalti.Config.t(),
  keyword()
) :: map()
```

# `stream`

```elixir
@spec stream(
  Tipalti.Config.t(),
  keyword()
) :: Enumerable.t()
```

Returns a lazy `Stream` of every invoice across all pages.

# `update`

```elixir
@spec update(Tipalti.Config.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Exception.t()}
```

Updates an existing (not-yet-paid) invoice.

# `update!`

```elixir
@spec update!(Tipalti.Config.t(), String.t(), map()) :: map()
```

---

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