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

# 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; the existing transfer is returned.
- **201 Created** — A new account transfer was created.

**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 but **`auto_approve`** approval or initiation failed; the transfer is returned 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 |
| 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 and continues approval and 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 or initiation failed; review the **`warning`** and current **`status`**.
- **503**: Transient error while completing **`auto_approve`**—**retry** the create; use the response **`message`** (and **`error_code`**) for support and automation.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/treasury/account-transfers:
    post:
      operationId: create-account-transfer
      summary: Create account transfer
      description: >-
        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; the existing transfer is returned.

        - **201 Created** — A new account transfer was created.


        **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 but
        **`auto_approve`** approval or initiation failed; the transfer is
        returned 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 |

        | 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 and
        continues approval and 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 or initiation failed;
        review the **`warning`** and current **`status`**.

        - **503**: Transient error while completing **`auto_approve`**—**retry**
        the create; use the response **`message`** (and **`error_code`**) for
        support and automation.
      tags:
        - treasuryApi
      parameters:
        - 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
        - name: Idempotency-Key
          in: header
          description: Unique key to prevent duplicate requests
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Existing account transfer returned for idempotency key
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Treasury
                  API_createAccountTransfer_Response_200
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountTransferRequest'
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    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
    CurrencyCode:
      type: string
      enum:
        - USD
        - GBP
        - INR
      title: CurrencyCode
    CreateAccountTransferRequest:
      type: object
      properties:
        from_account_id:
          type: string
          format: uuid
          description: Main operating account ID (Account.id) to send funds from.
        to_account_id:
          type: string
          format: uuid
          description: Main operating account ID (Account.id) to send funds to.
        amount_in_minor_units:
          type: integer
          description: Transfer amount in the source account currency minor units.
        rail:
          $ref: '#/components/schemas/Rails'
          description: Payment rail (must be in supported_rails)
        currency_code:
          $ref: '#/components/schemas/CurrencyCode'
          description: Currency code; must match the source account.
        auto_approve:
          type: boolean
          description: When true, approve and initiate immediately after create.
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          description: Optional client key-value metadata stored as client_metadata.
      required:
        - from_account_id
        - to_account_id
        - amount_in_minor_units
        - rail
        - currency_code
        - auto_approve
      description: Request model for POST /account-transfers.
      title: CreateAccountTransferRequest
    Treasury API_createAccountTransfer_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Treasury API_createAccountTransfer_Response_200
  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

### 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()
```