> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://useroot.docs.buildwithfern.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://useroot.docs.buildwithfern.com/_mcp/server.

# Add bank payment method for payer

POST https://api.useroot.com/api/payers/{payer_id}/payment-methods/pay-by-bank
Content-Type: application/json

Create a new bank payment method for a payer. This enables ACH Debit (pay by bank) functionality for payins.

Reference: https://useroot.docs.buildwithfern.com/api-reference/payment-methods-api/payer-payment-methods-api/add-payer-bank-payment-method

## Authentication

- `x-api-key` header (required) — RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.

## Request

### Path parameters

- `payer_id` (string, required)

### Query parameters

- `is_default` (boolean, optional, default: true) — Whether to set this payment method as default

### Body (application/json)

- `account_number` (string, required)
- `routing_number` (string, required)
- `routing_number_type` (enum, optional) — aba (US), bic (GB), or ifsc (IN)
  - Allowed values: `aba`, `bic`, `ifsc`
- `currency_code` (enum, optional) — USD (US), GBP (GB), or INR (IN)
  - Allowed values: `USD`, `GBP`, `INR`
- `country_code` (enum, optional) — US, GB, or IN
  - Allowed values: `US`, `GB`, `IN`

## Response

### 201

Bank payment method created successfully

- `data` (object, required) — Shared response model for bank payment methods (both payee and payer).
  - `created_at` (datetime, required)
  - `updated_at` (datetime, required)
  - `id` (string, required)
  - `account_last_four` (string, required)
  - `routing_number` (string, required)
  - `currency_code` (enum, required)
    - Allowed values: `USD`, `GBP`, `INR`
  - `country_code` (enum, required)
    - Allowed values: `US`, `GB`, `IN`
  - `verification_status` (enum, required)
    - Allowed values: `verified`, `pending`, `failed`
  - `is_default` (boolean, required)
  - `supported_rails` (list of enum, required)
    - Allowed values: `instant_card`, `instant_bank`, `same_day_ach`, `standard_ach`, `wire`, `{'instant_card', 'instant_bank'}`, `{'standard_ach', 'same_day_ach'}`, `{'standard_ach', 'wire'}`
  - `payee_id` (string, optional, nullable)
  - `payer_id` (string, optional, nullable)
  - `warning` (string, optional, nullable)
- `warning` (string, optional, nullable)

### 207

Bank payment method created but not set as default due to verification status

## Examples

### United States (ABA)

**Request**

```json
{
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "account_last_four": "7890",
    "routing_number": "021000021",
    "currency_code": "USD",
    "country_code": "US",
    "verification_status": "verified",
    "is_default": true,
    "supported_rails": [
      "same_day_ach",
      "standard_ach"
    ],
    "payer_id": "123e4567-e89b-12d3-a456-426614174000"
  }
}
```

**SDK Code**

```python United States (ABA)
import requests

url = "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank"

payload = {
    "account_number": "1234567890",
    "routing_number": "021000021",
    "routing_number_type": "aba",
    "currency_code": "USD",
    "country_code": "US"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript United States (ABA)
const url = 'https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"account_number":"1234567890","routing_number":"021000021","routing_number_type":"aba","currency_code":"USD","country_code":"US"}'
};

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

```go United States (ABA)
package main

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

func main() {

	url := "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank"

	payload := strings.NewReader("{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}")

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

	req.Header.Add("x-api-key", "<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 United States (ABA)
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}"

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

```java United States (ABA)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank', [
  'body' => '{
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp United States (ABA)
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift United States (ABA)
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")! 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()
```

### Unverified bank account

**Request**

```json
{
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "account_last_four": "7890",
    "routing_number": "021000021",
    "currency_code": "USD",
    "country_code": "US",
    "verification_status": "pending",
    "is_default": false,
    "supported_rails": [
      "same_day_ach",
      "standard_ach"
    ],
    "payer_id": "123e4567-e89b-12d3-a456-426614174000",
    "warning": "Payment method was created but not set as default because it is not verified"
  }
}
```

**SDK Code**

```python Unverified bank account
import requests

url = "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank"

payload = {
    "account_number": "1234567890",
    "routing_number": "021000021",
    "routing_number_type": "aba",
    "currency_code": "USD",
    "country_code": "US"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Unverified bank account
const url = 'https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"account_number":"1234567890","routing_number":"021000021","routing_number_type":"aba","currency_code":"USD","country_code":"US"}'
};

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

```go Unverified bank account
package main

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

func main() {

	url := "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank"

	payload := strings.NewReader("{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}")

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

	req.Header.Add("x-api-key", "<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 Unverified bank account
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}"

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

```java Unverified bank account
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank', [
  'body' => '{
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Unverified bank account
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unverified bank account
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")! 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()
```

### Unverified bank account

**Request**

```json
{
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "account_last_four": "7890",
    "routing_number": "021000021",
    "currency_code": "USD",
    "country_code": "US",
    "verification_status": "pending",
    "is_default": false,
    "supported_rails": [
      "same_day_ach",
      "standard_ach"
    ],
    "payer_id": "123e4567-e89b-12d3-a456-426614174000",
    "warning": "Payment method was created but not set as default because it is not verified"
  }
}
```

**SDK Code**

```python Unverified bank account
import requests

url = "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank"

payload = {
    "account_number": "1234567890",
    "routing_number": "021000021",
    "routing_number_type": "aba",
    "currency_code": "USD",
    "country_code": "US"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Unverified bank account
const url = 'https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"account_number":"1234567890","routing_number":"021000021","routing_number_type":"aba","currency_code":"USD","country_code":"US"}'
};

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

```go Unverified bank account
package main

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

func main() {

	url := "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank"

	payload := strings.NewReader("{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}")

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

	req.Header.Add("x-api-key", "<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 Unverified bank account
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}"

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

```java Unverified bank account
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank', [
  'body' => '{
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Unverified bank account
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"account_number\": \"1234567890\",\n  \"routing_number\": \"021000021\",\n  \"routing_number_type\": \"aba\",\n  \"currency_code\": \"USD\",\n  \"country_code\": \"US\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unverified bank account
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "account_number": "1234567890",
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "currency_code": "USD",
  "country_code": "US"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payers/payer_id/payment-methods/pay-by-bank")! 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()
```