# `KapsoEx.Platform.BusinessVerification`
[🔗](https://github.com/rocket4ce/kapso_ex/blob/v0.1.0/lib/kapso_ex/platform/business_verification.ex#L1)

Submit a customer's business documents to Meta for
[business verification](https://docs.kapso.ai/docs/platform/business-verification).

A portfolio gets 3 attempts. Each submission carries 1 to 3 PDF, JPEG or
PNG documents of 5 MB or less.

# `result`

```elixir
@type result() :: {:ok, map()} | {:error, KapsoEx.Error.t()}
```

# `create_submission`

```elixir
@spec create_submission(KapsoEx.Client.t(), String.t(), [map()], String.t()) ::
  result()
```

Sends documents to Meta.

Each document is a map with `:roles` (for example `["legal_name"]` or
`["address"]`) and either:

  * `:source_url` - an HTTPS URL Kapso downloads, or
  * `:file` - `{content, filename: "certificate.pdf", content_type: "application/pdf"}`,
    sent as multipart.

`idempotency_key` is required: after a timeout, retry with the same key
and the same documents. Use a new key only for a new attempt, and never
while the state is `outcome_unknown`.

`202` means Kapso accepted the request, not that Meta verified the
business; check `state` and poll `get_submission/3`.

    key = "verification-" <> portfolio_id <> "-1"

    BusinessVerification.create_submission(client, portfolio_id, [
      %{source_url: "https://files.example.com/certificate.pdf", roles: ["legal_name"]},
      %{file: {File.read!("statement.pdf"), filename: "statement.pdf"}, roles: ["address"]}
    ], key)

# `get`

```elixir
@spec get(KapsoEx.Client.t(), String.t()) :: result()
```

Gets the verification status, eligibility, attempts and latest submission.

# `get_submission`

```elixir
@spec get_submission(KapsoEx.Client.t(), String.t(), String.t()) :: result()
```

Gets a submission with its documents and Meta's rejection reasons.

# `list_submissions`

```elixir
@spec list_submissions(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
```

Lists your project's submissions for the portfolio, newest first. Params: `limit`, `before`, `after`.

---

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