# List, retrieve, then refresh a secure token from a single-use token.

List, retrieve, then refresh a secure token from a single-use token.

1. OPTIONAL — lists secure tokens on the terminal, filtered by customer name, and extracts the first result's `secureTokenId`. Skip if you already hold the `secureTokenId`.
 [listSecureTokens](/api/list-secure-tokens)
2. OPTIONAL — retrieve the secure token to confirm its current state before refreshing. Surfaces the token `status` and the replayable `token` value.
 [getSecureToken](/api/get-secure-token)
3. Refresh the stored payment details from a Hosted Fields single-use token. The body is `{ type: singleUseToken, token: <128-char token> }`. Requires a unique `Idempotency-Key` header. Returns 200 (not 201).
 [accountUpdate](/api/account-update)

## Workflow diagram

```mermaid
flowchart TD
  step0["1. token search · API"]
  step1["2. token lookup · API"]
  step0 --> step1
  step2["3. account update request · API"]
  step1 --> step2
```
