> Toden documentation. For the full index fetch /llms.txt. Every page is available as Markdown by appending .md to its URL. Every endpoint is under /api/v1. Identity verification and Risk Intelligence are separate contracts there with different error shapes; /api/kyc and /api/identity are older prefixes that still answer the same. Never invent an endpoint, field or enum value: read the API reference page for the operation first.

# Check a bank account

POST https://sandbox-api.toden.co/api/v1/checks/bank_account
Content-Type: application/json

Checks whether a bank account belongs to the person or business you name. Available in Nigeria, Kenya and South Africa, for people and registered businesses.

Pick the bank from `GET /api/v1/checks/bank_account/banks` and send its `code` as `bankCode`. Send `holder.fullName` for a person or `holder.businessName` for a business. In South Africa also send the person's `idNumber`, or the business's `registrationNumber`.

In Nigeria and Kenya the name is optional. Without one the bank is only asked whether it holds the account and under what name: `match` is `not_compared`, `holderName` is the bank's name for it, and the check passes when the account exists and fails when it does not (`not_found`). Send `holderType: business` to check a business account with no name. The price is the same with or without a name. In South Africa the banks never return a name and only confirm the one they are sent, so a name is required there: without one the check is refused `400 invalid_input`.

In Nigeria and Kenya the bank returns the name the account is held under, and Toden scores it against the name you sent, 0 to 100, as every Toden name check does: `match` at 89 or more (any order, a typing slip or a middle name the bank left out allowed, a company's legal ending such as Ltd ignored; for a person every word of the bank's name must be one of yours, with your first name and surname both there), `close_match` just below it or with an extra or missing word, `no_match` otherwise. In South Africa the banks compare the name themselves and never return one, so the answer is `match` or `no_match`.

Outcome: `match` passes, unless the bank says the account is closed or the identity number is not the holder's, which go to review; `not_compared` (no name sent) passes; `close_match` goes to review; `no_match` and `not_found` fail.

In Sandbox no bank is asked and nothing is charged. Pick any bank from the list (the same real banks as in production); the account number's last four digits choose the answer: `0000` match, `1111` close match (in South Africa, a match on a closed account), `2222` no match, `3333` no such account, `9999` the bank cannot be reached (unavailable). Sandbox answers carry `testData: true`.

Requires bank account verification to be switched on for your organisation: otherwise `403 feature_disabled`.

Charged per check at your price (production only); a check that could not be completed is not charged. Send a `requestId`: a retry with the same value returns the same check with `replayed: true`, without running or charging again.

**Error codes**

| `error` | Status | Meaning |
|---|---|---|
| `invalid_input` | 400 | The body is missing something the check needs, or the requestId is malformed. |
| `insufficient_credits` | 402 | Your balance cannot cover the check. Nothing was run or charged. |
| `checks_unavailable` | 403 | These checks are not switched on for your organisation yet. |
| `spot_checks_disabled` | 403 | Spot checks are not enabled for your organisation, or every verification is switched off for it. |
| `request_id_reused` | 409 | The requestId was used for a different check. |
| `check_in_progress` | 409 | A check with this requestId is still running. |
| `file_not_found` | 422 | The uploaded file was not found, is not yours, or has expired. |
| `check_unavailable` | 503 | The check cannot run on this deployment right now. Nothing was charged. |
| `feature_disabled` | 403 | Bank account checks: not switched on for your organisation. |
| `unknown_bank` | 422 | Bank account checks: the bankCode is not on the country's list of banks. |
| `secret_key_required` | 403 | A publishable key was used. This endpoint accepts secret keys only. |
| `environment_mismatch` | 403 | The key belongs to an environment this deployment does not serve. |
| `ip_not_allowed` | 403 | The key has an IP allowlist and the calling address is not on it. |
| `organization_suspended` | 403 | The organisation is suspended. The response carries `reason` and `suspendedAt`. |
| `business_not_approved` | 403 | A live key was used before the business was approved for production. |

