Embedded Wallets
SDK
Javascript
How to
References
List All Banks

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 returned
  • sort: string - Sort banks by field (e.g., 'createdAt', '-updatedAt')
  • country: string - Filter banks by country
  • currency: string - Filter banks by currency
  • rampableAccessToken: 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 identifier
    • name: string - Bank name
    • paymentCode: string - Unique payment code
    • country: string - Country where bank operates
    • currency: string - Supported currency
    • createdAt: string - Creation timestamp
    • updatedAt: string - Last update timestamp
    • id: string - Unique identifier
  • totalDocs: number - Total number of banks
  • offset: number - Current offset
  • limit: number - Results per page
  • totalPages: number - Total number of pages
  • page: number - Current page number
  • pagingCounter: number - Current page starting counter
  • hasPrevPage: boolean - Whether previous page exists
  • hasNextPage: boolean - Whether next page exists
  • prevPage: number | null - Previous page number
  • nextPage: 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).