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

# Create 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<br>- 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, the existing payout is returned. This allows you to recover the payout ID after transient errors (e.g., 500 Internal Server Error).
- **201 Created**: If no payout exists with the provided idempotency key, a new payout is created.

**Success Responses**

| Status Code | Description |
|-------------|-------------|
| 200 | OK - An existing payout with the provided idempotency key was found and returned (idempotency retry scenario) |
| 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 created but auto-approval encountered an error. The response includes the created payout data and a **`warning`** describing what failed (approval or initiation). |

**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 |
| 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 and continues approval and initiation as far as this request allows. You may receive **201**, **202**, **207**, or **503** depending on outcome:

- **201** / **202**: The 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 a later step failed; read **`warning`** and **`status`**.
- **503**: Transient error while completing **`auto_approve`**—**retry** the create; use the response **`message`** (and **`error_code`**) for support and automation.

Reference: https://docs.useroot.com/api-reference/payouts-api/create-payout

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/payouts:
    post:
      operationId: create-payout
      summary: Create a new payout
      description: >-
        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<br>- 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,
        the existing payout is returned. This allows you to recover the payout
        ID after transient errors (e.g., 500 Internal Server Error).

        - **201 Created**: If no payout exists with the provided idempotency
        key, a new payout is created.


        **Success Responses**


        | Status Code | Description |

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

        | 200 | OK - An existing payout with the provided idempotency key was
        found and returned (idempotency retry scenario) |

        | 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 created but auto-approval encountered an
        error. The response includes the created payout data and a **`warning`**
        describing what failed (approval or initiation). |


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

        | 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 and continues
        approval and initiation as far as this request allows. You may receive
        **201**, **202**, **207**, or **503** depending on outcome:


        - **201** / **202**: The 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 a later step failed; read
        **`warning`** and **`status`**.

        - **503**: Transient error while completing **`auto_approve`**—**retry**
        the create; use the response **`message`** (and **`error_code`**) for
        support and automation.
      tags:
        - payoutsApi
      parameters:
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: Unique key to prevent duplicate requests
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Payout retrieved successfully (idempotency retry)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payouts API_createPayout_Response_200'
        '503':
          description: >-
            Payout created and approved, but bank initiation could not be
            started—retry later
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutRequest'
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    CurrencyCode:
      type: string
      enum:
        - USD
        - GBP
        - INR
      title: CurrencyCode
    Rails:
      type: string
      enum:
        - instant_card
        - instant_bank
        - same_day_ach
        - standard_ach
        - wire
        - '{''instant_card'', ''instant_bank''}'
        - '{''same_day_ach'', ''standard_ach''}'
        - '{''standard_ach'', ''wire''}'
      title: Rails
    PayoutRequest:
      type: object
      properties:
        payee_id:
          type: string
          format: uuid
        amount_in_cents:
          type:
            - integer
            - 'null'
          description: >-
            Deprecated. Use amount_in_minor_units instead. Still accepted and
            returned for backward compatibility.
        amount_in_minor_units:
          type:
            - integer
            - 'null'
          description: Amount in the currency's minor units (e.g. cents for USD).
        currency_code:
          oneOf:
            - $ref: '#/components/schemas/CurrencyCode'
            - type: 'null'
        rail:
          oneOf:
            - $ref: '#/components/schemas/Rails'
            - type: 'null'
        override_default_payment_method_id:
          type:
            - string
            - 'null'
          format: uuid
        auto_approve:
          type: boolean
          default: false
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        subaccount_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Subaccount to debit from (test entities only)
      required:
        - payee_id
      title: PayoutRequest
    Payouts API_createPayout_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Payouts API_createPayout_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## Examples

### 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 - initiation 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": "approved",
    "status_recorded_at": "2024-03-20T12:01: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 and approved successfully, but initiation encountered an error. The payout may require review."
}
```

**SDK Code**

```python Auto-approve payout - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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()
```

### Auto-approve payout - initiation 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": "approved",
    "status_recorded_at": "2024-03-20T12:01:00Z"
  },
  "warning": "Payout created and approved successfully, but initiation encountered an error. The payout may require review."
}
```

**SDK Code**

```python Auto-approve payout - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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": "approved",
    "status_recorded_at": "2024-03-20T12:01: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 and approved successfully, but initiation encountered an error. The payout may require review."
}
```

**SDK Code**

```python Auto-approve payout - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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()
```

### Auto-approve payout - initiation 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": "approved",
    "status_recorded_at": "2024-03-20T12:01: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 and approved successfully, but initiation encountered an error. The payout may require review."
}
```

**SDK Code**

```python Auto-approve payout - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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 - initiation 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()
```