> ## 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 Transfer

> Simulate transfer completion in sandbox environment

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

## Method Signatures

### Simulate Offramp Transfer

```typescript theme={null}
align.transfers.simulateOfframpTransfer(
  customerId: string,
  data: SimulateOfframpTransferRequest
): Promise<SimulateTransferResponse>
```

### Simulate Onramp Transfer

```typescript theme={null}
align.transfers.simulateOnrampTransfer(
  customerId: string,
  data: SimulateOnrampTransferRequest
): Promise<SimulateTransferResponse>
```

## Parameters

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

<ParamField body="transfer_id" type="string" required>
  The transfer ID to simulate
</ParamField>

<ParamField body="action" type="string" required>
  Simulation action: `complete_transfer`
</ParamField>

## Examples

### Simulate Offramp Completion

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import Align from "@tolbel/align";

    const align = new Align({
      apiKey: process.env.ALIGN_API_KEY!,
      environment: "sandbox",
    });

    // Complete an offramp transfer
    await align.transfers.simulateOfframpTransfer(customerId, {
      transfer_id: "tr_123e4567-e89b-12d3-a456-426614174000",
      action: "complete_transfer",
    });

    console.log("Transfer completion simulated");
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    await align.transfers.simulateOfframpTransfer(customerId, {
      transfer_id: "tr_123e4567-e89b-12d3-a456-426614174000",
      action: "complete_transfer",
    });

    console.log("Transfer completed!");
    ```
  </Tab>
</Tabs>

### Simulate Onramp Completion

```typescript theme={null}
await align.transfers.simulateOnrampTransfer(customerId, {
  transfer_id: "tr_456...",
  action: "complete_transfer",
});
```

## Complete Test Workflow

```typescript theme={null}
async function testOfframpFlow(customerId: string) {
  // 1. Create quote
  const quote = await align.transfers.createOfframpQuote(customerId, {
    source_amount: "100.00",
    source_token: "usdc",
    source_network: "polygon",
    destination_currency: "usd",
    destination_payment_rails: "ach",
  });

  // 2. Create transfer
  const transfer = await align.transfers.createOfframpTransfer(
    customerId,
    quote.quote_id,
    {
      destination_external_account_id: "ext_123",
      transfer_purpose: "personal_expenses",
    }
  );

  // 3. Simulate completion
  await align.transfers.simulateOfframpTransfer(customerId, {
    transfer_id: transfer.id,
    action: "complete_transfer",
  });

  // 4. Verify
  const completed = await align.transfers.getOfframpTransfer(
    customerId,
    transfer.id
  );
  console.log(`Transfer ${completed.status}`);
}
```

## Related Methods

<CardGroup cols={2}>
  <Card title="Simulate Virtual Account" icon="building-columns" href="/docs/api/virtual-accounts/simulate">
    Simulate deposits
  </Card>

  <Card title="Simulate Customer" icon="user" href="/docs/api/customers/simulate-customer">
    Simulate KYC approval
  </Card>
</CardGroup>
