External accounts List institutions
List institutions
Lists the banks and mobile money operators an external account can name in `institution_id`. SWIFT banks appear only when you send `institution_type=swift`, `swift_code` or `search`. Filters match exactly, so send codes in upper case.
Api-Key
Query parameters
NameDescription
pageDefault
1items_per_pageDefault
10country_iso_codeAlpha-2 country code
institution_typeDefaults to every type except swift_intermediary
Possible values: bank, mobile_money, swift, swift_intermediary
account_number_typePossible values:
bank_account_number, iban, phone_number, clabecurrencyswift_codeFind a SWIFT bank by its 8- or 11-character BIC
searchFind SWIFT banks by name or BIC, at least 3 characters
Response
Returns 200 OK. A page of institutions
NameDescription
dataShow 5 child attributesobject
pageitems_per_pagetotal_pagesitemsShow 10 child attributesobject[]
idUse it as
institution_idnamecountry_iso_codecurrencymin_amountFor reference only, in major units. It is not enforced.
max_amountFor reference only, in major units. It is not enforced.
account_number_typePossible values:
bank_account_number, iban, phone_number, clabeswift_codeSWIFT banks only
addressThe bank's address. SWIFT banks only.
prefillBank fields to copy into a
swift external account, such as bank_address_line_1 and bank_city. SWIFT banks only.total_itemserrorErrors
| Status | Meaning |
|---|---|
| 200 | A page of institutions |
| 400 | Invalid request, an unknown ID or a failure. Read error. A not-found error is a 400 here, not a 404. |
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request GET \
--url 'https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22' \
--header 'Api-Key: <api-key>'
const response = await fetch('https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22', {
method: 'GET',
headers: {
'Api-Key': '<api-key>',
},
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22"
headers = {
"Api-Key": "<api-key>",
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22", nil)
if err != nil {
panic(err)
}
req.Header.Set("Api-Key", "<api-key>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
request["Api-Key"] = "<api-key>"
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Api-Key: <api-key>',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22"))
.header("Api-Key", "<api-key>")
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.gravv.xyz/v1/external-accounts/institutions?page=1&items_per_page=10&country_iso_code=KE¤cy=KES&swift_code=MIDLGB22");
request.Headers.TryAddWithoutValidation("Api-Key", "<api-key>");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200400OK
{
"data": {
"page": 1,
"items_per_page": 10,
"total_pages": 1,
"items": [
{
"id": "9c1d2e3f-4a5b-4c6d-8e7f-0a1b2c3d4e5f",
"name": "Example Mobile Money",
"country_iso_code": "KE",
"currency": "KES",
"min_amount": 1,
"max_amount": 10000,
"account_number_type": "phone_number"
}
],
"total_items": 1
},
"error": null
}
{
"data": null,
"error": "payee 6a2f0c1e-93b4-4d0e-8f57-1c2b3d4e5f60: resource not found",
"code": "ERROR_CODE_NOT_FOUND"
}