This method is for testing only and will not work in production.
Method Signature
align.virtualAccounts.simulate(
customerId: string,
data: SimulateVirtualAccountRequest
): Promise<VirtualAccount>
Parameters
The unique customer identifier
The ID of the virtual account to simulate issuance for
Action to perform: issue_pending_virtual_account
Returns
Returns the updated VirtualAccount object with status: "active" and populated deposit_instructions.
Example
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
try {
await align.virtualAccounts.simulate(customerId, {
virtual_account_id: "va_123",
action: "issue_pending_virtual_account",
});
} catch (error) {
console.error("Simulation failed:", error);
}