List All Banks
This method allows you to retrieve a list of all banks supported by the API.
Method Signature
async listBanks(params?: ListBanksParams): Promise<ListBanksResponse>
Parameters
ListBanksParams
(optional):
limit
:number
- Limit the number of banks returnedsort
:string
- Sort banks by field (e.g., 'createdAt', '-updatedAt')country
:string
- Filter banks by countrycurrency
:string
- Filter banks by currencyrampableAccessToken
:string
(optional) - The Rampable access token
ℹ️
A rampableAccessToken
is required if you want to use rampable operations and not setup HTTP Signature Authentication (Personal Token)
Returns
Promise<ListBanksResponse>
- A paginated response containing:
docs
:RampableBank[]
- Array of bank objects with the following properties:_id
:string
- Internal identifiername
:string
- Bank namepaymentCode
:string
- Unique payment codecountry
:string
- Country where bank operatescurrency
:string
- Supported currencycreatedAt
:string
- Creation timestampupdatedAt
:string
- Last update timestampid
:string
- Unique identifier
totalDocs
:number
- Total number of banksoffset
:number
- Current offsetlimit
:number
- Results per pagetotalPages
:number
- Total number of pagespage
:number
- Current page numberpagingCounter
:number
- Current page starting counterhasPrevPage
:boolean
- Whether previous page existshasNextPage
:boolean
- Whether next page existsprevPage
:number | null
- Previous page numbernextPage
:number | null
- Next page number
Example Usage
// List all banks
const allBanks = await sdk.rampableReference.listBanks();
// List banks with filters and pagination
const filteredBanks = await sdk.rampableReference.listBanks({
country: 'US',
currency: 'USD',
limit: 10,
sort: 'createdAt',
});
Response Example
{
"docs": [
{
"_id": "64d71dcfd3452321f26653",
"name": "DOHA BANK",
"paymentCode": "doha_bank",
"country": "INDIA",
"currency": "INR",
"createdAt": "2023-08-12T05:51:11.494Z",
"updatedAt": "2023-08-12T05:51:11.494Z",
"__v": 0,
"id": "64d71dcfd345sdasddaf26653"
}
// ... more banks
],
"totalDocs": 111,
"offset": 0,
"limit": 10,
"totalPages": 12,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}
Additional Information
For more information, see the Rampable References API Documentation (opens in a new tab).