> 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 a new payout

POST https://api.useroot.com/api/payouts
Content-Type: application/json

Creates a new payout to transfer funds to a payee using their default payment method. Supports both regular payouts and subaccount payouts (test entities only).

**Request Body**

| Field                                | Type    | Required | Description                                                                                                                                                                 | Validation Rules                                                                                                                                             |
| ------------------------------------ | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `payee_id`                           | UUID    | Yes      | ID of the payee to receive funds.                                                                                                                                           | Must be a valid UUID for an existing payee                                                                                                                   |
| `amount_in_minor_units`              | Integer | Yes      | Amount in the smallest unit of the currency. For USD, this is cents (100 = \$1.00).                                                                                         | Must be a positive whole number.                                                                                                                             |
| `currency_code`                      | String  | No       | ISO 4217 currency code. Defaults to the source account's currency.                                                                                                          | If supplied, must match a supported country and currency combination.                                                                                        |
| `rail`                               | String  | No       | - For bank accounts: Options `instant_bank`, `same_day_ach`, `standard_ach`, or `wire` depending on routing number- For cards: Only `instant_card` is supported             | Must be one of the supported rails for the payee's payment method                                                                                            |
| `subaccount_id`                      | UUID    | No       | ID of the subaccount to debit from (test entities only). When provided, the payout will be debited from the specified subaccount instead of the main account.               | Must be a valid UUID for an existing subaccount belonging to the entity. Only available for sandbox/test entities.                                           |
| `override_default_payment_method_id` | UUID    | No       | ID of a specific verified payment method to use instead of the payee's default payment method. If provided, this verified payment method will be used to create the payout. | Must be a valid UUID for an existing verified payment method belonging to the payee. If `rail` is also provided, it must be supported by this payment method |
| `payout_metadata`                    | Object  | No       | Arbitrary metadata as key-value pairs to store with the payout for your own reference.                                                                                      | Must be an object with string keys and string values. Maximum 50 keys, each key max 40 characters, each value max 500 characters, total size max 16KB.       |
| `auto_approve`                       | Boolean | No       | If set to true, payout will automatically transition to approved state.                                                                                                     | default: `false`                                                                                                                                             |

**Examples:**

* For USD, `amount_in_minor_units: 1000` is 1000 cents = \$10.00
* For USD, `amount_in_minor_units: 1250` is 1250 cents = \$12.50

**Response Body**

| Field                   | Type     | Description                                                                                                   |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| `id`                    | UUID     | Unique identifier for the payout.                                                                             |
| `payee_id`              | UUID     | ID of the payee receiving the funds.                                                                          |
| `subaccount_id`         | UUID     | ID of the subaccount this payout is attributed to. Null if attributed to main account.                        |
| `status`                | String   | Current status of the payout (`created`, `canceled`, `approved`, `initiated`, `debited`, `settled`, `failed`) |
| `amount_in_minor_units` | Integer  | The payout amount in the smallest unit of the currency. For USD, cents (100 = \$1.00).                        |
| `amount_in_cents`       | Integer  | Deprecated alias for `amount_in_minor_units`.                                                                 |
| `currency_code`         | String   | ISO 4217 currency code of the source account.                                                                 |
| `country_code`          | String   | ISO 3166-1 alpha-2 country code of the source account.                                                        |
| `rail`                  | String   | Payment rail used                                                                                             |
| `payout_metadata`       | Object   | Contains payment method details and payee information (sensitive data is masked)                              |
| `transfer_details`      | Object   | Details of the transfer (provided after processing begins)                                                    |
| `client_metadata`       | Object   | Arbitrary metadata as key-value pairs that were provided when creating the payout                             |
| `created_at`            | DateTime | Timestamp when the payout was created                                                                         |
| `updated_at`            | DateTime | Timestamp when the payout was last updated                                                                    |

**Note:** Use `amount_in_minor_units` in request bodies. The `amount_in_cents` field is deprecated and retained in responses for backward compatibility.

**Idempotency Key**

You can include an `Idempotency-Key` header to ensure that duplicate requests are handled safely. When you retry a request with the same idempotency key:

