TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Get total income, expenses and balance

GEThttps://api.testingapis.com/api/Transactions/summarySign in to see this endpoint's URL

Income is the sum of positive amounts; expenses are reported as a positive total of negative amounts.

Parameters 1

NameTypeDescription
userIdquery · integer (int32)Only this user's transactions (default: all users).

Responses

200
Returns { userId, totalIncome, totalExpenses, balance, transactionCount }.
500
Unexpected server error.

Example

Request
curl -X GET "https://api.testingapis.com/api/Transactions/summary?userId=101" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
{
  "userId": 101,
  "totalIncome": 3200.0,
  "totalExpenses": 108.45,
  "balance": 3091.55,
  "transactionCount": 4
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.