A missing or unknown key answers `401`, where `error` is a short sentence rather than a code.

Requires a secret (`sk_`) key. A publishable key receives `403 secret_key_required`.

Reference: https://docs.toden.co/api-reference/verification/standalone-checks/create-bank-account-check

## Authentication

- `Authorization` header (bearer token, required) — Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required. A scoped publishable key has Verification flow access, the fixed set `flow.run`, `flow.config.read` and `verifications.status.read`; a scoped secret key reaches what its scopes allow.

## Servers

- `https://sandbox-api.toden.co` (Sandbox, default)
- `https://api.toden.co` (Production)

## Request

### Body (application/json)

This endpoint expects a BankAccountCheckRequest.

- `country` (enum, required) — `NG`, `KE` or `ZA`.
  - Allowed values: `NG`, `KE`, `ZA`
- `bankCode` (string, required) — The bank's `code` from the list of banks.
- `accountNumber` (string, required) — The account number. Spaces and dashes are ignored. Ten digits in Nigeria (NUBAN).
- `holder` (BankAccountCheckRequestHolder, optional) — Who the account should belong to: one of `fullName` (a person) or `businessName` (a business). Required in South Africa; optional in Nigeria and Kenya, where without it nothing is compared.
- `holderType` (enum, optional) — Whether the account should belong to a person (the default) or a business, for a check with no name. With a name it must agree with it.
  - Allowed values: `person`, `business`
- `idNumber` (string, optional) — South Africa, person: the holder's 13-digit identity number. Required there.
- `registrationNumber` (string, optional) — South Africa, business: the company registration number. Required there.
- `accountType` (enum, optional) — South Africa, optional: the account type. Defaults to `current`.
  - Allowed values: `current`, `savings`, `transmission`
- `externalUserId` (string, optional) — Your own reference for the check (a customer or case id), kept with it and searchable in your history.
- `requestId` (string, optional) — Your idempotency key, 8 to 120 characters: a retry with the same value returns the same check.

## Response

### 200

A retry: the check already run under this requestId.

- `id` (string, required) — The check id (`chk_…`).
- `kind` (enum, required) — Which check this is.
  - Allowed values: `bank_account`
- `outcome` (enum, required) — `pass`: nothing of concern. `review`: something a person should look at. `fail`: a clear problem. `unavailable`: the check could not be completed, was not charged, and is never a pass.
  - Allowed values: `pass`, `review`, `fail`, `unavailable`
- `subject` (string, required) — What was checked, as your history lists it.
- `channel` (enum, required) — Whether the check was run through the API or from the dashboard.
  - Allowed values: `api`, `dashboard`
- `createdAt` (datetime, required) — When the check was run.
- `input` (BankAccountCheckInput, optional) — What was sent, minimised: never image bytes, only media ids.
- `externalUserId` (string, optional, nullable) — Your own reference for the check, as sent.
- `result` (BankAccountCheckResult, optional, nullable) — What was found. Null when the check could not be completed.
- `failureCode` (string, optional, nullable) — Why the check could not be completed, when `outcome` is `unavailable`.
- `charged` (string, optional, nullable) — What the check cost in USD, as a decimal string. Null when nothing was charged.
- `entityId` (string, optional, nullable) — The customer record this check was saved to.
- `completedAt` (datetime, optional, nullable) — When it finished.
- `replayed` (boolean, optional) — On a run only: true when this is a check already run under the same `requestId`.

### 201

The check was run.

- `id` (string, required) — The check id (`chk_…`).
- `kind` (enum, required) — Which check this is.
  - Allowed values: `bank_account`
- `outcome` (enum, required) — `pass`: nothing of concern. `review`: something a person should look at. `fail`: a clear problem. `unavailable`: the check could not be completed, was not charged, and is never a pass.
  - Allowed values: `pass`, `review`, `fail`, `unavailable`
