Skip to main content
GET
Estimate Credit Withdrawal Fees

Overview

This endpoint calculates the estimated gas fees for withdrawing funds from a credit wallet to an external wallet address. Network fees vary based on blockchain congestion and are deducted from the withdrawal amount. Always call this endpoint before initiating a withdrawal to inform users of the net amount they will receive. Use Cases:
  • Display estimated fees to users before withdrawal confirmation
  • Calculate net amount user will receive after fees
  • Compare fee estimates across different times to optimize for lower costs
  • Provide transparency in withdrawal costs
Network Support:
  • Currently supports Linea network only
  • Returns fees in multiple denominations (wei, ETH, USDC)

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)

Response

string
Gas fee estimate in wei (smallest ETH unit)
string
Gas fee estimate in ETH
string
Gas fee estimate converted to USDC at current exchange rate

Code Examples

Best Practices

Fee Calculation: Fees are estimates based on current network conditions. Actual fees may vary slightly when the transaction is executed. Always add a small buffer for production implementations.
User Experience: Display both the fee amount and the net amount the user will receive. This transparency helps users make informed decisions about timing their withdrawals.
Fee Volatility: Gas fees on blockchains fluctuate based on network congestion. During high-traffic periods, fees can increase significantly. Consider implementing fee alerts or maximum fee thresholds.

Edge Cases

High Network Congestion

During peak network usage, gas fees can spike:
  • Fees may temporarily exceed the withdrawal amount for small transactions
  • Consider implementing minimum withdrawal amounts to ensure economical transactions
  • Poll this endpoint periodically to catch fee reductions

Fee Precision

Fee amounts include many decimal places for accuracy:
  • Always use decimal or BigInt types, never floating-point arithmetic
  • Round displayed values appropriately for user presentation
  • Store full precision values for accounting purposes

Network Limitations

Currently Linea network only:
  • Other networks will return an error
  • Check user’s registered external wallet network before calling
  • Future updates may support additional networks

Calculation Example

Example: Net Amount Calculation