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

# Add bank payment method

POST https://api.useroot.com/api/payees/{payee_id}/payment-methods/pay-to-bank
Content-Type: application/json

Adds a new bank account payment method for a payee. Supports pay-to-bank transfers with account and routing number details for United States and Great Britain bank accounts.

**Path Parameters**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `payee_id` | UUID | Yes | ID of the payee to add the payment method to |

**Request Body — bank account shapes**

Send **`country_code`**, **`currency_code`**, **`routing_number_type`**, **`account_number`**, and **`routing_number`** consistent with one of the supported rows below. Internally inconsistent combinations (for example US country with an IBAN-shaped account, or GB with ABA routing) return **`400`** validation errors.

| Region | `country_code` | `currency_code` | `routing_number_type` | `account_number` | `routing_number` |
|--------|----------------|-----------------|------------------------|------------------|------------------|
| United States | `US` | `USD` | `aba` (default) | Domestic US account number (digits; not IBAN-shaped) | 9-digit ABA routing number |
| Great Britain | `GB` | `GBP` | `bic` | Valid **GB** IBAN | BIC / SWIFT (**8** or **11** characters) |

**When `country_code` and `currency_code` are omitted**  
They default to **`US`** and **`USD`**; `routing_number_type` defaults to **`aba`**.

**Great Britain notes**

- IBAN must validate structurally (including check digits) and use the **`GB`** country prefix for v1.
- On create, verification may return **`pending`**; use GET list/detail on payment methods or webhooks to observe **`verified`** or **`failed`**.

**Request Body fields**

| Field | Type | Required | Description | Validation Rules |
|-------|------|----------|-------------|-----------------|
| `account_number` | String | Yes | Account identifier | **US:** digits-only domestic account (max length per API). **GB:** IBAN (GB prefix, valid checksum). |
| `routing_number` | String | Yes | Routing identifier | **US:** 9-digit ABA. **GB:** BIC/SWIFT per `routing_number_type` `bic`. |
| `routing_number_type` | String | No | `aba` or `bic` | Must match `country_code` row in the matrix above (GB requires `bic`). |
| `currency_code` | String | No | ISO 4217 code | Must pair with `country_code` per supported pairs (`USD`↔`US`, `GBP`↔`GB`). |
| `country_code` | String | No | ISO 3166-1 alpha-2 | `US` or `GB` for supported payee bank accounts. |

**Response Body**

| Field | Type | Description |
|-------|------|-------------|
| `id` | UUID | Unique identifier for the payment method |
| `payee_id` | UUID | ID of the payee associated with the payment method |
| `account_last_four` | String | Last four characters/digits derived from the account number for display |
| `routing_number` | String | Routing identifier stored for the payment method |
| `currency_code` | String | ISO 4217 currency code of the account |
| `country_code` | String | ISO 3166-1 alpha-2 country code of the bank account |
| `verification_status` | String | Current verification status (`pending`, `verified`, or `failed`) |
| `is_default` | Boolean | Whether this is the default payment method for the payee |
| `supported_rails` | Array | Rails available for this payment method given country, currency, and bank configuration |
| `created_at` | DateTime | Timestamp when the payment method was created |
| `updated_at` | DateTime | Timestamp when the payment method was last updated |
| `warning` | String | Optional. Present on 207 responses when the payment method was created but not set as default |

**Success Responses**

| Status Code | Description |
|-------------|-------------|
| 201 | Created - The payment method was successfully added and set as default (if requested) |
| 207 | Multi-Status - The payment method was created but not set as default due to verification status. Check `warning` for details. |

**Error Responses**

