> ## Documentation Index
> Fetch the complete documentation index at: https://safepay.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Account validation utilities

> Use title fetch and account information APIs to confirm debtor details before initiating Raast payments.

Reduce payment failures by validating customer bank details before submitting RTP or payout requests. Safepay exposes two utility endpoints under your aggregator:

| Endpoint                                                        | Purpose                                                                    | Key request parameters                              |
| --------------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------- |
| [GET /title-fetch](/api-reference/utilities/title-fetch)        | Returns the registered account title for a Raast IBAN.                     | `iban` (query)                                      |
| [GET /account-info](/api-reference/utilities/read-account-info) | Retrieves metadata for an IBAN or alias, optionally combining title fetch. | `iban` or `alias_*` params; `with_title_fetch` flag |

<Callout type="tip">Call these endpoints before RTP or payout operations to ensure the payer or beneficiary details are valid. Cache responses briefly to avoid extra latency.</Callout>
<Callout type="info">`GET /account-info` accepts optional JSON body parameters (`iban`, `with_title_fetch`). Use query parameters if your HTTP client does not support GET bodies.</Callout>

### Title fetch example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET "{{base_url}}/v1/aggregators/{{aggregator_id}}/title-fetch?iban={{customer_iban}}" \
    --header "X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}}"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `${process.env.SAFEPAY_BASE_URL}/v1/aggregators/${process.env.SAFEPAY_AGGREGATOR_ID}/title-fetch?iban=${encodeURIComponent(customerIban)}`,
    {
      headers: {
        'X-SFPY-AGGREGATOR-SECRET-KEY': process.env.SAFEPAY_SECRET_KEY ?? '',
      },
    },
  );

  if (!res.ok) {
    throw new Error(`Title fetch failed with status ${res.status}`);
  }

  const titlePayload: {
    iban: string;
    title: string;
    bank: string;
    verified_at: string;
  } = await res.json();
  ```
</CodeGroup>

### Account info + alias lookup

Use the `account-info` endpoint when you only have the customer's Raast alias.

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET "{{base_url}}/v1/aggregators/{{aggregator_id}}/account-info?alias_type=RAAST_ID&alias_value={{customer_alias}}&with_title_fetch=true" \
    --header "X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}}"
  ```

  ```typescript TypeScript theme={null}
  const accountInfoResponse = await fetch(
    `${process.env.SAFEPAY_BASE_URL}/v1/aggregators/${process.env.SAFEPAY_AGGREGATOR_ID}/account-info?alias_type=RAAST_ID&alias_value=${encodeURIComponent(customerAlias)}&with_title_fetch=true`,
    {
      headers: {
        'X-SFPY-AGGREGATOR-SECRET-KEY': process.env.SAFEPAY_SECRET_KEY ?? '',
      },
    },
  );

  if (!accountInfoResponse.ok) {
    throw new Error(`Account info lookup failed: ${accountInfoResponse.status}`);
  }

  const accountInfo: {
    iban?: string;
    alias_type?: 'RAAST_ID' | 'PHONE' | 'EMAIL';
    alias_value?: string;
    title?: string;
    bank?: string;
  } = await accountInfoResponse.json();
  ```
</CodeGroup>

### Title fetch via alias

Use `GET /title-fetch/alias` when you have a Raast alias and need the account title quickly.

```bash cURL theme={null}
curl --request GET "{{base_url}}/v1/aggregators/{{aggregator_id}}/title-fetch/alias?alias_type=RAAST_ID&alias_value={{customer_alias}}&with_title_fetch=true" \
  --header "X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}}"
```

## See also

* [Payments](/concepts/payment)
* [Payouts use case](/use-cases/payouts)
* [Payment lifecycle guide](/guides/payment-lifecycle)
* [Errors](/reference/errors)
* [API reference](/api-reference)