* **200 OK**: If a payout with the same idempotency key already exists and no further work is needed for this request, the existing payout is returned.
* **201 Created**: If no payout exists with the provided idempotency key, a new payout is created.
* With **`auto_approve=true`**, an idempotency match that is still **`CREATED`** continues approve→initiate (same as a fresh create+`auto_approve`). A match in **`CANCELED`** or **`FAILED`** returns **409**.

**Success Responses**

| Status Code | Description                                                                                                                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200         | OK — An existing payout with the provided idempotency key was found and returned (idempotency recovery / already-advanced replay)                                                                         |
| 201         | Created — The payout was created; with **`auto_approve`**, processing finished within this response for your request (**`status`** reflects the result).                                                  |
| 202         | Accepted — The payout was created (and approved when **`auto_approve`** is true). **`status`** in the body may still change; poll **`GET /api/payouts/{id}`** until the payout reaches a terminal status. |
| 207         | Multi-Status — Payout was created (or already existed as **`CREATED`**) but **approval** failed. The response includes the payout data and a **`warning`**. The payout remains **`CREATED`**.             |

**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 payee or payment method was not found                                                                                                                                                                         |
| 409         | IDEMPOTENCY\_KEY\_CONFLICT | Idempotency key matches an existing payout in a terminal failed or canceled state; use a new key                                                                                                                  |
| 422         | INVALID\_PAYMENT\_DETAILS  | The payment details are invalid or incomplete                                                                                                                                                                     |
| 503         | (see response body)        | With **`auto_approve`**, the payout was created (and approved) but initiation hit a **transient error**. **Retry** the same create request after a short wait. The JSON body includes `error_code` and `message`. |

**Auto-approve behavior**

When **`auto_approve=true`**, the API creates the payout (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 payout id is always in the response. If you receive **202**, poll **`GET /api/payouts/{id}`** until **`status`** reaches a value you treat as final for your integration.
* **207**: Creation succeeded but **approval** failed; read **`warning`** and **`status`** (still **`CREATED`**). Standalone approve returns **4xx** for the same approval failure.
* **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/payouts-api/create-payout

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

- `payee_id` (string, required)
- `amount_in_minor_units` (integer, optional, nullable) — Amount in the currency's minor units (e.g. cents for USD).
- `currency_code` (enum, optional, nullable)
  - Allowed values: `USD`, `GBP`, `INR`
- `rail` (enum, optional, nullable)
  - Allowed values: `instant_card`, `instant_bank`, `same_day_ach`, `standard_ach`, `wire`, `{'instant_card', 'instant_bank'}`, `{'standard_ach', 'same_day_ach'}`, `{'standard_ach', 'wire'}`
- `override_default_payment_method_id` (string, optional, nullable)
- `auto_approve` (boolean, optional, default: false)
- `metadata` (map from string to string, optional, nullable)
- `subaccount_id` (string, optional, nullable) — Subaccount to debit from (test entities only)
- `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.
- `amount_in_cents` (integer, optional, nullable, deprecated) — Deprecated. Use amount_in_minor_units instead. Still accepted and returned for backward compatibility.

## Response

### 200

Payout retrieved successfully (idempotency retry)

### 201

Payout created successfully

- `data` (object, required)
  - `created_at` (datetime, required)
  - `updated_at` (datetime, required)
  - `id` (string, required)
  - `payee_id` (string, required)
  - `amount_in_minor_units` (integer, required) — Amount in the currency's minor units (e.g. cents for USD).
  - `currency_code` (enum, required)
    - Allowed values: `USD`, `GBP`, `INR`
  - `country_code` (enum, required)
    - Allowed values: `US`, `GB`, `IN`
  - `rail` (enum, required)
    - Allowed values: `instant_card`, `instant_bank`, `same_day_ach`, `standard_ach`, `wire`, `{'instant_card', 'instant_bank'}`, `{'standard_ach', 'same_day_ach'}`, `{'standard_ach', 'wire'}`
  - `payout_metadata` (map from string to any, required)
  - `status` (enum, required) — Current status of the payout. One of: created, approved, initiated, debited, settled, failed, canceled.
    - Allowed values: `created`, `approved`, `initiated`, `debited`, `settled`, `failed`, `canceled`
  - `status_recorded_at` (datetime, required)
  - `amount_in_cents` (integer, required, deprecated) — Deprecated. Use amount_in_minor_units instead. Still accepted and returned for backward compatibility.
  - `client_metadata` (map from string to string, 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

Payout created and approved; response includes current state—poll GET for updates if status may change

### 207

Payout created but auto-approval failed; payout remains CREATED

## Examples

### Standard payout

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Standard payout
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": False
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Standard payout
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":false}'
};

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

```go Standard payout
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\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 Standard payout
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Standard payout
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard payout
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
] as [String : Any]

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

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

