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

# Simulate On-Ramp Transaction

> POST /v1/ramp/org/simulate-transaction — Simulate an on-ramp transaction lifecycle (sandbox only)

<Note>
  **Endpoint:** `POST https://api.rebelfi.io/v1/ramp/org/simulate-transaction`
</Note>

<Warning>
  This endpoint is only available in the **sandbox** environment. It will return an error in production.
</Warning>

Simulate an on-ramp transaction lifecycle to test your integration. The simulation progresses the transaction through the specified scenario's status sequence.

### Request Body

| Field               | Type     | Required | Description                                                                                       |
| ------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------- |
| `scenario`          | `string` | No       | Simulation scenario (default: `"success"` — options: `success`, `failed`, `rejected`, `reversed`) |
| `usd_amount`        | `number` | No       | Simulated USD amount (default: `50000`)                                                           |
| `onramp_account_id` | `number` | No       | On-ramp account ID to simulate against                                                            |

### Scenarios

| Scenario   | Status Progression                                                                       |
| ---------- | ---------------------------------------------------------------------------------------- |
| `success`  | `pending` -> `processing` -> `in_progress` -> `broadcasted` -> `completed`               |
| `failed`   | `pending` -> `processing` -> `failed`                                                    |
| `rejected` | `pending` -> `rejected`                                                                  |
| `reversed` | `pending` -> `processing` -> `in_progress` -> `broadcasted` -> `completed` -> `reversed` |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.rebelfi.io/v1/ramp/org/simulate-transaction" \
    -H "x-api-key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "scenario": "success",
      "usd_amount": 10000,
      "onramp_account_id": 1
    }'
  ```

  ```typescript SDK theme={null}
  const simulation = await client.ramp.simulateOnrampTransaction({
    scenario: 'success',
    usdAmount: 10000
  });
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "simulation_id": "sim_a1b2c3d4e5f6",
    "state": "accepted"
  }
}
```

### Response Fields

| Field                | Type      | Description                          |
| -------------------- | --------- | ------------------------------------ |
| `success`            | `boolean` | Whether the simulation was accepted  |
| `data.simulation_id` | `string`  | Unique identifier for the simulation |
| `data.state`         | `string`  | Simulation state (`accepted`)        |
