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

Worldpay **Token Import** — migrate tokens from a previous provider.

Allows merchants switching to Worldpay to import existing card tokens,
avoiding the need to re-collect card details from customers.

Token import is handled via a secure SFTP file transfer process with
Worldpay's implementation team. This module provides helpers for
building the import manifest.

## Process

1. Contact Worldpay IM to initiate token import
2. Build an import manifest using `build_manifest/2`
3. Encrypt the manifest (Worldpay provides PGP public key)
4. Transfer to Worldpay SFTP
5. Worldpay processes and returns a completion file

## Supported source vaults

- Stripe tokens
- Braintree tokens
- Adyen tokens
- Chase Paymentech tokens
- Other PCI-compliant token vaults

# `build_entry`

```elixir
@spec build_entry(keyword()) :: %{required(String.t()) =&gt; term()}
```

Build a token import manifest entry.

# `build_manifest`

```elixir
@spec build_manifest(
  [map()],
  keyword()
) :: String.t()
```

Build a complete token import manifest (JSON).

# `parse_completion`

```elixir
@spec parse_completion(String.t()) :: {:ok, map()} | {:error, term()}
```

Parse a token import completion file.

---

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