### Override payment method

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Override payment method
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
    "auto_approve": False
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Override payment method
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","override_default_payment_method_id":"456e7890-e89b-12d3-a456-426614174001","auto_approve":false}'
};

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

```go Override payment method
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\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 Override payment method
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}"

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

```java Override payment method
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Override payment method
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Override payment method
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
] as [String : Any]

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

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

### Auto-approve payout

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "initiated",
    "status_recorded_at": "2024-03-20T12:01:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021",
        "end_to_end_id": "RTP20240320123456789"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "transfer_details": {
      "rail": "instant_bank",
      "end_to_end_id": "RTP20240320123456789",
      "response": {
        "transaction_id": "JPM12345678",
        "status": "ACCEPTED",
        "timestamp": "2024-03-20T12:01:00Z"
      }
    }
  }
}
```

**SDK Code**

```python Auto-approve payout
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Auto-approve payout - approval failed

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  },
  "warning": "Payout created successfully, but approval failed. The payout remains in CREATED status."
}
```

**SDK Code**

```python Auto-approve payout - approval failed
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout - approval failed
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout - approval failed
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout - approval failed
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout - approval failed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout - approval failed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout - approval failed
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout - approval failed
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Standard payout

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Standard payout
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": False
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Standard payout
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":false}'
};

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

```go Standard payout
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\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 Standard payout
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Standard payout
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard payout
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
] as [String : Any]

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

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

### Override payment method

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Override payment method
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
    "auto_approve": False
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Override payment method
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","override_default_payment_method_id":"456e7890-e89b-12d3-a456-426614174001","auto_approve":false}'
};

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

```go Override payment method
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\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 Override payment method
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}"

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

```java Override payment method
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Override payment method
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Override payment method
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
] as [String : Any]

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

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

### Auto-approve payout

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021",
        "end_to_end_id": "RTP20240320123456789"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "status": "initiated",
    "status_recorded_at": "2024-03-20T12:01:00Z",
    "transfer_details": {
      "rail": "instant_bank",
      "end_to_end_id": "RTP20240320123456789",
      "response": {
        "transaction_id": "JPM12345678",
        "status": "ACCEPTED",
        "timestamp": "2024-03-20T12:01:00Z"
      }
    }
  }
}
```

**SDK Code**

```python Auto-approve payout
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Auto-approve payout - approval failed

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z"
  },
  "warning": "Payout created successfully, but approval failed. The payout remains in CREATED status."
}
```

**SDK Code**

```python Auto-approve payout - approval failed
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout - approval failed
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout - approval failed
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout - approval failed
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout - approval failed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout - approval failed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout - approval failed
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout - approval failed
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Standard payout

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Standard payout
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": False
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Standard payout
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":false}'
};

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

```go Standard payout
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\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 Standard payout
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Standard payout
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard payout
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false
] as [String : Any]

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

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

### Override payment method

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Override payment method
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
    "auto_approve": False
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Override payment method
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","override_default_payment_method_id":"456e7890-e89b-12d3-a456-426614174001","auto_approve":false}'
};

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

```go Override payment method
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\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 Override payment method
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}"

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

```java Override payment method
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Override payment method
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"override_default_payment_method_id\": \"456e7890-e89b-12d3-a456-426614174001\",\n  \"auto_approve\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Override payment method
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "override_default_payment_method_id": "456e7890-e89b-12d3-a456-426614174001",
  "auto_approve": false
] as [String : Any]

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

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

