Available cash only refers to your USD balance.
The Calculation Process
Calculating available cash involves fetching your account data and performing a simple subtraction of all pending order amounts from your total credits.1. Endpoints
Use the P&L endpoint to retrieve your account information. Demo Account:GET https://public-api.etoro.com/api/v1/trading/info/demo/pnl
Real Account: GET https://public-api.etoro.com/api/v1/trading/info/real/pnl
2. Header Requirements
Remember to include your authentication headers with every request.x-api-keyx-user-keyx-request-id
3. Calculation Formula
creditsis the total credit balance in your accountordersForOpenis an array of pending ordersamountis the allocated amount for each pending order
Examples
Example Calculation
If your account has:credits: 1000ordersForOpen: Two pending orders withamountvalues of 200 each
Best Practices
- Check Before Trading: Always verify your available cash before attempting to open new positions to avoid insufficient funds errors.
- Account for Pending Orders: Remember that funds allocated to pending orders are not available for new positions until those orders are cancelled or executed.
- Use the Correct Environment: Make sure to use the demo endpoint when testing and the real endpoint for live trading.