Cashramp
  • Introduction
    • Getting Started
    • Payment Rails
    • API Endpoints
    • Authentication
    • Webhooks
    • Integration Guide
    • SDKs
  • Hosted Ramp
    • Overview
    • Deposits
    • Withdrawals
    • Cancel Payment
  • Direct Ramp
    • Overview
    • Ramp Quotes
    • Deposits
    • Withdrawals
  • Onchain Ramp
    • Overview
    • On-Off Ramp
  • Cashramp API
    • Queries
    • Customers
    • Payment Methods
    • Withdraw Onchain
    • Virtual Bank Accounts
Powered by GitBook
On this page
  • Create the Withdrawal
  • Receive Status Updates
  1. Cashramp API

Withdraw Onchain

Create the Withdrawal

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

Arguments

Name
Type
Required
Description

address

String!

Yes

Destination wallet address.

amountUsd

Decimal!

Yes

USD amount to send (min $10).

network

String!

Yes

Chain code from the table below.

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.

{
  "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.

PreviousPayment MethodsNextVirtual Bank Accounts

Last updated 18 days ago