curl --request POST \
--url https://api.bachs.io/v1/misc/bank-accounts/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_number": "0123456789",
"bank_code": "101",
"country": "NG"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_number: '0123456789', bank_code: '101', country: 'NG'})
};
fetch('https://api.bachs.io/v1/misc/bank-accounts/resolve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/misc/bank-accounts/resolve"
payload = {
"account_number": "0123456789",
"bank_code": "101",
"country": "NG"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/misc/bank-accounts/resolve"
payload := strings.NewReader("{\n \"account_number\": \"0123456789\",\n \"bank_code\": \"101\",\n \"country\": \"NG\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"resolved": true,
"account_name": "ADA OKAFOR",
"account_number": "0123456789",
"message": null
}{
"detail": "Invalid request parameters",
"error_code": "VALIDATION_ERROR",
"errors": [
{
"field": "amount",
"message": "Amount must be a positive decimal string",
"type": "value_error"
}
]
}{
"detail": "Invalid API key",
"error_code": "UNAUTHORIZED"
}{
"detail": "Resource not found",
"error_code": "NOT_FOUND"
}Resolve a bank account
Resolve an account number and bank code to the account holder’s name. Worth calling before you submit a payout destination: it turns a rejection days later into an inline error while the account holder is still on the page.
curl --request POST \
--url https://api.bachs.io/v1/misc/bank-accounts/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_number": "0123456789",
"bank_code": "101",
"country": "NG"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_number: '0123456789', bank_code: '101', country: 'NG'})
};
fetch('https://api.bachs.io/v1/misc/bank-accounts/resolve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/misc/bank-accounts/resolve"
payload = {
"account_number": "0123456789",
"bank_code": "101",
"country": "NG"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/misc/bank-accounts/resolve"
payload := strings.NewReader("{\n \"account_number\": \"0123456789\",\n \"bank_code\": \"101\",\n \"country\": \"NG\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"resolved": true,
"account_name": "ADA OKAFOR",
"account_number": "0123456789",
"message": null
}{
"detail": "Invalid request parameters",
"error_code": "VALIDATION_ERROR",
"errors": [
{
"field": "amount",
"message": "Amount must be a positive decimal string",
"type": "value_error"
}
]
}{
"detail": "Invalid API key",
"error_code": "UNAUTHORIZED"
}{
"detail": "Resource not found",
"error_code": "NOT_FOUND"
}Authorizations
Bearer token authentication. Pass your API key as Authorization: Bearer sk_.... See Authentication for keys, scopes, and sandbox vs production.
Body
The account number to look up, digits only and exactly as the account holder typed it.
"0123456789"
Code of the bank holding the account, taken from code on the bank list.
"101"
Two-letter ISO 3166-1 country to resolve in. Falls back to the account's country, and a country outside NG and GH comes back as resolved: false rather than an error.
"NG"
Response
The lookup result. Check resolved before you trust account_name.
Whether the account number was matched. false covers a wrong number, an unsupported country, and a lookup that could not be completed, so read message to tell them apart. A false here is not an HTTP error.
true
Name registered on the account. Show it back for confirmation before you submit the payout destination. null when resolved is false.
"ADA OKAFOR"
The account number as it is held on record, which can be normalised from what you sent. null when resolved is false.
"0123456789"
Why the lookup did not resolve, safe to show the account holder. null on a successful match.
null

