> 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.

# Create account transfer

POST https://api.useroot.com/api/treasury/account-transfers
Content-Type: application/json

Creates an account transfer to move funds between two treasury main accounts.

**Request Headers**

| Header | Type | Required | Description |
|--------|------|----------|-------------|
| `Idempotency-Key` | String | No | Unique key to prevent duplicate requests. If provided, the same key cannot be used for another account transfer. |

**Request Body**

| Field | Type | Required | Description | Validation Rules |
|-------|------|----------|-------------|------------------|
| `from_account_id` | UUID | Yes | Treasury account to send funds from. | Must be an onboarded main account belonging to your organization |
| `to_account_id` | UUID | Yes | Treasury account to receive funds. | Must differ from `from_account_id` |
| `amount_in_minor_units` | Integer | Yes | Amount in the smallest unit of the currency. For USD, cents (100 = $1.00). | Must be a positive whole number |
| `rail` | String | Yes | Payment rail for the transfer. | Must be supported for the source account (see rail-options) |
| `currency_code` | String | Yes | ISO 4217 currency code. | Must match the source account currency |
| `auto_approve` | Boolean | Yes | When `true`, automatically approve and initiate the transfer after create. | Must be explicitly set; there is no default |
| `metadata` | Object | No | Optional client key-value metadata. | String values only |

**Response Body**

| Field | Type | Description |
|-------|------|-------------|
| `id` | UUID | Unique identifier for the account transfer. |
| `from_account_id` | UUID | Source treasury account ID. |
| `to_account_id` | UUID | Destination treasury account ID. |
| `amount_in_minor_units` | Integer | Transfer amount in minor units. |
| `currency_code` | String | ISO 4217 currency code. |
| `rail` | String | Payment rail used. |
| `status` | String | Current status (`created`, `approved`, `initiated`, `settled`, `failed`). |
| `client_metadata` | Object | Client-supplied metadata. |
| `created_at` | DateTime | Timestamp when the transfer was created. |
| `updated_at` | DateTime | Timestamp when the transfer was last updated. |

**Idempotency Key**

When you include an `Idempotency-Key` header:

- **200 OK** — An account transfer with the same idempotency key already exists and no further work is needed for this request; the existing transfer is returned.
- **201 Created** — A new account transfer was created.
- With **`auto_approve=true`**, an idempotency match that is still **`CREATED`** continues approve→initiate. A match in **`CANCELED`** or **`FAILED`** returns **409**.

**Success Responses**

| Status Code | Description |
|-------------|-------------|
| 200 | OK — existing account transfer returned for the provided idempotency key |
| 201 | Created — account transfer created; with **`auto_approve`**, processing finished within this response for your request (**`status`** reflects the result) |
| 202 | Accepted — account transfer created (and approved when **`auto_approve`** is true). **`status`** in the body may still change; poll list endpoints until the transfer reaches a terminal status |
| 207 | Multi-Status — account transfer was created (or already existed as **`CREATED`**) but **approval** failed; transfer remains **`CREATED`** with a **`warning`** |

**Error Responses**

| Status Code | Error Code | Description |
|-------------|------------|-------------|
| 400 | VALIDATION_ERROR | Invalid request body, incompatible currency, or incompatible account combination |
| 401 | AUTHENTICATION_ERROR | Authentication credentials are invalid or missing |
| 403 | AUTHORIZATION_ERROR | You do not have permission to perform this action |
| 404 | NOT_FOUND | One or both treasury accounts were not found |
| 409 | IDEMPOTENCY_KEY_CONFLICT | Idempotency key matches an existing account transfer in a terminal failed or canceled state; use a new key |
| 422 | Unprocessable Entity | Request body failed schema validation (e.g. missing required fields such as `auto_approve` or `currency_code`) |
| 503 | ASYNC_INITIATION_UNAVAILABLE | With **`auto_approve`**, the transfer was created (and approved) but initiation hit a **transient error**. **Retry** after a short wait |

**`auto_approve` behavior**

When **`auto_approve=true`**, the API creates the account transfer (or continues from an idempotent **`CREATED`** match) and continues approval and async initiation as far as this request allows. You may receive **201**, **202**, **207**, or **503** depending on outcome:

- **201** / **202**: The account transfer id is always in the response. If you receive **202**, poll until **`status`** reaches a value you treat as final for your integration.
- **207**: The transfer was created but **approval** failed; review the **`warning`** and current **`status`** (still **`CREATED`**).
- **503**: Transient error while starting async initiation—**retry** the create; use the response **`message`** (and **`error_code`**) for support and automation.

Reference: https://useroot.docs.buildwithfern.com/api-reference/treasury-api/create-account-transfer

## 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

### Headers

- `Idempotency-Key` (string, optional, nullable) — Unique key to prevent duplicate requests

### Body (application/json)

