# `Tipalti.Procurement.Employees`
[🔗](https://github.com/iamkanishka/tipalti/blob/main/lib/tipalti/procurement/employees.ex#L1)

Procurement REST API — bulk employee import via CSV.

This is a three-step flow against `triggers.(sandbox.)approve.com`:

  1. `get_upload_url/1` — request a short-lived (60 second) signed upload URL.
  2. `upload_csv/2` — `PUT` the CSV bytes directly to that URL (max 10MB).
  3. `import_csv/1` — tell Tipalti to import the file that was just uploaded.

`import_employees/2` wraps all three steps for the common case where you
already have the CSV contents in memory.

    csv = File.read!("employees.csv")
    {:ok, _result} = Tipalti.Procurement.Employees.import_employees(config, csv)

Once imported, payer admins invite the employees via Procurement settings
in the Tipalti Hub (or, with SSO, employees can self-access without an
invite and are assigned the employee role automatically).

# `get_upload_url`

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

Requests a signed upload URL, valid for 60 seconds.

# `get_upload_url!`

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

# `import_csv`

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

Triggers Tipalti to import the CSV file that was just uploaded via `upload_csv/2`.

# `import_csv!`

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

# `import_employees`

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

Runs the full upload-URL → upload → import flow for the given CSV content.

# `import_employees!`

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

# `upload_csv`

```elixir
@spec upload_csv(String.t(), binary()) :: :ok | {:error, Exception.t()}
```

Uploads raw CSV content (max 10MB) directly to a previously-obtained
signed URL (from `get_upload_url/1`). This is a plain, unauthenticated
`PUT` to that URL — Tipalti's own signature is embedded in the URL.

---

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