| Status Code | Error Code | Description |
|-------------|------------|-------------|
| 400 | VALIDATION_ERROR | The provided data failed validation |
| 401 | AUTHENTICATION_ERROR | Authentication credentials are invalid or missing |
| 403 | AUTHORIZATION_ERROR | You do not have permission to perform this action |
| 404 | NOT_FOUND | The specified payee was not found |
| 409 | DUPLICATE_RESOURCE | A payment method with these details already exists |
| 422 | INVALID_PAYMENT_DETAILS | The payment details are invalid or incomplete |

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/payees/{payee_id}/payment-methods/pay-to-bank:
    post:
      operationId: add-payee-bank-payment-method
      summary: Add bank payment method
      description: >-
        Adds a new bank account payment method for a payee. Supports pay-to-bank
        transfers with account and routing number details for United States and
        Great Britain bank accounts.


        **Path Parameters**


        | Parameter | Type | Required | Description |

        |-----------|------|----------|-------------|

        | `payee_id` | UUID | Yes | ID of the payee to add the payment method to
        |


        **Request Body — bank account shapes**


        Send **`country_code`**, **`currency_code`**, **`routing_number_type`**,
        **`account_number`**, and **`routing_number`** consistent with one of
        the supported rows below. Internally inconsistent combinations (for
        example US country with an IBAN-shaped account, or GB with ABA routing)
        return **`400`** validation errors.


        | Region | `country_code` | `currency_code` | `routing_number_type` |
        `account_number` | `routing_number` |

        |--------|----------------|-----------------|------------------------|------------------|------------------|

        | United States | `US` | `USD` | `aba` (default) | Domestic US account
        number (digits; not IBAN-shaped) | 9-digit ABA routing number |

        | Great Britain | `GB` | `GBP` | `bic` | Valid **GB** IBAN | BIC / SWIFT
        (**8** or **11** characters) |


        **When `country_code` and `currency_code` are omitted**  

        They default to **`US`** and **`USD`**; `routing_number_type` defaults
        to **`aba`**.


        **Great Britain notes**


        - IBAN must validate structurally (including check digits) and use the
        **`GB`** country prefix for v1.

        - On create, verification may return **`pending`**; use GET list/detail
        on payment methods or webhooks to observe **`verified`** or
        **`failed`**.


        **Request Body fields**


        | Field | Type | Required | Description | Validation Rules |

        |-------|------|----------|-------------|-----------------|

        | `account_number` | String | Yes | Account identifier | **US:**
        digits-only domestic account (max length per API). **GB:** IBAN (GB
        prefix, valid checksum). |

        | `routing_number` | String | Yes | Routing identifier | **US:** 9-digit
        ABA. **GB:** BIC/SWIFT per `routing_number_type` `bic`. |

        | `routing_number_type` | String | No | `aba` or `bic` | Must match
        `country_code` row in the matrix above (GB requires `bic`). |

        | `currency_code` | String | No | ISO 4217 code | Must pair with
        `country_code` per supported pairs (`USD`↔`US`, `GBP`↔`GB`). |

        | `country_code` | String | No | ISO 3166-1 alpha-2 | `US` or `GB` for
        supported payee bank accounts. |


        **Response Body**


        | Field | Type | Description |

        |-------|------|-------------|

        | `id` | UUID | Unique identifier for the payment method |

        | `payee_id` | UUID | ID of the payee associated with the payment method
        |

        | `account_last_four` | String | Last four characters/digits derived
        from the account number for display |

        | `routing_number` | String | Routing identifier stored for the payment
        method |

        | `currency_code` | String | ISO 4217 currency code of the account |

        | `country_code` | String | ISO 3166-1 alpha-2 country code of the bank
        account |

        | `verification_status` | String | Current verification status
        (`pending`, `verified`, or `failed`) |

        | `is_default` | Boolean | Whether this is the default payment method
        for the payee |

        | `supported_rails` | Array | Rails available for this payment method
        given country, currency, and bank configuration |

        | `created_at` | DateTime | Timestamp when the payment method was
        created |

        | `updated_at` | DateTime | Timestamp when the payment method was last
        updated |

        | `warning` | String | Optional. Present on 207 responses when the
        payment method was created but not set as default |


        **Success Responses**


        | Status Code | Description |

        |-------------|-------------|

        | 201 | Created - The payment method was successfully added and set as
        default (if requested) |

        | 207 | Multi-Status - The payment method was created but not set as
        default due to verification status. Check `warning` for details. |


        **Error Responses**


        | Status Code | Error Code | Description |

        |-------------|------------|-------------|

        | 400 | VALIDATION_ERROR | The provided data failed validation |

        | 401 | AUTHENTICATION_ERROR | Authentication credentials are invalid or
        missing |

        | 403 | AUTHORIZATION_ERROR | You do not have permission to perform this
        action |

        | 404 | NOT_FOUND | The specified payee was not found |

        | 409 | DUPLICATE_RESOURCE | A payment method with these details already
        exists |

        | 422 | INVALID_PAYMENT_DETAILS | The payment details are invalid or
        incomplete |
      tags:
        - payeePaymentMethodsApi
      parameters:
        - name: payee_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: is_default
          in: query
          description: Whether to set this payment method as default
          required: false
          schema:
            type: boolean
            default: true
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Bank payment method created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_BankPaymentMethodResponse_'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankPaymentMethodRequest'
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    RoutingNumberType:
      type: string
      enum:
        - aba
        - bic
        - ifsc
      title: RoutingNumberType
    CurrencyCode:
      type: string
      enum:
        - USD
        - GBP
        - INR
      title: CurrencyCode
    CountryCode:
      type: string
      enum:
        - US
        - GB
        - IN
      title: CountryCode
    BankPaymentMethodRequest:
      type: object
      properties:
        account_number:
          type: string
        routing_number:
          type: string
        routing_number_type:
          $ref: '#/components/schemas/RoutingNumberType'
          description: aba (US), bic (GB), or ifsc (IN)
        currency_code:
          $ref: '#/components/schemas/CurrencyCode'
          description: USD (US), GBP (GB), or INR (IN)
        country_code:
          $ref: '#/components/schemas/CountryCode'
          description: US, GB, or IN
      required:
        - account_number
        - routing_number
      description: |-
        Shared request model for bank payment methods (both payee and payor).

        All shape validation runs in a single ``@model_validator(mode='after')``
        so that:

        - The Pydantic field-declaration order (which used to leak the
          ``BIC`` vs ``ABA`` field-order bug — see design doc *Risks*) no longer
          matters; ``routing_number_type``, ``routing_number``, and ``country_code``
          are all bound by the time validation runs.
        - The user sees **every** error in one 4xx response: type-vs-country
          mismatches and bad account / routing number formats are accumulated
          rather than reported one-at-a-time.
        - Per-country identifier shape lives in **one** place — the AVS country
          dispatch table at ``avs_payloads.spec_for(country)`` — which both this
          validator and ``AVSValidationRequest.to_payload()`` consume. Adding a
          country is a single row in that table; no changes to this validator.
      title: BankPaymentMethodRequest
    VerificationStatus:
      type: string
      enum:
        - verified
        - pending
        - failed
      title: VerificationStatus
    Rails:
      type: string
      enum:
        - instant_card
        - instant_bank
        - same_day_ach
        - standard_ach
        - wire
        - '{''instant_card'', ''instant_bank''}'
        - '{''same_day_ach'', ''standard_ach''}'
        - '{''standard_ach'', ''wire''}'
      title: Rails
    BankPaymentMethodResponse:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        id:
          type: string
          format: uuid
        payee_id:
          type:
            - string
            - 'null'
          format: uuid
        payer_id:
          type:
            - string
            - 'null'
          format: uuid
        account_last_four:
          type: string
        routing_number:
          type: string
        currency_code:
          $ref: '#/components/schemas/CurrencyCode'
        country_code:
          $ref: '#/components/schemas/CountryCode'
        verification_status:
          $ref: '#/components/schemas/VerificationStatus'
        is_default:
          type: boolean
        supported_rails:
          type: array
          items:
            $ref: '#/components/schemas/Rails'
        warning:
          type:
            - string
            - 'null'
      required:
        - created_at
        - updated_at
        - id
        - account_last_four
        - routing_number
        - currency_code
        - country_code
        - verification_status
        - is_default
        - supported_rails
      description: Shared response model for bank payment methods (both payee and payer).
      title: BankPaymentMethodResponse
    Response_BankPaymentMethodResponse_:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/BankPaymentMethodResponse'
        warning:
          type:
            - string
            - 'null'
      required:
        - data
      title: Response_BankPaymentMethodResponse_
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## 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": [
      "instant_bank",
      "same_day_ach",
      "standard_ach",
      "wire"
    ],
    "payee_id": "987e6543-c21b-43a5-a987-654321098765"
  }
}
```

**SDK Code**

```python United States (ABA)
import requests

