# Cashout Bank Codes

## Cashout Bank List

<mark style="color:blue;">`GET`</mark>`https://api-stg.onekeypayments.com/v1/country/BR/authorized-banks`

This API allows you to retrieve the list of banks available in each country

#### Query Parameters

| Name                                      | Type   | Description                          |
| ----------------------------------------- | ------ | ------------------------------------ |
| country<mark style="color:red;">\*</mark> | string | Country ISO code, "BR" is for Brasil |

#### Headers

| Name                                            | Type   | Description                                                  |
| ----------------------------------------------- | ------ | ------------------------------------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization Header. Format: "Bearer your\_read\_only\_key" |

## Introduction

This endpoint is used to retrieve a list of all the current available banks in Brazil, In case we add or remove a bank, this endpoint will reflect those updates in real-time and therefore it is a good idea to constantly check this endpoint for the list of banks.

Each bank includes information about our internal bank code, the ISPB code of the bank, name of the bank, and a check to see if the bank is licensed or not.

The endpoint is read-only and so it uses a read-only key. It can be used from the front end without major security concerns.

## Bank Codes Request

### Request Example

```java
// URL
GET: https://api-stg.onekeypayments.com/v1/country/BR/authorized-banks

// HEADERS
Authorization: Bearer EKiFOWiHnI 
```

### Request Fields

| Type        | Field           | Format             | Description                                                                                         |
| ----------- | --------------- | ------------------ | --------------------------------------------------------------------------------------------------- |
| Query Param | `country`       | String (length: 2) | [Country ISO code](/knowledge-base/countries-specifications.md#countries-and-currencies)            |
| Header      | `Authorization` | String             | Bearer Token Authentication. It is a concatenation of the word "Bearer" and your Read Only API Key. |

### Response Example

```json
{ 
"bank_code": xxx, 
"ispb_code": xxxxxxxx, 
"bank_name" : "XXXXXX", 
"bank_licensed": true|false 
}
{ 
"bank_code": xxx, 
"ispb_code": xxxxxxxx, 
"bank_name" : "XXXXXX", 
"bank_licensed": true|false 
}
```

### **Response fields**

| Field           | Format  | Description                                                                                                              |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
| `bank_code`     | Number  | Bank code. It is our internal code to identify a bank institution within our system.                                     |
| `ispb_code`     | Number  | "Identificador do Sistema de Pagamentos Brasileiro" - Unique 8 digit code that identifies a banking instituion in Brasil |
| `bank_name`     | String  | Name of the bank                                                                                                         |
| `bank_licensed` | Boolean | `TRUE` or `FALSE`                                                                                                        |

## Retrieve information for a specific bank

<mark style="color:blue;">`GET`</mark>` ``https://api-stg.onekeypayments.com/v1/country/{iso_code}/authorized-banks/{bank_code|ispb_code}`

In case you need to retrieve the information for a specific bank, you can utilize this endpoint with either the bank's ISPB code or our internal bank code, [which is provided here](/api-documentation/cashouts-api/countries-validations/american-countries/brazil.md).\
\
**Example:**&#x20;

<mark style="color:blue;">`GET`</mark>` ``https://api-stg.onekeypayments.com/v1/country/BR/authorized-banks/33`\ <br>

In this example, we would be utilizing the ISO code BR to indicate Brasil, and the "33" to indicate the internal bank code.\
\
Otherwise, if you would like to use the ISPB code, the endpoint would look like this:\
\
`https://api-stg.onekeypayments.com/country/BR/authorize-banks/90400888`\
\
**Response**

```json
{ 
"bank_code": 33, 
"ispb_code": 90400888, 
"bank_name" : "BANCO SANTANDER BRASIL S.A.", 
"bank_licensed": true 
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.onekeypayments.com/api-documentation/cashouts-api/endpoints/cashout-bank-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
