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

# Reference

> Understanding bank institutions in WEpayments

# Banks Reference

The Banks API provides access to the list of financial institutions available in Brazil for payment processing.

## Overview

WEpayments supports a wide range of Brazilian banks and financial institutions. The Banks API allows you to retrieve the complete list of available institutions, which is essential for:

* **Payment Processing**: Know which banks are supported for transactions
* **User Interface**: Display bank options to your users
* **Integration**: Validate bank codes before processing payments
* **Compliance**: Ensure you're working with authorized institutions

## Available Institutions

The API returns information about all banks registered with the Brazilian Central Bank (Banco Central do Brasil) that are supported by WEpayments.

### Institution Information

Each institution in the list includes:

| Field        | Type   | Description                                        |
| ------------ | ------ | -------------------------------------------------- |
| `code`       | string | ISPB code (unique identifier)                      |
| `name`       | string | Full institution name                              |
| `short_name` | string | Abbreviated name                                   |
| `type`       | string | Institution type (bank, payment institution, etc.) |

## Use Cases

<AccordionGroup>
  <Accordion title="Bank Selection in UI">
    Retrieve the list of institutions to populate a dropdown or selection menu in your application:

    ```javascript theme={null}
    const banks = await fetchBanks();
    const bankOptions = banks.map(bank => ({
      value: bank.code,
      label: bank.name
    }));
    ```
  </Accordion>

  <Accordion title="Bank Code Validation">
    Validate bank codes before processing transactions:

    ```javascript theme={null}
    function isValidBank(bankCode, bankList) {
      return bankList.some(bank => bank.code === bankCode);
    }
    ```
  </Accordion>

  <Accordion title="Bank Name Display">
    Convert bank codes to readable names for display:

    ```javascript theme={null}
    function getBankName(bankCode, bankList) {
      const bank = bankList.find(b => b.code === bankCode);
      return bank ? bank.name : 'Unknown Bank';
    }
    ```
  </Accordion>

  <Accordion title="Filtering by Type">
    Filter institutions by type (e.g., only traditional banks):

    ```javascript theme={null}
    const traditionalBanks = banks.filter(bank => bank.type === 'bank');
    ```
  </Accordion>
</AccordionGroup>

## Common Banks in Brazil

Some of the major banks you'll find in the list include:

* **Banco do Brasil** - One of the largest banks in Brazil
* **Caixa Econômica Federal** - Federal savings bank
* **Itaú Unibanco** - Major private bank
* **Bradesco** - One of the largest private banks
* **Santander Brasil** - International bank with Brazilian operations
* **Nubank** - Leading digital bank
* **Inter** - Digital bank and payment institution
* **PagSeguro** - Payment institution

## Best Practices

<Note>
  **Cache the Bank List**: The list of institutions doesn't change frequently. Cache it in your application to reduce API calls and improve performance.
</Note>

<Warning>
  **Keep Updated**: While the list is relatively stable, new institutions may be added. Refresh your cache periodically (e.g., weekly) to stay current.
</Warning>

### Caching Strategy

```javascript theme={null}
// Example caching implementation
const CACHE_DURATION = 7 * 24 * 60 * 60 * 1000; // 7 days

async function getBanks() {
  const cached = localStorage.getItem('banks');
  const cacheTime = localStorage.getItem('banks_timestamp');
  
  if (cached && cacheTime) {
    const age = Date.now() - parseInt(cacheTime);
    if (age < CACHE_DURATION) {
      return JSON.parse(cached);
    }
  }
  
  // Fetch fresh data
  const banks = await fetchBanksFromAPI();
  localStorage.setItem('banks', JSON.stringify(banks));
  localStorage.setItem('banks_timestamp', Date.now().toString());
  
  return banks;
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="List Institutions" icon="list" href="/api-reference/banks/list-institutions">
    View the API endpoint documentation
  </Card>

  <Card title="Payment Processing" icon="credit-card" href="/cash-out/about-payments">
    Learn how to process payments
  </Card>
</CardGroup>