url = "https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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()
```

### Great Britain (IBAN + BIC)



**Request**

```json
{
  "account_number": "GB29NWBK60161331926819",
  "routing_number": "NWBKGB2LXXX",
  "routing_number_type": "bic",
  "currency_code": "GBP",
  "country_code": "GB"
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174004",
    "account_last_four": "6819",
    "routing_number": "NWBKGB2LXXX",
    "currency_code": "GBP",
    "country_code": "GB",
    "verification_status": "pending",
    "is_default": true,
    "supported_rails": [
      "standard_ach",
      "wire"
    ],
    "payee_id": "987e6543-c21b-43a5-a987-654321098765"
  }
}
```

**SDK Code**

```python Great Britain (IBAN + BIC)
import requests

url = "https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-bank"

payload = {
    "account_number": "GB29NWBK60161331926819",
    "routing_number": "NWBKGB2LXXX",
    "routing_number_type": "bic",
    "currency_code": "GBP",
    "country_code": "GB"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Great Britain (IBAN + BIC)
const url = 'https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-bank';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"account_number":"GB29NWBK60161331926819","routing_number":"NWBKGB2LXXX","routing_number_type":"bic","currency_code":"GBP","country_code":"GB"}'
};

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

```go Great Britain (IBAN + BIC)
package main

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

func main() {

	url := "https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-bank"

	payload := strings.NewReader("{\n  \"account_number\": \"GB29NWBK60161331926819\",\n  \"routing_number\": \"NWBKGB2LXXX\",\n  \"routing_number_type\": \"bic\",\n  \"currency_code\": \"GBP\",\n  \"country_code\": \"GB\"\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 Great Britain (IBAN + BIC)
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-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\": \"GB29NWBK60161331926819\",\n  \"routing_number\": \"NWBKGB2LXXX\",\n  \"routing_number_type\": \"bic\",\n  \"currency_code\": \"GBP\",\n  \"country_code\": \"GB\"\n}"

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

```java Great Britain (IBAN + BIC)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-bank")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_number\": \"GB29NWBK60161331926819\",\n  \"routing_number\": \"NWBKGB2LXXX\",\n  \"routing_number_type\": \"bic\",\n  \"currency_code\": \"GBP\",\n  \"country_code\": \"GB\"\n}")
  .asString();
