# `Tipalti.SOAP.Client`
[🔗](https://github.com/iamkanishka/tipalti/blob/main/lib/tipalti/soap/client.ex#L1)

Generic engine behind `Tipalti.SOAP.Payee` and `Tipalti.SOAP.Payer`.

Builds a signed SOAP 1.1 envelope for a given operation/params, posts it
to the right service (`PayeeFunctions.asmx` or `PayerFunctions.asmx`),
parses the XML response with the OTP-bundled `:xmerl` (no external XML
library dependency), and either returns the parsed body fields as a map
or raises/returns a `Tipalti.SOAPFaultError` if the response was a
`<soap:Fault>`.

You generally won't call this directly — see `Tipalti.SOAP.Payee` and
`Tipalti.SOAP.Payer` for the typed operation wrappers built on top of it.

# `service`

```elixir
@type service() :: :payee | :payer
```

# `call`

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

Calls a SOAP operation.

  * `service` — `:payee` or `:payer`.
  * `operation` — the operation name, e.g. `"ProcessPayments"`.
  * `params` — a map/keyword list of `%{ParamName => value}` fields to
    render as child elements inside the operation's request element, in
    the order given.
  * `opts`:
    * `:idap` — payee ID, included in the signature (and, if not already
      in `params`, added as an `idap` element) for payee-function calls.
    * `:eat` — this operation's EAT (Encryption Additional Terms) value,
      folded into the signature per Tipalti's signing scheme.

---

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