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

# Simulate inbound credit

POST https://api.useroot.com/api/treasury/accounts/{account_id}/simulate-inbound-credit
Content-Type: application/json

**Sandbox only.** Creates a simulated **inbound credit** on the treasury account identified in the path — an external deposit that appears as a bank-reported line without running a payin or ingesting a BAI2 file.

Funds credit the **treasury account** (`account_id` in the path), or **`subaccount_id`** when you pass the UUID of one of its subaccounts.

**Path**

| Parameter    | Type | Description                                                           |
| ------------ | ---- | --------------------------------------------------------------------- |
| `account_id` | UUID | Main SIM treasury account to credit. Must belong to your test entity. |

**Request Body**

| Field                   | Type    | Required | Description                                                                                            | Validation Rules                                                                                                                     |
| ----------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `rail`                  | String  | Yes      | Payment rail for the deposit: `standard_ach` or `wire`.                                                | `standard_ach` requires a US/USD SIM treasury account. `wire` credits the account's currency (USD, GBP, INR, and other SIM markets). |
| `amount_in_minor_units` | Integer | Yes      | Amount in the smallest unit of the treasury account's currency. For USD, this is cents (100 = \$1.00). | Must be a positive whole number.                                                                                                     |
| `transaction_date`      | Date    | No       | Optional as-of calendar date for the simulated line.                                                   | ISO `YYYY-MM-DD`. Defaults to the current UTC date when omitted.                                                                     |
| `sender_info`           | String  | No       | Optional label for the external sending party (shown on treasury inbound activity).                    | Max 200 characters.                                                                                                                  |
| `subaccount_id`         | UUID    | No       | Credit a subaccount under the path treasury account instead of the main account.                       | Must belong to the treasury account in the path.                                                                                     |

**Response**

Returns a treasury-aligned subset of the created bank line:

| Field                   | Type    | Description                                                             |
| ----------------------- | ------- | ----------------------------------------------------------------------- |
| `bank_transaction_id`   | UUID    | Id of the simulated row (same id `GET .../bank-transactions` will use). |
| `amount_in_minor_units` | Integer | Amount credited.                                                        |
| `currency_code`         | String  | ISO currency of the credited account.                                   |
| `direction`             | String  | Always `credit` for this endpoint.                                      |
| `transaction_date`      | Date    | As-of date for the simulated line.                                      |

**Examples**

* US/USD with ACH: `POST /accounts/{usd_account_id}/simulate-inbound-credit` with `{ "rail": "standard_ach", "amount_in_minor_units": 4000 }` → \$40.00 inbound ACH credit.
* Backdated wire: `{ "rail": "wire", "amount_in_minor_units": 50000, "transaction_date": "2026-01-15" }` → credits with as-of date 2026-01-15.
* US/USD with wire: `{ "rail": "wire", "amount_in_minor_units": 100000 }` → \$1,000.00 inbound wire credit.
* GB/GBP with wire: `{ "rail": "wire", "amount_in_minor_units": 80000 }` → £800.00 inbound wire credit on the GBP SIM account.

**Error Responses**

| Status | When                                                                           |
| ------ | ------------------------------------------------------------------------------ |
| 400    | Live entity, non-SIM account, invalid subaccount, or ACH on non-US/USD account |
| 401    | Missing or invalid auth                                                        |
| 404    | Treasury account not found for your entity                                     |
| 409    | Duplicate sandbox reference                                                    |

Reference: https://useroot.docs.buildwithfern.com/api-reference/treasury-api/treasury-simulate-inbound-credit

## Authentication

- `x-api-key` header (required) — RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.

## Request

### Path parameters

- `account_id` (string, required) — Main SIM treasury account ID.

### Body (application/json)

- `rail` (enum, required) — Payment rail for the simulated deposit. `standard_ach` requires a US/USD SIM treasury account; `wire` credits the account's currency.
  - Allowed values: `instant_card`, `instant_bank`, `same_day_ach`, `standard_ach`, `wire`, `{'instant_card', 'instant_bank'}`, `{'standard_ach', 'same_day_ach'}`, `{'standard_ach', 'wire'}`
- `amount_in_minor_units` (integer, required) — Amount in the smallest unit of the treasury account's currency. For USD, this is cents (100 = $1.00).
- `transaction_date` (date, optional, nullable) — Optional as-of calendar date for the simulated bank line (`YYYY-MM-DD`). Omit to use the current UTC date.
- `sender_info` (string, optional, nullable) — Optional label for the external sending party (shown on treasury inbound activity).
- `subaccount_id` (string, optional, nullable) — Attribute the inbound amount to this subaccount (UUID of a subaccount under the treasury account in the path). Omit to credit the main account itself.

## Response

### 201

Inbound credit simulation recorded for treasury.

- `data` (object, required)
  - `bank_transaction_id` (string, required) — Identifier for the treasury bank-transaction row created by this simulation (same id as GET bank-transactions will use).
  - `amount_in_minor_units` (integer, required) — Amount credited, in the smallest unit of currency_code.
  - `currency_code` (string, required) — ISO currency code of the credited account.
  - `transaction_date` (date, required) — As-of date for the simulated bank line.
  - `direction` ("credit", optional, default: credit) — Ledger direction on the treasury account (always credit).
- `warning` (string, optional, nullable)

## Examples

**Request**

```json
{
  "rail": "standard_ach",
  "amount_in_minor_units": 4000
}
```

**Response**

```json
{
  "data": {
    "bank_transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "amount_in_minor_units": 4000,
    "currency_code": "USD",
    "transaction_date": "2024-06-01",
    "direction": "credit"
  },
  "warning": "Simulation successful"
}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit"

payload = {
    "rail": "standard_ach",
    "amount_in_minor_units": 4000
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"rail":"standard_ach","amount_in_minor_units":4000}'
};

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

```go
package main

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

func main() {

	url := "https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit"

	payload := strings.NewReader("{\n  \"rail\": \"standard_ach\",\n  \"amount_in_minor_units\": 4000\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit")

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  \"rail\": \"standard_ach\",\n  \"amount_in_minor_units\": 4000\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"rail\": \"standard_ach\",\n  \"amount_in_minor_units\": 4000\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit', [
  'body' => '{
  "rail": "standard_ach",
  "amount_in_minor_units": 4000
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/treasury/accounts/account_id/simulate-inbound-credit");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"rail\": \"standard_ach\",\n  \"amount_in_minor_units\": 4000\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "rail": "standard_ach",
  "amount_in_minor_units": 4000
] as [String : Any]

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

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