> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ramps.noah.simulatePayin

> Simulate a sandbox-only Noah fiat deposit for testing payin flows.

## Function Signature

```dart theme={null}
Future<NoahSimulatePayinResponse> simulatePayin(NoahSimulatePayinRequest request)
```

## Description

Simulates a fiat deposit against a Noah payment method so you can exercise the payin flow end to end without moving real money. Use the `bankDetails.paymentMethodId` returned by [`initiatePayin`](./noah-initiatepayin).

<Warning>
  This endpoint is **sandbox-only**. Calling it against a production environment fails with a `400` client error — `Simulate fiat deposit is only available in sandbox environments`. Guard the call behind your own environment check rather than shipping it in a production code path.
</Warning>

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `request.paymentMethodId` | `String` | Yes | Payment method identifier from `initiatePayin`'s `bankDetails`. |
| `request.fiatAmount` | `String` | Yes | Fiat amount as a decimal string. |
| `request.fiatCurrency` | `String` | Yes | Fiat currency code. |

## Returns

**`NoahSimulatePayinResponse`** - An envelope containing:

| Property | Type | Description |
| - | - | - |
| `data` | `NoahSimulatePayinData` | The response payload. |
| `metadataJson` | `String?` | JSON-encoded response metadata. Read it decoded through the `metadata` getter. |

`NoahSimulatePayinData`:

| Property | Type | Description |
| - | - | - |
| `fiatDepositId` | `String` | Identifier of the simulated fiat deposit. |
| `reference` | `String?` | Reference for the simulated deposit, when returned by Noah. |

## Example

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

if (isSandbox) {
  try {
    final address = (await portal.getAddress(NoahNetwork.ethereumSepolia))!; // Requires an existing wallet

    final payin = await portal.ramps.noah.initiatePayin(
      NoahInitiatePayinRequest(
        fiatCurrency: 'USD',
        cryptoCurrency: 'USDC_TEST',
        network: NoahNetwork.ethereumSepolia,
        destinationAddress: address,
      ),
    );

    final response = await portal.ramps.noah.simulatePayin(
      NoahSimulatePayinRequest(
        paymentMethodId: payin.data.bankDetails.paymentMethodId,
        fiatAmount: '10',
        fiatCurrency: 'USD',
      ),
    );

    print('Simulated deposit: ${response.data.fiatDepositId}');
  } on PortalException catch (e) {
    print('simulatePayin failed: [${e.code}] ${e.message}');
  }
}
```

## Errors

| Code | Description |
| - | - |
| `NOT_INITIALIZED` | Portal was not initialized |
| `NOAH_SIMULATE_PAYIN_ERROR` | Failed to simulate the payin — for example the call was made against a production environment, or `paymentMethodId`, `fiatAmount`, or `fiatCurrency` is invalid |

## Related

* [Noah virtual accounts and payouts guide](../guide/noah)
* [ramps.noah.initiatePayin](./noah-initiatepayin)
* [Noah payins workflow](/integrations/On-Off-Ramp/noah-payins)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.