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

Modern REST API — mass payout initiation and tracking. 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 payment that hasn't yet been processed.

# `cancel!`

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

# `create_batch`

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

Initiates a batch of payments in a single call.

    Tipalti.Payments.create_batch(config, [
      %{payee_id: "vendor-123", amount: "100.00", currency: "USD", ref_code: "PAY-1"},
      %{payee_id: "vendor-456", amount: "250.00", currency: "USD", ref_code: "PAY-2"}
    ])

# `create_batch!`

```elixir
@spec create_batch!(Tipalti.Config.t(), [map()]) :: map()
```

# `get`

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

Retrieves a single payment 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 payments. 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 payment across all pages.

---

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