HomeGuidesAPI Reference
Log In
Guides

Fetching your Income Report

Fetch an income report using the access token and report ID from the previous steps.

Authorization

To fetch a user's income report, you need the access token obtained in the previous steps. Use the access token to make requests to the Retrieve Income Report endpoint.

Endpoint Overview

Retrieve Income Report

To be able to fetch the report you need the id you received on flow initiation. Alternatively, the flow identifier is passed to the callback with which you receive the authorization code. In the latter case, you don't have to store the flow identifier on your side.

GET /rest/income-reports/{id}

{
  "period": 12,
  "income": {
    "summary": {
      "total": 1234.56,
      "low": -220.2,
      "high": 1400.5,
      "average": 2123.25,
      "href": "https://finx-s.finleap.cloud/rest/transactions?categories=3,14&since=2020-01-01&until=2020-01-31",
      "count": 14
    },
    "streams": [
      {
        "category": {
          "id": 56,
          "name": "Online-Shopping"
        },
        "first_booked_on": "2023-01-14",
        "last_booked_on": "2023-01-14"
      }
    ],
    "primary": {
      "category": {
        "id": 56,
        "name": "Online-Shopping"
      },
      "first_booked_on": "2023-01-14",
      "last_booked_on": "2023-01-14",
      "payment_partner": "Deutsche Telekom"
    }
  },
  "regular_expenses": [
    {
      "summary": {
        "total": 1234.56,
        "low": -220.2,
        "high": 1400.5,
        "average": 2123.25,
        "href": "https://finx-s.finleap.cloud/rest/transactions?categories=3,14&since=2020-01-01&until=2020-01-31",
        "count": 14
      },
      "streams": [
        {
          "category": {
            "id": 56,
            "name": "Online-Shopping"
          },
          "first_booked_on": "2023-01-14",
          "last_booked_on": "2023-01-14"
        }
      ]
    }
  ],
  "variable_expenses": [
    {
      "summary": {
        "total": 1234.56,
        "low": -220.2,
        "high": 1400.5,
        "average": 2123.25,
        "href": "https://finx-s.finleap.cloud/rest/transactions?categories=3,14&since=2020-01-01&until=2020-01-31",
        "count": 14
      },
      "streams": [
        {
          "category": {
            "id": 56,
            "name": "Online-Shopping"
          },
          "first_booked_on": "2023-01-14",
          "last_booked_on": "2023-01-14"
        }
      ]
    }
  ],
  "disposable_income": {
    "total": 1234.56,
    "low": -220.2,
    "high": 1400.5,
    "average": 2123.25,
    "ratio": 0.32
  },
  "discretionary_income": {
    "total": 1234.56,
    "low": -220.2,
    "high": 1400.5,
    "average": 2123.25,
    "ratio": 0.32
  }
}

For detailed technical information about request parameters, response formats, and implementation specifics, refer to the API reference linked above.

Error Handling

The finX API employs HTTP status codes to indicate the outcome of each API request. Familiarity with these codes is essential for understanding the response.

200 OK: This status code indicates a successful request, typically returned when retrieving income report data.

400 Bad Request: If the request is malformed, contains missing or invalid parameters, or violates validation rules, the API responds with a 400 status code.

401 Unauthorized: When the provided authorization is insufficient or invalid, the API responds with a 401 status code, indicating the need for proper user authentication.