# Withdraw Onchain

### Create the Withdrawal

```graphql
mutation {
  withdrawOnchain(
    address: "0xc8802fEaB2FaFb48B7d1aDe77e197002c210f391"
    amountUsd: 200
    network: "OP"
  ) {
    id # Track this ID or wait for the webhook (see below)
  }
}
```

#### Arguments

<table><thead><tr><th width="124.77777099609375">Name</th><th width="118.111083984375">Type</th><th width="95.3333740234375">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code></td><td><code>String!</code></td><td><strong>Yes</strong></td><td>Destination wallet address.</td></tr><tr><td><code>amountUsd</code></td><td><code>Decimal!</code></td><td><strong>Yes</strong></td><td>USD amount to send (min <strong>$10</strong>).</td></tr><tr><td><code>network</code></td><td><code>String!</code></td><td><strong>Yes</strong></td><td>Chain code from the table below.</td></tr></tbody></table>

#### Supported Networks

| Chain    | Code   | Typical finality | Cashramp fee |
| -------- | ------ | ---------------- | ------------ |
| Optimism | `OP`   | < 1 min          | **$1.00**    |
| Celo     | `CELO` | \~ 5 s           | **$0.01**    |

The mutation fails if:

* `address` is invalid on the chosen network.
* `amountUsd` is below the **$10** minimum.
* Your Cashramp balance is insufficient.

***

### Receive Status Updates

You’ll get a `onchain_tx.updated` webhook as the transaction progresses.

```json
{
  "event_type": "onchain_tx.updated",
  "data": {
    "id": "VHlwZXM6Ok9uY2hhaW5UeC1hYzNmODk2Mi1jNzRkLTRmNWMtYTQ5ZC1kYmIzMWM1MDc5Mzc=",
    "address": "0xc8802fEaB2FaFb48B7d1aDe77e197002c210f391",
    "status": "completed", // pending | completed | failed | canceled
    "quantity": 200,
    "fee": 1,
    "symbol": "USDC",
    "network": "OP",
    "txhash": "0x8e473aa19bcb2ce3107fc16b88effda50a21d6853a7db67e357abf312c26eaf7"
  }
}
```

Use the webhook (or poll `onchainWithdrawal(id)`) to confirm finality before updating your ledger.