- `subject` (string, required) — What was checked, as your history lists it.
- `channel` (enum, required) — Whether the check was run through the API or from the dashboard.
  - Allowed values: `api`, `dashboard`
- `createdAt` (datetime, required) — When the check was run.
- `input` (BankAccountCheckInput, optional) — What was sent, minimised: never image bytes, only media ids.
- `externalUserId` (string, optional, nullable) — Your own reference for the check, as sent.
- `result` (BankAccountCheckResult, optional, nullable) — What was found. Null when the check could not be completed.
- `failureCode` (string, optional, nullable) — Why the check could not be completed, when `outcome` is `unavailable`.
- `charged` (string, optional, nullable) — What the check cost in USD, as a decimal string. Null when nothing was charged.
- `entityId` (string, optional, nullable) — The customer record this check was saved to.
- `completedAt` (datetime, optional, nullable) — When it finished.
- `replayed` (boolean, optional) — On a run only: true when this is a check already run under the same `requestId`.

## Errors

### 400 Bad Request Error

The request body, query or path was invalid.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 401 Unauthorized Error

The Authorization header is missing, or the API key is unknown or revoked.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 402 Payment Required Error

The organisation does not have enough credit for this request.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 403 Forbidden Error

The key may not call this endpoint, or the organisation may not use this feature.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 409 Conflict Error

The request conflicts with the current state of the resource.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 422 Unprocessable Entity Error

The request was understood but cannot be processed as sent.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 503 Service Unavailable Error

The service is temporarily unavailable.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

## Types

### BankAccountCheckRequestHolder

Who the account should belong to: one of `fullName` (a person) or `businessName` (a business). Required in South Africa; optional in Nigeria and Kenya, where without it nothing is compared.

- `fullName` (string, optional) — The person's full name.
- `businessName` (string, optional) — The business's registered name.

### BankAccountCheckInput

What was sent, minimised: never image bytes, only media ids.

### BankAccountCheckResult

What was found. Null when the check could not be completed.

- `match` (enum, required) — `match`, `close_match`, `no_match`, `not_found` (the bank has no such account) or `not_compared` (no name was sent, so none was compared; Nigeria and Kenya).
  - Allowed values: `match`, `close_match`, `no_match`, `not_found`, `not_compared`
- `accountNumberMasked` (string, required) — The account number with all but its last four digits hidden.
- `accountFound` (boolean, required) — Whether the bank has the account.
- `country` (enum, required) — The country checked.
  - Allowed values: `NG`, `KE`, `ZA`
- `holderType` (enum, required) — Whether the account was checked for a person or a business.
  - Allowed values: `person`, `business`
- `nameScore` (integer, optional, nullable) — The name match score, 0 to 100. Null where the bank compared the name itself (South Africa), no name was sent, or no account was found.
- `holderName` (string, optional, nullable) — The name the bank holds the account under. Nigeria and Kenya only.
- `bankName` (string, optional, nullable) — The bank.
- `accountOpen` (boolean, optional, nullable) — South Africa: whether the account is open. Null elsewhere.
- `acceptsCredits` (boolean, optional, nullable) — South Africa: whether the account accepts payments in.
- `acceptsDebits` (boolean, optional, nullable) — South Africa: whether the account accepts debits.
- `idNumberMatch` (boolean, optional, nullable) — South Africa, person: whether the identity number sent is the holder's.
- `testData` (boolean, optional) — True on a Sandbox answer, where no bank was asked.

## Examples

### Example 1

**Request**

```json
{
  "country": "NG",
  "bankCode": "058",
  "accountNumber": "0123456789",
  "holder": {
    "fullName": "Ada Obi"
  },
  "requestId": "bank-check-7f3a91c2"
}
```

**Response**

