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

# 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://docs.useroot.com/api-reference/treasury-api/treasury-simulate-inbound-credit

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/treasury/accounts/{account_id}/simulate-inbound-credit:
    post:
      operationId: treasury-simulate-inbound-credit
      summary: Simulate inbound credit
      description: >-
        **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 |
      tags:
        - treasuryApi
      parameters:
        - name: account_id
          in: path
          description: Main SIM treasury account ID.
          required: true
          schema:
            type: string
            format: uuid
        - 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
      responses:
        '201':
          description: Inbound credit simulation recorded for treasury.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_SimulateInboundCreditResponse_'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Treasury account not found
          content:
            application/json:
              schema:
                description: Any type
        '409':
          description: Duplicate sandbox reference
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateInboundCreditRequest'
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    Rails:
      type: string
      enum:
        - instant_card
        - instant_bank
        - same_day_ach
        - standard_ach
        - wire
        - '{''instant_card'', ''instant_bank''}'
        - '{''same_day_ach'', ''standard_ach''}'
        - '{''standard_ach'', ''wire''}'
      title: Rails
    SimulateInboundCreditRequest:
      type: object
      properties:
        rail:
          $ref: '#/components/schemas/Rails'
          description: >-
            Payment rail for the simulated deposit. `standard_ach` requires a
            US/USD SIM treasury account; `wire` credits the account's currency.
        amount_in_minor_units:
          type: integer
          description: >-
            Amount in the smallest unit of the treasury account's currency. For
            USD, this is cents (100 = $1.00).
        transaction_date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Optional as-of calendar date for the simulated bank line
            (`YYYY-MM-DD`). Omit to use the current UTC date.
        sender_info:
          type:
            - string
            - 'null'
          description: >-
            Optional label for the external sending party (shown on treasury
            inbound activity).
        subaccount_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            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.
      required:
        - rail
        - amount_in_minor_units
      description: Request body for POST /accounts/{account_id}/simulate-inbound-credit.
      title: SimulateInboundCreditRequest
    SimulateInboundCreditResponse:
      type: object
      properties:
        bank_transaction_id:
          type: string
          format: uuid
          description: >-
            Identifier for the treasury bank-transaction row created by this
            simulation (same id as GET bank-transactions will use).
        amount_in_minor_units:
          type: integer
          description: Amount credited, in the smallest unit of currency_code.
        currency_code:
          type: string
          description: ISO currency code of the credited account.
        direction:
          type: string
          enum:
            - credit
          default: credit
          description: Ledger direction on the treasury account (always credit).
        transaction_date:
          type: string
          format: date
          description: As-of date for the simulated bank line.
      required:
        - bank_transaction_id
        - amount_in_minor_units
        - currency_code
        - transaction_date
      title: SimulateInboundCreditResponse
    Response_SimulateInboundCreditResponse_:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/SimulateInboundCreditResponse'
        warning:
          type:
            - string
            - 'null'
      required:
        - data
      title: Response_SimulateInboundCreditResponse_
  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



**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": "null"
}
```

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