Skip to main content
GET
https://api.sandbox.wepayout.com.br
/
v2
/
banks
List Institutions
curl --request GET \
  --url https://api.sandbox.wepayout.com.br/v2/banks \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": 1270,
    "code": "237",
    "ispb": "00000000",
    "name": "BANCO DO BRASIL S.A. - INSTITUIÇÃO DE PAGAMEN",
    "logo": null,
    "created_at": "2024-06-25 00:00:00.00",
    "updated_at": "2024-06-25 00:00:00.00",
    "deleted_at": null,
    "ispb_authorized": false
  }
]

List Institutions

Return the list of banks available in Brazil.

Query Parameters

created_after
string
created after
created_before
string
created before
id
string
ISPB bank
ispb_authorized
boolean
To clear whether this bank is authorized ISPB
name
string
name of bank
order_by
string
Define the ordering of the query. Allowed values: bank_id, code, name, document_name, logo, created_at, updated_at. Default: id
page
integer
The current page that will be displayed on returned list.
per_page
integer
The number of banks that will be displayed per page on paginated lists.
sort
string
Define the sort order: ascending or descending
updated_after
string
updated after
updated_before
string
updated before

Response

id
number
internal id
code
string
bank code
ispb
string
ISPB code
name
string
Date name
logo
created_at
string
Create date
updated_at
string
Update date
deleted_at
string
Delete date
ispb_authorized
boolean
Informs whether the ISPB of that institution is authorized or not

Request Examples

curl --request GET \
  --url https://api.sandbox.wepayout.com.br/v2/banks \
  --header 'Accept: application/json'
[
  {
    "id": 1270,
    "code": "237",
    "ispb": "00000000",
    "name": "BANCO DO BRASIL S.A. - INSTITUIÇÃO DE PAGAMEN",
    "logo": null,
    "created_at": "2024-06-25 00:00:00.00",
    "updated_at": "2024-06-25 00:00:00.00",
    "deleted_at": null,
    "ispb_authorized": false
  }
]

Use Cases

Display Bank List in UI

async function loadBankOptions() {
  const response = await fetch('https://api.wepayments.com/v1/banks/institutions', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  
  const { data } = await response.json();
  
  const select = document.getElementById('bank-select');
  data.forEach(bank => {
    const option = document.createElement('option');
    option.value = bank.code;
    option.textContent = bank.name;
    select.appendChild(option);
  });
}

Validate Bank Code

async function validateBankCode(code) {
  const response = await fetch('https://api.wepayments.com/v1/banks/institutions', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  
  const { data } = await response.json();
  return data.some(bank => bank.code === code);
}

Search Banks

async function searchBanks(query) {
  const response = await fetch('https://api.wepayments.com/v1/banks/institutions', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  
  const { data } = await response.json();
  const lowerQuery = query.toLowerCase();
  
  return data.filter(bank => 
    bank.name.toLowerCase().includes(lowerQuery) ||
    bank.short_name.toLowerCase().includes(lowerQuery)
  );
}

Best Practices

The list of institutions doesn’t change frequently. Cache the response to reduce API calls:
const CACHE_KEY = 'banks_list';
const CACHE_DURATION = 7 * 24 * 60 * 60 * 1000; // 7 days

async function getBanks() {
  const cached = localStorage.getItem(CACHE_KEY);
  const timestamp = localStorage.getItem(`${CACHE_KEY}_time`);
  
  if (cached && timestamp) {
    const age = Date.now() - parseInt(timestamp);
    if (age < CACHE_DURATION) {
      return JSON.parse(cached);
    }
  }
  
  const response = await fetch('https://api.wepayments.com/v1/banks/institutions', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  
  const data = await response.json();
  localStorage.setItem(CACHE_KEY, JSON.stringify(data));
  localStorage.setItem(`${CACHE_KEY}_time`, Date.now().toString());
  
  return data;
}
Always handle potential errors when fetching the bank list:
try {
  const banks = await fetchBanks();
  displayBanks(banks);
} catch (error) {
  console.error('Failed to load banks:', error);
  showErrorMessage('Unable to load bank list. Please try again later.');
}
If you only need specific types of institutions, filter the results:
const banks = await fetchBanks();
const traditionalBanks = banks.data.filter(bank => bank.type === 'bank');

Rate Limiting

This endpoint is subject to rate limiting. Please cache the response and avoid making excessive requests.