+ def fetch_fortnox(self):
+ """ Fetch all active customers from Fortnox API. Return as dict keyed on email."""
+ res = None
+ customers = {}
+ headers = {"Access-Token":FORTNOX_Access_Token,
+ "Client-Secret":FORTNOX_Client_Secret,
+ "Content-Type":"application/json",
+ "Accept":"application/json" }
+
+ res = requests.get("https://api.fortnox.se/3/customers?filter=active", headers=headers)
+ for customer in res.json()['Customers']:
+ customers[customer['Email']] = customer
+ return customers
+