List Institutions
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/banks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/banks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/banks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.wepayout.com.br/v2/banks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v2/banks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.wepayout.com.br/v2/banks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/banks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"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
}
]
Banks
List Institutions
Return the list of banks available in Brazil
GET
/
v2
/
banks
List Institutions
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/banks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/banks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/banks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.wepayout.com.br/v2/banks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v2/banks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.wepayout.com.br/v2/banks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/banks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"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
string
created after
string
created before
string
ISPB bank
boolean
To clear whether this bank is authorized ISPB
string
name of bank
string
Define the ordering of the query. Allowed values:
bank_id, code, name, document_name, logo, created_at, updated_at. Default: idinteger
The current page that will be displayed on returned list.
integer
The number of banks that will be displayed per page on paginated lists.
string
Define the sort order: ascending or descending
string
updated after
string
updated before
Response
number
internal id
string
bank code
string
ISPB code
string
Date name
string
logo
string
Create date
string
Update date
string
Delete date
boolean
Informs whether the ISPB of that institution is authorized or not
[
{
"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
Cache the Response
Cache the Response
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;
}
Handle Errors Gracefully
Handle Errors Gracefully
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.');
}
Filter by Type
Filter by Type
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.Was this page helpful?

