MySQLI stored procedure return PK/AI insertID
Add OUT the_id to the argument list.

Just before the END, add this statement:  SELECT INSERT_ID() INTO the_id;

Then decide how you can retrieve the id from whatever variable you pass into the proc.