- `from_account_id` (string, required) — Main operating account ID (Account.id) to send funds from.
- `to_account_id` (string, required) — Main operating account ID (Account.id) to send funds to.
- `amount_in_minor_units` (integer, required) — Transfer amount in the source account currency minor units.
- `rail` (enum, required) — Payment rail (must be in supported_rails)
  - Allowed values: `instant_card`, `instant_bank`, `same_day_ach`, `standard_ach`, `wire`, `{'instant_card', 'instant_bank'}`, `{'standard_ach', 'same_day_ach'}`, `{'standard_ach', 'wire'}`
- `currency_code` (enum, required) — Currency code; must match the source account.
  - Allowed values: `USD`, `GBP`, `INR`
- `auto_approve` (boolean, required) — When true, approve and initiate immediately after create.
- `metadata` (map from string to string, optional, nullable) — Optional client key-value metadata stored as client_metadata.
- `scheduled_date` (date, optional, nullable) — Calendar day to release the transfer in its schedule timezone (currently America/New_York). Omitted for immediate. Not the beneficiary credit date. Resolved to 09:00 in that timezone.

## Response

### 200

Existing account transfer returned for idempotency key

### 201

Account transfer created

- `data` (object, required) — Platform-initiated move between two main accounts (TreasuryAccountTransfer).
  - `id` (string, required)
  - `from_account_id` (string, required)
  - `to_account_id` (string, required)
  - `amount_in_minor_units` (integer, required)
  - `currency_code` (string, required)
  - `rail` (string, required)
  - `status` (string, required)
  - `created_at` (datetime, required)
  - `updated_at` (datetime, required)
  - `client_metadata` (map from string to any, optional)
  - `scheduled_date` (date, optional, nullable) — Caller-chosen send day in the schedule timezone (currently America/New_York), or null when immediate.
- `warning` (string, optional, nullable)

### 202

Accepted; initiation may continue asynchronously

### 207

Account transfer created but auto-approval failed; transfer remains CREATED

## Examples

### Example 1

**Request**

```json
{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/treasury/account-transfers"

payload = {
    "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "rail": "instant_card",
    "currency_code": "USD",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/treasury/account-transfers';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"from_account_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","to_account_id":"7c9e6679-7425-40de-944b-e07fc1f90ae7","amount_in_minor_units":2500,"rail":"instant_card","currency_code":"USD","auto_approve":true}'
};

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://api.useroot.com/api/treasury/account-transfers"

	payload := strings.NewReader("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/treasury/account-transfers")

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  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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://api.useroot.com/api/treasury/account-transfers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/treasury/account-transfers', [
  'body' => '{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/treasury/account-transfers");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/treasury/account-transfers")! 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
{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/treasury/account-transfers"

payload = {
    "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "rail": "instant_card",
    "currency_code": "USD",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/treasury/account-transfers';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"from_account_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","to_account_id":"7c9e6679-7425-40de-944b-e07fc1f90ae7","amount_in_minor_units":2500,"rail":"instant_card","currency_code":"USD","auto_approve":true}'
};

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://api.useroot.com/api/treasury/account-transfers"

	payload := strings.NewReader("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/treasury/account-transfers")

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  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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://api.useroot.com/api/treasury/account-transfers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/treasury/account-transfers', [
  'body' => '{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/treasury/account-transfers");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/treasury/account-transfers")! 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 3

**Request**

```json
{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/treasury/account-transfers"

payload = {
    "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "rail": "instant_card",
    "currency_code": "USD",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/treasury/account-transfers';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"from_account_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","to_account_id":"7c9e6679-7425-40de-944b-e07fc1f90ae7","amount_in_minor_units":2500,"rail":"instant_card","currency_code":"USD","auto_approve":true}'
};

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://api.useroot.com/api/treasury/account-transfers"

	payload := strings.NewReader("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/treasury/account-transfers")

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  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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://api.useroot.com/api/treasury/account-transfers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/treasury/account-transfers', [
  'body' => '{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/treasury/account-transfers");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/treasury/account-transfers")! 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 4

**Request**

```json
{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/treasury/account-transfers"

payload = {
    "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "rail": "instant_card",
    "currency_code": "USD",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/treasury/account-transfers';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"from_account_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","to_account_id":"7c9e6679-7425-40de-944b-e07fc1f90ae7","amount_in_minor_units":2500,"rail":"instant_card","currency_code":"USD","auto_approve":true}'
};

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://api.useroot.com/api/treasury/account-transfers"

	payload := strings.NewReader("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/treasury/account-transfers")

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  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\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://api.useroot.com/api/treasury/account-transfers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/treasury/account-transfers', [
  'body' => '{
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/treasury/account-transfers");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"from_account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"to_account_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n  \"amount_in_minor_units\": 2500,\n  \"rail\": \"instant_card\",\n  \"currency_code\": \"USD\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "from_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "to_account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "amount_in_minor_units": 2500,
  "rail": "instant_card",
  "currency_code": "USD",
  "auto_approve": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/treasury/account-transfers")! 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()
```