```

```php Great Britain (IBAN + BIC)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-bank', [
  'body' => '{
  "account_number": "GB29NWBK60161331926819",
  "routing_number": "NWBKGB2LXXX",
  "routing_number_type": "bic",
  "currency_code": "GBP",
  "country_code": "GB"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Great Britain (IBAN + BIC)
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-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\": \"GB29NWBK60161331926819\",\n  \"routing_number\": \"NWBKGB2LXXX\",\n  \"routing_number_type\": \"bic\",\n  \"currency_code\": \"GBP\",\n  \"country_code\": \"GB\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Great Britain (IBAN + BIC)
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "account_number": "GB29NWBK60161331926819",
  "routing_number": "NWBKGB2LXXX",
  "routing_number_type": "bic",
  "currency_code": "GBP",
  "country_code": "GB"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payees/payee_id/payment-methods/pay-to-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": [
      "instant_bank",
      "same_day_ach",
      "standard_ach",
      "wire"
    ],
    "payee_id": "987e6543-c21b-43a5-a987-654321098765",
    "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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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": [
      "instant_bank",
      "same_day_ach",
      "standard_ach",
      "wire"
    ],
    "payee_id": "987e6543-c21b-43a5-a987-654321098765",
    "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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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/payees/payee_id/payment-methods/pay-to-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()
```