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

# Simulate Account Issuance

> Simulate the issuance of a pending virtual account in sandbox

<Warning>
  This method is for **testing only** and will not work in production.
</Warning>

## Method Signature

```typescript theme={null}
align.virtualAccounts.simulate(
  customerId: string,
  data: SimulateVirtualAccountRequest
): Promise<VirtualAccount>
```

## Parameters

<ParamField path="customerId" type="string" required>
  The unique customer identifier
</ParamField>

<ParamField body="virtual_account_id" type="string" required>
  The ID of the virtual account to simulate issuance for
</ParamField>

<ParamField body="action" type="string" required>
  Action to perform: `issue_pending_virtual_account`
</ParamField>

## Returns

Returns the updated `VirtualAccount` object with `status: "active"` and populated `deposit_instructions`.

## Example

```typescript theme={null}
const activeAccount = await align.virtualAccounts.simulate(customerId, {
  virtual_account_id: "va_123e4567...",
  action: "issue_pending_virtual_account",
});

console.log(`Status: ${activeAccount.status}`); // "active"

if ("us" in activeAccount.deposit_instructions) {
  console.log(
    `Account Number: ${activeAccount.deposit_instructions.us.account_number}`
  );
}
```

## Error Handling

```typescript theme={null}
try {
  await align.virtualAccounts.simulate(customerId, {
    virtual_account_id: "va_123",
    action: "issue_pending_virtual_account",
  });
} catch (error) {
  console.error("Simulation failed:", error);
}
```
