import requests


def get_income(acc, api_key):
    """ Return the income of the customer """
    res = requests.get("https://api.td-davinci.com/api/customers/" + acc,
                       headers={'Authorization': api_key})
    res_data = res.json()
    data = res_data["result"]
    return data["totalIncome"]