Skip to main content
POST
Withdraw from Credit Wallet

Overview

This endpoint initiates a withdrawal from the authenticated user’s credit wallet to their registered external wallet address. The withdrawal is processed on-chain on the Linea network, and the net amount received equals the requested amount minus network gas fees. Prerequisites:
  • User must have a registered external wallet (completed delegation flow)
  • Credit wallet must have sufficient balance to cover withdrawal amount + fees
  • User must be verified and in good standing
Process Flow:
  1. Check available balance with GET /v1/wallet/credit
  2. Estimate fees with GET /v1/wallet/credit/withdraw-estimation
  3. Initiate withdrawal with this endpoint
  4. Monitor transaction on blockchain using returned txHash
  5. Verify completion with GET /v1/wallet/history

Authentication

string
required
Your public API client key that identifies your environment
string
required
Bearer token obtained from OAuth flow or direct login

Query Parameters

boolean
default:false
Set to true to route request to US backend environment (if available for your client)

Request Body

string
required
Amount to withdraw in USDC (decimal string). Must not exceed available balance.

Response

string
Blockchain transaction hash of the withdrawal. Use this to track transaction status on the Linea network.

Code Examples

Complete Withdrawal Flow

1

Check Balance

Verify sufficient funds are available
2

Estimate Fees

Get current network fee estimate
3

Calculate Net Amount

Show user what they’ll receive
4

Initiate Withdrawal

Execute the withdrawal
5

Monitor Transaction

Track blockchain confirmation

Important Notes

Insufficient Balance: The withdrawal amount plus estimated fees must not exceed available balance. Always validate balance before calling this endpoint.
Network Fees: Fees are deducted from the withdrawal amount. If withdrawing 10 USDC with 0.02 USDC fee, user receives 9.98 USDC.
Transaction Monitoring: Use the returned txHash to track transaction status on Linea block explorer. Typical confirmation time is 1-3 minutes.

Error Handling

Common Errors

Insufficient Balance
Solution: Check balance with GET /v1/wallet/credit and ensure amount + fees < balance. No External Wallet
Solution: User must complete delegation flow to register an external wallet first. Invalid Amount
Solution: Validate amount format and ensure it’s a positive decimal string. Withdrawal Not Allowed
Solution: Check isWithdrawable flag on GET /v1/wallet/credit before attempting withdrawal.

Edge Cases

Minimum Withdrawal Amounts

Gas fees make very small withdrawals uneconomical:

Concurrent Withdrawals

Only one withdrawal can be processed at a time per wallet:

Network Congestion

During high traffic, transactions may take longer:
  • Implement retry logic with exponential backoff
  • Display estimated confirmation time to users
  • Consider queuing withdrawals for later processing