# `Worldpay.SecurityTokenService`
[🔗](https://github.com/iamkanishka/worldpay/blob/v1.0.0/lib/worldpay/access/token_services.ex#L142)

Worldpay **Security Token Service (STS) API** — provision, exchange,
and detokenize raw card/account numbers.

The STS is used for PCI-scope-reducing tokenization:
- Convert raw PANs to tokens (provision)
- Swap tokens between token vaults (exchange)
- Retrieve raw PANs from tokens (detokenize — PCI-accredited only)

**Warning:** Detokenization retrieves raw card numbers and significantly
increases PCI audit scope. Only use when absolutely necessary.

# `detokenize`

```elixir
@spec detokenize(String.t(), Worldpay.Config.t()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Detokenize — retrieve the raw card number from a token.

**PCI-accredited merchants only.** Using this endpoint subjects your
environment to PCI DSS Level 1 audit requirements.

# `exchange`

```elixir
@spec exchange(map(), Worldpay.Config.t()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Exchange a token between vaults (inter-token exchange).

# `provision`

```elixir
@spec provision(map(), Worldpay.Config.t()) ::
  {:ok, map()} | {:error, Worldpay.Error.t()}
```

Provision a token from a raw card number.

---

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