### Auto-approve payout

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "initiated",
    "status_recorded_at": "2024-03-20T12:01:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021",
        "end_to_end_id": "RTP20240320123456789"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "transfer_details": {
      "rail": "instant_bank",
      "end_to_end_id": "RTP20240320123456789",
      "response": {
        "transaction_id": "JPM12345678",
        "status": "ACCEPTED",
        "timestamp": "2024-03-20T12:01:00Z"
      }
    }
  }
}
```

**SDK Code**

```python Auto-approve payout
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Auto-approve payout - approval failed

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  },
  "warning": "Payout created successfully, but approval failed. The payout remains in CREATED status."
}
```

**SDK Code**

```python Auto-approve payout - approval failed
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout - approval failed
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout - approval failed
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout - approval failed
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout - approval failed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout - approval failed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout - approval failed
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout - approval failed
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Auto-approve payout - approval failed

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  },
  "warning": "Payout created successfully, but approval failed. The payout remains in CREATED status."
}
```

**SDK Code**

```python Auto-approve payout - approval failed
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auto-approve payout - approval failed
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":10000,"currency_code":"USD","rail":"instant_bank","auto_approve":true}'
};

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

```go Auto-approve payout - approval failed
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\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 Auto-approve payout - approval failed
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}"

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

```java Auto-approve payout - approval failed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}")
  .asString();
```

```php Auto-approve payout - approval failed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Auto-approve payout - approval failed
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 10000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auto-approve payout - approval failed
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 10000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": true
] as [String : Any]

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

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

### Payout from subaccount

**Request**

```json
{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 5000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false,
  "subaccount_id": "456e7890-e89b-12d3-a456-426614174000"
}
```

**Response**

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_cents": 10000,
    "amount_in_minor_units": 10000,
    "currency_code": "USD",
    "country_code": "US",
    "rail": "instant_bank",
    "status": "created",
    "status_recorded_at": "2024-03-20T12:00:00Z",
    "payout_metadata": {
      "payment_method": {
        "account_last_four": "7890",
        "routing_number": "021000021"
      },
      "payee": {
        "name": "Jane Doe",
        "email": "jane.doe@example.com"
      }
    },
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z"
  }
}
```

**SDK Code**

```python Payout from subaccount
import requests

url = "https://api.useroot.com/api/payouts"

payload = {
    "payee_id": "123e4567-e89b-12d3-a456-426614174001",
    "amount_in_minor_units": 5000,
    "currency_code": "USD",
    "rail": "instant_bank",
    "auto_approve": False,
    "subaccount_id": "456e7890-e89b-12d3-a456-426614174000"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Payout from subaccount
const url = 'https://api.useroot.com/api/payouts';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"payee_id":"123e4567-e89b-12d3-a456-426614174001","amount_in_minor_units":5000,"currency_code":"USD","rail":"instant_bank","auto_approve":false,"subaccount_id":"456e7890-e89b-12d3-a456-426614174000"}'
};

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

```go Payout from subaccount
package main

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

func main() {

	url := "https://api.useroot.com/api/payouts"

	payload := strings.NewReader("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 5000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false,\n  \"subaccount_id\": \"456e7890-e89b-12d3-a456-426614174000\"\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 Payout from subaccount
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payouts")

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  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 5000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false,\n  \"subaccount_id\": \"456e7890-e89b-12d3-a456-426614174000\"\n}"

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

```java Payout from subaccount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payouts")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 5000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false,\n  \"subaccount_id\": \"456e7890-e89b-12d3-a456-426614174000\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payouts', [
  'body' => '{
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 5000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false,
  "subaccount_id": "456e7890-e89b-12d3-a456-426614174000"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Payout from subaccount
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payouts");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payee_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n  \"amount_in_minor_units\": 5000,\n  \"currency_code\": \"USD\",\n  \"rail\": \"instant_bank\",\n  \"auto_approve\": false,\n  \"subaccount_id\": \"456e7890-e89b-12d3-a456-426614174000\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Payout from subaccount
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "payee_id": "123e4567-e89b-12d3-a456-426614174001",
  "amount_in_minor_units": 5000,
  "currency_code": "USD",
  "rail": "instant_bank",
  "auto_approve": false,
  "subaccount_id": "456e7890-e89b-12d3-a456-426614174000"
] as [String : Any]

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

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