getting improper statement error when using invokeUrl

getting improper statement error when using invokeUrl

greetings

i created a custom connection with zoho expense and i wanted to start manipulating records in expense using the connection and the invokeUrl method..
my function looks like this:

  1. void createExpense()
  2. {
  3. data = Map();
  4. data.put("date","2022-12-01");
  5. data.put("account_id","3599281000000000445");
  6. data.put("amount",1000);
  7. data.put("paid_through_account_id","3599281000000000361");
  8. data.put("description","Salary payment for employee Test Employee");
  9.   response = invokeUrl
  10.   [
  11.   url : https://expense.zoho.com/api/v1/expenses
  12.   type : POST
  13.   parameters : data
  14. headers: "Content-type:application/json"
  15.   connection : "test_expense_connection"
  16.   ]
  17. }

but when i try to save my function before running it i keep getting the improper statement error on line 9 where i'm using the invokeUrl. what am i doing wrong? what's causing this?

Thanks