```json
{
  "id": "string",
  "kind": "bank_account",
  "outcome": "pass",
  "subject": "string",
  "channel": "api",
  "createdAt": "2024-01-15T09:30:00Z",
  "input": {},
  "externalUserId": "string",
  "result": {
    "match": "match",
    "accountNumberMasked": "string",
    "accountFound": true,
    "country": "NG",
    "holderType": "person",
    "nameScore": 1,
    "holderName": "string",
    "bankName": "string",
    "accountOpen": true,
    "acceptsCredits": true,
    "acceptsDebits": true,
    "idNumberMatch": true,
    "testData": true
  },
  "failureCode": "string",
  "charged": "string",
  "entityId": "string",
  "completedAt": "2024-01-15T09:30:00Z",
  "replayed": true
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/checks/bank_account"

payload = {
    "country": "NG",
    "bankCode": "058",
    "accountNumber": "0123456789",
    "holder": { "fullName": "Ada Obi" },
    "requestId": "bank-check-7f3a91c2"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/bank_account';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"country":"NG","bankCode":"058","accountNumber":"0123456789","holder":{"fullName":"Ada Obi"},"requestId":"bank-check-7f3a91c2"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/checks/bank_account"

	payload := strings.NewReader("{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.toden.co/api/v1/checks/bank_account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox-api.toden.co/api/v1/checks/bank_account")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/checks/bank_account', [
  'body' => '{
  "country": "NG",
  "bankCode": "058",
  "accountNumber": "0123456789",
  "holder": {
    "fullName": "Ada Obi"
  },
  "requestId": "bank-check-7f3a91c2"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/bank_account");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "country": "NG",
  "bankCode": "058",
  "accountNumber": "0123456789",
  "holder": ["fullName": "Ada Obi"],
  "requestId": "bank-check-7f3a91c2"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/checks/bank_account")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "country": "NG",
  "bankCode": "058",
  "accountNumber": "0123456789",
  "holder": {
    "fullName": "Ada Obi"
  },
  "requestId": "bank-check-7f3a91c2"
}
```

**Response**

```json
{
  "id": "string",
  "kind": "bank_account",
  "outcome": "pass",
  "subject": "string",
  "channel": "api",
  "createdAt": "2024-01-15T09:30:00Z",
  "input": {},
  "externalUserId": "string",
  "result": {
    "match": "match",
    "accountNumberMasked": "string",
    "accountFound": true,
    "country": "NG",
    "holderType": "person",
    "nameScore": 1,
    "holderName": "string",
    "bankName": "string",
    "accountOpen": true,
    "acceptsCredits": true,
    "acceptsDebits": true,
    "idNumberMatch": true,
    "testData": true
  },
  "failureCode": "string",
  "charged": "string",
  "entityId": "string",
  "completedAt": "2024-01-15T09:30:00Z",
  "replayed": true
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/checks/bank_account"

payload = {
    "country": "NG",
    "bankCode": "058",
    "accountNumber": "0123456789",
    "holder": { "fullName": "Ada Obi" },
    "requestId": "bank-check-7f3a91c2"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/bank_account';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"country":"NG","bankCode":"058","accountNumber":"0123456789","holder":{"fullName":"Ada Obi"},"requestId":"bank-check-7f3a91c2"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/checks/bank_account"

	payload := strings.NewReader("{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.toden.co/api/v1/checks/bank_account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox-api.toden.co/api/v1/checks/bank_account")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/checks/bank_account', [
  'body' => '{
  "country": "NG",
  "bankCode": "058",
  "accountNumber": "0123456789",
  "holder": {
    "fullName": "Ada Obi"
  },
  "requestId": "bank-check-7f3a91c2"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/bank_account");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"country\": \"NG\",\n  \"bankCode\": \"058\",\n  \"accountNumber\": \"0123456789\",\n  \"holder\": {\n    \"fullName\": \"Ada Obi\"\n  },\n  \"requestId\": \"bank-check-7f3a91c2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "country": "NG",
  "bankCode": "058",
  "accountNumber": "0123456789",
  "holder": ["fullName": "Ada Obi"],
  "requestId": "bank-check-7f3a91c2"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/checks/bank_account")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```