> For the complete documentation index, see [llms.txt](https://docs.cashramp.co/cashramp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cashramp.co/cashramp/cashramp-api/withdraw-onchain.md).

# Withdraw Onchain

Withdraw your Cashramp balance to an external wallet as a supported stablecoin.

### Create the Withdrawal

```graphql
mutation {
  withdrawOnchain(
    address: "0xc8802fEaB2FaFb48B7d1aDe77e197002c210f391"
    amountUsd: 200
    network: "BASE"
    symbol: "USDC"
    metadata: { payoutId: "payout_123" }
  ) {
    id # Track this ID or wait for the webhook (see below)
    quantity
    symbol
    network
    fee
    status
  }
}
```

#### Arguments

| Name             | Type                  | Required | Description                                                                                                   |
| ---------------- | --------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| `address`        | `String!`             | **Yes**  | Destination wallet address. It must be valid for the selected network.                                        |
| `amountUsd`      | `Decimal!`            | **Yes**  | USD amount to withdraw. The minimum, maximum, and network fee depend on the selected stablecoin-network pair. |
| `network`        | `String`              | No       | Destination network code. Defaults to `OP`.                                                                   |
| `symbol`         | `String`              | No       | Stablecoin to send. Defaults to `USDT`.                                                                       |
| `metadata`       | `JSON`                | No       | Your own key-value data for reconciliation. Cashramp includes it in `onchain_tx.updated` webhooks.            |
| `travelRuleInfo` | `TravelRuleInfoInput` | No       | Destination ownership information. It contains `selfOwned`, `beneficiaryName`, and `vaspName`.                |

#### Supported Networks

Fetch the stablecoins you can withdraw, each network's token contract, limits and fee with `withdrawableAssets` (public or secret key). Read fees from it rather than hard-coding them.

Pass `caller: ramp` to get the fees charged when Cashramp delivers an onramp onchain (`onchainTransferInfo`) instead. `caller` defaults to `default`, the `withdrawOnchain` fees.

```graphql
query {
  withdrawableAssets(caller: default) { # or ramp
    symbol # "USDT" | "USDC" | "CUSD"
    name
    networks {
      network # pass as `network` to withdrawOnchain
      name
      contractAddress
      fee # USD, charged on top of amountUsd
      minWithdrawal
      maxWithdrawal
      precision
      addressRegex
    }
  }
}
```

```json
{
  "data": {
    "withdrawableAssets": [
      {
        "symbol": "USDT",
        "name": "Tether USD",
        "networks": [
          {
            "network": "CELO",
            "name": "Celo",
            "contractAddress": "0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e",
            "fee": "0.5",
            "minWithdrawal": "0.1",
            "maxWithdrawal": "1000000",
            "precision": 6,
            "addressRegex": "^(0x)[0-9A-Fa-f]{40}$"
          }
        ]
      }
    ]
  }
}
```

See [Supported Assets](https://docs.cashramp.co/cashramp/introduction/supported-assets.md) for every network, fee and token contract.

`symbol` and `network` are validated together. Specify both when you do not want the default `USDT` on `OP` route. Fees and withdrawal limits vary by pair; the transaction response includes the applied fee.

The mutation fails if:

* The stablecoin or stablecoin-network pair is unsupported.
* `address` is invalid on the selected network.
* `amountUsd` is outside the selected pair's withdrawal limits.
* Your Cashramp balance cannot cover `amountUsd` plus the returned `fee`.

***

### 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",
    "quantity": 200,
    "fee": 0.1,
    "symbol": "USDC",
    "network": "BASE",
    "txhash": "0x8e473aa19bcb2ce3107fc16b88effda50a21d6853a7db67e357abf312c26eaf7",
    "metadata": {
      "payoutId": "payout_123"
    }
  }
}
```

The withdrawal status is `pending`, `processing`, `completed`, `failed`, or `canceled`. Use the webhook (or poll `onchainWithdrawal(id)`) to confirm finality before updating your ledger.
