cURL
curl --request GET \ --url https://api.example.com/api/portfolio/holdings \ --header 'Content-Type: application/json' \ --data ' { "symbol": "<string>", "holding_type": "<string>", "shares": 123, "average_cost": 123, "notes": "<string>" } '
Get, add, update, or delete portfolio holdings
GET /api/portfolio/holdings
{ "success": true, "holdings": [ { "id": 1, "symbol": "AAPL", "holding_type": "stock", "shares": 100, "average_cost": 150.50, "current_price": 175.25, "total_cost": 15050.00, "current_value": 17525.00, "gain_loss": 2475.00, "return_percentage": 16.44, "last_updated": "2024-11-14T10:30:00Z" } ] }
POST /api/portfolio/holdings
curl -X POST https://your-domain.com/api/portfolio/holdings \ -H "Content-Type: application/json" \ -d '{ "symbol": "AAPL", "holding_type": "stock", "shares": 100, "average_cost": 150.50, "notes": "Tech holding" }'
PUT /api/portfolio/holdings/{id}
DELETE /api/portfolio/holdings/{id}
Was this page helpful?